问题
What is practical difference between HTML5 and DocBook?
By the word "practical" I mean differences in workflow.
This question is about difference. I'm not asking what is better. So, this question is about the facts, and so, I hope it would not be closed as opinion-based.
回答1:
DocBook separates the content and its formatting.
With single XML source you can produce:
- Various flavors of the same format
- Single HTML page
- Set of HTML pages with TOC, breadcrumbs, back of the book index
- Output in different style (for e.g. divisions withing same company)
- different logo, colors, font, legal notice, copyright
- Output for different audience
- if properly set, you can produce either public or internal content from the same source
All this is possible thanks to XSLT processing step.
Imagine e.g. footnotes. In HTML you have to add the number, in the footer the rule and the footnote content. It is helpful to the user to create links between the two. In DocBook it is sufficient to wrap the footnote content into a dedicated element. All the related stuff is generated via XSLT.
In case of HTML the appearance tweaks are limited to CSS only. While the structure can be changed as well, via JavaScript, it is not very practical.
If only simple documents are produced, targeted for single page HTML output, DocBook (generating workflow) brings another level of complexity. On the other hand, with DocBook you can deliver any output you like (for advanced ones you can hire an XSLT developer).
来源:https://stackoverflow.com/questions/42639079/docbook-vs-html-difference