1

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.

Mogsdad
  • 44,709
  • 21
  • 151
  • 275
john c. j.
  • 725
  • 5
  • 28
  • 81
  • HTML5 works directly in Web browsers and DocBook doesn’t, so I guess the difference in workflow is that you can author content for the Web directly in HTML5 and it works as-is, whereas if you author it in DocBook you need to transform it into HTML5 in order to have it work on the Web. But DocBook has the advantage of providing a workflow that along with being able to generate HTML, you can also generate PDFs (and man pages and probably other formats I’m forgetting…). – sideshowbarker Jun 06 '19 at 01:33

1 Answers1

1

DocBook separates the content and its formatting.

With single XML source you can produce:

  1. Various flavors of the same format
    • Single HTML page
    • Set of HTML pages with TOC, breadcrumbs, back of the book index
  2. Output in different style (for e.g. divisions withing same company)
    • different logo, colors, font, legal notice, copyright
  3. 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).

Jan Tosovsky
  • 498
  • 5
  • 18