Let’s Split Up but Stay Friends

Just a book should (must?) have multiple pages, an E-book should have multiple .html files.

Having one big .html file for the interior of our E-book has its advantages. After all, what’s the expression we use when we talk about keeping a project organized? “Let’s make sure we’re all on the same page.” But we’re (almost) done with the HTML and CSS portions of our book, and there are good reasons to split our .html file into smaller .html files:

splitting .html file into smaller files

  • Compatibility with older E-readers. Some of the early E-books couldn’t load a file larger than 128K or 256K. Splitting our book into segments helps us keep early-adopters in the game.
  • Easier navigation on some devices. Some devices, again, often older ones, allow the reader to “blip” ahead by section. If your anthology is all one big section, then the only “blips” allowed will be the very beginning and end of the book.
  • Guaranteed page breaks. Sometimes, you just need to be certain that a certain line will appear at the top of a new page. Start with a fresh .html file and know that it will have a fresh page all to itself.
  • Alternate cascading style sheets. YBR uses one CSS, but it might be that part of your book (a prose section, perhaps) will refer to a different .css file. Put that part on its own .html file and you’re good to go!
  • Reuse of “evergreen” sections. Okay, look, the back 10 pages of every Bicycle Comics poetry E-book thus far has been 8 pages of advertising for our other E-books. We don’t want to re-write or re-code that section; we just want to pop it in.

To be clear, we are making one E-book poetry anthology; an E-book can contain multiple .html and .css files. For the Tandem anthologies, we made each month its own chapter, so each month got its own .html file, as did the frontmatter and backmatter. But we combined those .html files into one EPUB file for each of our E-books. Here are the steps:

  1. Make copies of our .html file, one for each section or chapter.
  2. Delete the redundant parts of each .html file.
  3. Link the Table of Contents.
  4. Test every single link. Twice.

1. Make copies of our .html file, one for each section or chapter.

array of identical .html files, ready to be customized

This illustration depicts four sections, not five, because cartoons are simplifications.

Importantly, name each file something different. For Yellow Buick Review, we’ll have five sections.

Frontmatter
The inside cover, copyright info, and table of contents.
Preface
“From the Editor” and the epigraph.
April Contest Winners
Poems by Stan Grenfield and Jennifer Riggle.
April Contributors
Poems by Nancy Kilroy, Andy Krenshaw, and Amit Matthews.
Backmatter
Poet biographies, “About our Next Issue,” and “You May Also Like” (promotions for our other titles).

The sections do not include front and back covers; those come later. I’ll name the files YBR_11_Frontmatter, YBR_11_Preface, YBR_11_Contest, YBR_11_Contributors, and YBR_11_Backmatter. Note that we do not need to make extra copies of the .css file; the whole point of external cascading style sheets is that multiple .html files can share one .css file!

2. Delete the redundant parts of each .html file.

deleting duplicate content across the identical .html files

Poof! Is a highly technical term that I expect will become part of the HTML6 standard.

I may catch some flack for this part, my subtractive workflow, but I think it’s the right way to go. You could make five (or six or ten) blank .html files, and then paste in appropriate content for each one (head and body). With either method, you might forget something. It could happen. I think forgetting to delete something is better than forgetting to include something. No poet we have published has ever complained about having extra content in one of our books.

I highly recommend you make these deletions in “code view” mode. You want to leave in the headers, although you should probably change the “title” field up in the header, as I’ve done. Don’t leave extra tags; when you delete a section, the whole section including tags should go.

For example, in YBR_11_Frontmatter.html, I highlight and delete everything in blue:

highlit code about to be deleted from YBR_11_Frontmatter.html

I delete from line 45…

highlit code about to be deleted from YBR_11_Frontmatter.html

…all the way down to and including line 270.

So my file’s markup ends up as this:


<p class="PoemStanza">Andy Crenshaw</p>
<p class="PoemLineIndent1">The Sum of its Parts</p>
<p class="PoemStanza">Amit Matthews</p>
<p class="PoemLineIndent1">On the Sixth Anniversary of its Demotion, Pluto Facebook-Stalks Astronomers Mike Brown and Neil deGrasse Tyson</p>
<p class="PoemStanza">Poet Biographies</p>
<p class="PoemStanza">About our Next Issue</p>
</body>
</html>

Figuratively speaking, my files look something like this:

individual .html files with duplicate content removed

Presto! We have files with just the content we want.

I’ve included both “pre-poof” and “post-poof” versions of these files in the .zip file you can download, so you can practice everything.

3. Link the Table of Contents.

Dreamweaver makes this step a snap, but you can do it with any HTML editor or even in a text editor—if you are careful. Screwing up the Table of Contents is a bookbinding faux pas.

individual .html files with contents linked to TOC

Even though we’ve split up, you should still keep in touch.

4. Test every single link. Twice.

Transfer the .html and .css files to a different computer and try browsing them from there. Ask a friend or coworker who hasn’t been involved with the project to peruse the files in a Web browser.

4. Test every single link. Twice.

I can’t stress this step enough. As the editor, you know how to get around in your book. Your readership will not. Some will be happy to browse through using “next page” and “last page” buttons, but a mis-linked ToC will frustrate some readers.

Different poetry anthologies will require different levels of splitting. It’s possible that each poet or even each poem might end up on its own .html document, although that kind of granular separation cries out for adroit use of <div> tags.

Can you publish a poetry anthology as one .html file? Yes. Certainly doing so means less work on the editorial/typesetting end. But that goal oughtn’t be paramount. You will probably forsake readers who use early models of Nook, Kindle, and Kobo. You will forgo some control over where “pages” end and begin. You’ll have a harder time releasing “sample” versions of your E-books. Breaking up may be hard to do, but if you stick to good version control and editing practices, you’ll be stronger for having done it.

Leave a comment

Filed under Code Samples, Organization and Data

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s