Export as multiple HTML files

Hi! I’ve been a fan of Scrivener for ages now, but this is my first time writing in. The feature I long for is one that I’ve been wanting for quite some time, but I’m writing now because I happened to actually look through the forums and found them to be quite pleasant and friendly, so it occurred to me that I might get an answer. :slight_smile:

So, let me explain a bit about how I use Scrivener, to provide context for what I’m trying to do. I’m not a writer - I’m a software developer, and work on games in my spare time. I use Scrivener mostly as a note-taking application to organize the disparate parts of projects, which I’ve found that it’s wonderful for. In this scenario I don’t need to export at all, since what I write is only for my own consumption. Recently, however, I started a large project which I plan to actually publicize a bit - you can preview the project at github.com/IreneKnapp/modern-data/ if you’re excessively curious, although I don’t expect anyone will - and it occurred to me that Scrivener might be a useful tool for maintaining its documentation, which is already rather lengthy, with about a thousand nodes (though some are very short).

I’ve previously maintained documentation for other projects in various flat-file formats, including DocBook (about which the less said, the better) and Texinfo. I found that a standard text editor may be a wonderful tool for developing software, but it’s a horrible tool for navigating and most importantly reorganizing documents which have many content sections arranged in a tree. Breaking things up into multiple flat files for the source doesn’t help much at all. That’s why I really want to use Scrivener - I already know and like its interface, and it’s great at exactly the things that I think of as the real problems here, the organization tools.

For the cross-references that documentation requires lots of, Scrivener links fit the bill admirably. Thanks! They’re quite handy.

For a table of contents, I actually went and wrote my own little thing that processes the binder’s XML file… so that part is taken care of, although depending on what my workflow ends up being I may have to still tweak it a bit.

That leaves me with one big, big showstopper. The exported document needs to be navigable, up-down-forward-backward through the nodes, displaying some short section at a time. When I export right now, I get a 200k HTML file, with bits of prose intermingled with bits of synopsis, and it’s all horrible, and there are no anchors (I don’t think?), and I can’t really expect anyone to be able to read it, since it’s not meant to be read front-to-back like a novel would be.

I think the minimal feature that would help me is the ability to get each section of my document exported into its own separate file - automatically of course, without having to choose export a few thousand times! As far as file format, I’ll take HTML if I must, although I’d probably prefer MMD because MMD would let me do my own styling more easily. I did look into converting to one big MMD file and post-processing it, but couldn’t figure out a good way to find the split points.

Now, when I say sections - I don’t necessarily mean each and every text item in the document gets its own node. I would prefer to be able to designate some sections as “keep together”. I played a bit with the tools for specifying section breaks and they’re already pretty powerful; it seems like what’s needed is to insert a FILE break instead of a SECTION break, with exactly the same UI.

Thoughts? Have I articulated what I want clearly? Does it seem feasible? eager eyes :slight_smile:

¡Anchors! Even if we’re limited to a single HTML file on export, that file should use element IDs that correspond to document reference numbers, so that Scrivener Links remain functional in the HTML rendition.

Thank you Irene. :slight_smile:

Rgds – Jerome

There’s no need for synopses to be mingled with the text - you can set up what you want there via the “Formatting” pane of Compile.

One thing you could try to achieve what you want is to export to .epub format, then change the “.epub” extension to “.zip” and extract the files. Or, export to Kindle and in the “KindleGen” Compile options, choose to save the source files. You could then grab the HTML files. A new HTML file is created for each section based on page breaks, and internal links are maintained, so this should do what you want if I understand correctly.

Hope that helps.

All the best,

Hi Irene,

will compiling to an ebook help you?

Ebooks are zipped files, which include one or more html-files, depending on your compile settings.

Using Sigil as a post-processor might be an option, too: it provides code view, Table of contents and Indexing (i.e. you can create a register).

i.computer-bild.de/imgs/3/1/3/1/ … ab7e0b.jpg (ToC on right side)

Best regards,
Michael Schlüter (MS-SPO)

Whoa - that’s an incredibly useful trick to know about, the epub-unzipping thing! I’m going to try it right now, and report back! :slight_smile:

Another approach is to use the Kindle output, with the “Save the source files in a folder with the exported Kindle file” open enabled in the KindleGen compile option pane. This will output a clear folder with XHTML files, CSS and a few e-book glue files that can be discarded. Of course that requires KindleGen be installed, so if you don’t already have it the ePub trick is probably easier.

With compliments from a has-been Perl-hacker :wink:

Was my reply invisible? :smiley:

Poor Keith. He never gets any credit.

By the way, nice work on that Scrivener program, Ioa. You’ve worked very hard to make it a pleasure to use. 8)

Pffbt. :exclamation:

I’m beginning to believe that KB doesn’t really exist. This entire L&L thing could be a an Ioa-iffer project to see our reactions, or a projection of Vic-k’s mental … stuff.

Just sayin’

KB who?

That’s Kevin Blunt, Phil.
Hope this helps

Pah, I’ve been called worse. Like when my friends in middle school learned what a spoonerism was and omitted the “o” from my surname…

him? :open_mouth:


Nahh…not him. Kev’s not as good-looking as that guy. The mugshot resembles Ioa (AmberV) more than young Kev.

Full disclosure time: I’m not sure who frightens me (mental fear of “what’s next?”) more, Ioa or Vic-k. I[m often conflicted with the thought “they may be the same person”, but having met Vic-k in person, think that is more an irrational fear. More my mind playing the role of terrorist in a bad mid-east movie.

Imagine if they joined forces. :open_mouth: