How to generate useful multi-page HTML

In order to generate multi-page HTML, that is, frameset, Web Help, EPUB, we need to automatically split the source DOCX document into parts.

A new part is created each time a paragraph having an outline level less than or equal to specified split-before-level parameter is found in the source. An outline level is an integer between 0 (e.g. style “Heading 1”) and 8 (e.g. style “Heading 9”). The default value of parameter split-before-level is 0, which means: for each “Heading 1”, create a new page starting with this “Heading 1”.

Frameset example: for each “Heading 1” and “Heading 2”, create a new page (out/frameset/manual-1.xhtml, out/frameset/manual-2.xhtml, ..., out/frameset/manual-N.xhtml) starting with this “Heading 1” or “Heading 2”:

..\..\bin\w2x -p split.split-before-level 1¬

–o frameset manual.docx out\frameset\manual.xhtml

EPUB example:

..\..\bin\w2x -p epub.split-before-level 1¬

–o epub manual.docx out\manual.epub

Web Help containing “semantic” XHTML 5 example:

..\..\bin\w2x -p webhelp.split-before-level 1¬

–o webhelp5 manual.docx out\webhelp\manual.html

Important tip

Generating any of the multi-page, styled HTML formats should work great if, for the DOCX document to be converted, you can use MS-Word's "References > Table of Contents" button to automatically create a table of contents.

Note that the source DOCX document is not required to have a table of contents, but MS-Word should allow to automatically create a good one.

In other words, automatically creating a table of contents using MS-Word is the best way to check that your outline levels are OK.