... | ... | @@ -8,9 +8,9 @@ HTMLevator supports structural induction and "section type inferencing" in conve |
|
|
|
|
|
HTMLevator relies on [XSweet](https://gitlab.coko.foundation/wendell/XSweet) (a companion project) via its Header Promotion pathway to produce HTML h1-h6 in HTML extracted from Word `docx` files wherever Paragraph Styles are assigned named "Header 1" through "Header 6".
|
|
|
|
|
|
Prepare your Word file for HTMLevator by assigning "Header 1" - "Header 6" styles to your section titles at their respective levels of hierarchy. (Assign the style to the first line of the title only. Subtitles or subsequent lines of multi-line titles should not use these styles.) Within Word (since by default these styles are bound to the appropriate Outline level), this nominal structure can ordinarily be displayed in the Outline View (even before XSweet/HTMLevator are run).
|
|
|
Prepare your Word file for HTMLevator by assigning "Header 1" - "Header 6" styles to your section titles at their respective levels of hierarchy. (Assign the style to the first line of the title only. Subtitles or subsequent lines of multi-line titles should not use these styles.) Within Word (since by default these styles are bound to the appropriate Outline level), this nominal structure can ordinarily be displayed in the Outline View, even before XSweet/HTMLevator is run.
|
|
|
|
|
|
When the Word file has these Paragraph Style assignments, XSweet and HTMLevator do the rest - XSweet makes HTML with h1-h6, then HTMLevator makes nested sections for the detected headers. (And goes from there to do things with these sections if/as necessary).
|
|
|
Finding these Paragraph Style assignments in the `.docx`, XSweet and HTMLevator do the rest - XSweet makes HTML with h1-h6, then HTMLevator makes nested sections for the detected headers. (And goes from there to do things with these sections if/as necessary).
|
|
|
|
|
|
HTMLevator can also be used on files with no such preparation but YMMV - its efficacy depends entirely on whether/how XSweet header promotion works to detect h1-h6 on your file.
|
|
|
|
... | ... | @@ -18,7 +18,7 @@ More details: |
|
|
|
|
|
## Structural induction
|
|
|
|
|
|
Any sequence of HTML elements leading with a header (h1-h6) is wrapped as a section. Within the section, the h1-h6 plus its elements is following by sections for contiguous (subsequent) lower level sections.
|
|
|
Any sequence of HTML elements leading with a header (h1-h6) is wrapped as a section. Within each section, the header plus its (block level) elements are followed by sections for contiguous (subsequent) lower level sections.
|
|
|
|
|
|
I.e. h1 h2 h2 h3 h1 h2 h3 becomes section (h1 section (h2) section (h2 section (h3) ) ) section (h1 section (h2 (section h3) ) ).
|
|
|
|
... | ... | @@ -64,7 +64,7 @@ Notes: |
|
|
(before the first section)
|
|
|
* Hence sequences with no headers, are unchanged
|
|
|
* The logic should also apply to 'section' elements as well as wrapper elements
|
|
|
* Hence, a properly sectioned HTML is returned unchanged
|
|
|
* Hence, a properly sectioned HTML is returned unchanged, but one whose headers do not lead sections is "repaired".
|
|
|
* When sections are skipped (e.g. h4 appearing before h3), the extra section wrappers should *not* appear. So such a section comes wrapped as if it were at a higher level - although its header still indicates its 'presentation' level.
|
|
|
|
|
|
(Examples:
|
... | ... | |