Remember the Trojan Horse? The Greek army hides in a huge horse, and the horse is presented to the citizens of Troy as a gift. They bring the horse inside the city gates, the soldiers spill out, and the rest is history.
Well, instead of filling a container with an army, Laura Brady (@laurab7) of Brady Type uses an empty object in InDesign to assign epub:type properties to book elements. Here’s how she does it.
One of my main focusses is to squeeze the life out of InDesign to get the best ebooks possible from its EPUB export, so I have spent a lot of time exploring ways to level up the EPUB 3 functionality, functionality that I don’t have to fiddle with post-export.
A great feature that was added to the CC10.0 version of InDesign is a full collection of epub:type properties. Assigning an epub:type tag adds fuller semantic structure to any content, giving your ebook what I like to call “good bones.” (The full epub:type vocabulary is here.)
As rich navigation is the sexiest EPUB enhancement that I can think of, I try to set the epub:type from the InDesign file – both because then it’s part of that archived assets, and because it requires less post-export intervention.
I run an ebook conversion house and, as such, have little control over the source files that I receive. When the publisher’s workflow is InDesign-centered, I get files that run the full gamut of what InDesign can do. Since the epub:type attributes only hold when applied at the object level, and will only work when applied to the first item of threaded content, I had to find a workaround for client-supplied long documents that are threaded from page i though page 576.
I stumbled on a great solution the other day: a trojan epub:type. At the spot where I want the epub:type language added at the <div> level, I anchored an empty box with the attributes applied. So simple! In this picture, the empty frame is anchored to the start of the chapter title with the epub:types of bodymatter and prologue set up.
When exported to EPUB3, the markup looks this:
As you can see, you get a little bit of <div>-itis, which I clean up to look more like this:
This is a pretty simple hack/workaround that adds another layer of navigational depth and semantic meaning to your content.