macmillanpublishers / htmlmaker_js

Repo for testing and finalizing htmlmaker javascript implementation
0 stars 1 forks source link

Endnoteshead #64

Closed mattretzer closed 7 years ago

mattretzer commented 7 years ago

@nelliemckesson , this is ready for review!

This is to fix: https://github.com/macmillanpublishers/htmlmaker_js/issues/54, as well as updating style-config.json as per https://github.com/macmillanpublishers/Word-template_assets/pull/27

Here's an overview of what's going on here:

convert.js:
I removed the endnote section from convert.js, so endnote text is being appended directly to body. I separated the 'notes' loop into separate loops for footnotes and endnotes, so endnotes would be appended to the body after the footnotes div.

style_config.json: • I updated the json structure for toplevelheads; sub-items were nested in an extraneous array. • I changed the class of Section-BackAd to bobad, to match sections.json, to fix https://github.com/macmillanpublishers/htmlmaker_js/issues/39

htmltohtmlbook.js:
• I added an endnote parent element and header, and consolidated endnotetext under that.
• I updated references to match the new toplevelheads structure (from the updated style-config.json). To test I diffed the output of htmltohtmlbook.js, with console logging to make sure all the same type class and label values were gotten (I diffed the console log output too:)

mattretzer commented 7 years ago

Oh, and one extra question, from the originating issue:

Style_config.json has Section-Notes 'label' as 'Notes', which doesn't match the heading in xsl: 'Endnotes'. Would you prefer I ... 1) change style-config.json Notes 'label' to 'Endnotes'? 2) hard code 'Endnotes' as the heading for the auto-generated Endnotes section? or 3) Just let the heading match the label for htmlmaker_js? ('Notes')

(I went ahead with option 3 in this PR - let me know if we should do option 1 or 2 instead)