Export as HTML

I’m writing a course that needs to be delivered as web pages, but I’d like to use Scrivener to write, edit and organise the structure.
I’m experimenting with compiling snippets of the course to create a test web page. I’d like the title structure I’ve established in Scrivener (2.8), to become heading tags (H1, H2, H3) so that I can set up a single style sheet (CSS) to deliver a simple and consistent style.
I tried compiling as HTML but I’m not getting heading tags, just paragraph tags with different styles on each line.
I’d like the output to be bare bones. Basically 3 levels of title converted to H1,2 and 3 tags, and remaining text to be paragraph text and that’s it. Is there any way of doing this in Scrivener 2.8? I’ll happily upgrade to 3 if this helps but couldn’t find any information on what I’m looking for.

Many thanks for any help and assitance.


There are some tweaks you can make to settings to get a better result:

  1. First ensure your project is set up so that heading structures are reflected in the Draft outline, with items titled as you want them to output. You can’t do this with text typed into the editor, where it is just fonts made to look like headings.
  2. In the Formatting compile option pane, enable “Title” checkboxes as necessary, click into the heading in the mock editor, and use the dropdown to the right of the Section Layout… button to set the heading level. Now you’ll get proper headings instead of formatted paragraphs.
  3. In Preferences: Import/Export: Export Options, note the HTML section in the lower middle of the pane. I’d recommend XHTML 1.0 Strict, as HTML4 is ridiculous in this day and age. For styling, “No CSS” is the cleanest output.

That’s all right, and for the most part you’ll be able to style that with CSS however you want. For the best results, avoid bold and italics in headings so that you can let the user agent handle that, the export engine will try to force the issue with

Blah blah…

Objectively the best approach is to adopt Markdown and use Scrivener’s MultiMarkdown → HTML output. Nothing you can get out of a word processor style RTF to HTML conversion will be cleaner and more semantic than that, and that remains true to this day. Plus it’s the only way you’ll get modern HTML5 out of Mac software. It’s also going to be a superior choice if you need tables. Since tables are not officially part of the XHTML strict specification, you would have to drop to using Transitional, which has a far less clean output (those ancient elements for example).

With version 2 that’s about it. Version 3 brings a number of new enhancements, most of which I have outlined in this older post. The good news is that even without a formal use of Markdown you can benefit from that conversion engine as we built a whole conversion engine to MultiMarkdown specifically to produce clean semantic code for ePub3. From the writing side you would by and large use Scrivener as you always have (yes, even including complex formatting like tables).

Otherwise, you’ll find its native HTML output hasn’t changed much, but that’s to be expected as it is largely a function of the Mac itself.

Many thanks for the response. I need to learn how the different sections work. It does sound very powerful, so should suit my needs after a bit of a learning curve.

Take care and thanks again