The following guidelines will configure InDesign to create nearly usable html via export. Once you export you'll have 1 big html file to manipulate in the next step.
- Thread text boxes that contain related content to be exported.
- Establish Paragraph Styles for exporting unique block level elements (h1, p, etc)
- Establish Character Styles for exporting inline elements (span, strong, em, etc.)
- Use lists and tables properly and they themselves out
- Inside your Paragraph and Character Styles, set up 'Export Tagging' to map desired elements and classes to export
- Create on Article per desired HTML page to be output and set it up with appropriate content
- Any images that should be exported in the flow of content needs to be properly anchored
- Export html with these settings altered from defaults
- Content order: Same as Articles Panel
- Advanced: uncheck both css boxes
Use this node script to break the large file up into usable partials and remove unwanted markup that InDesign insists on creating.
- You'll probably want to change the value of sourceFile to match your exported file name
- Add 'key: value' to idList per html document that you'd like to split out of the master css (key will be the file name, value is the '#_idContainer' number that InDesign automatically stamps on divs
- The cruft array contains classes that you'd like to discard (this is needed because InDesign no longer lets you leave the class blank in 'Export Tagging' to produce no class.
node inDesignToHTML.js
Set up partials to include your the chunks of html generated in the previous step. For this, I prefer middleman (ruby) or assemble (js).