Write books in the HTMLBook standard using Scrivener

By on October 20, 2014 - Geekery

My favorite writing tool is Scrivener. I wrote the Learning MCollective book for O’Reilly Media entirely in Scrivener, exporting to AsciiDoc. I was afraid this wouldn’t work very well, but it ended up working just great. You can get my export settings and processing scripts from https://github.com/jorhett/scrivener-asciidoc.

O’Reilly Media promotes and utilizes a lot of web standards. They have switched over to using HTMLBook for new projects. HTMLBook is an XHTML5-based standard for the authoring and production of both print and digital books.

To support this in my upcoming book, I created a Scrivener compile format which outputs chapter headings in HTMLBook. Then I wrote some scripts to process the output from Scrivener compile to make valid HTMLBook, cut into parts and adjusted for the expectations of O’Reilly Atlas.

I have released my Scrivener compile settings and scripts so that others can use them. They are open source under an Apache license at https://github.com/jorhett/scrivener-htmlbook.