Trojan epub:type

  • Sumo

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.

Screen Shot 2015-09-24 at 3.00.57 PM

When exported to EPUB3, the markup looks this:

divitis

As you can see, you get a little bit of <div>-itis, which I clean up to look more like this:

cleanedup

This is a pretty simple hack/workaround that adds another layer of navigational depth and semantic meaning to your content.

5 Responses to “Trojan epub:type”

  1. Russell says:

    Hey there, there is this question that is bugging me for the longest of time. When I export my ePub3 from inDesign and run the ePub through the ePub validator, I always face tons of warnings and errors.

    Is there a structure or a way to do my ePub in inDesign so that when I export the contents, there will be no warnings and errors from the ePub validator?

  2. Kevin Callahan says:

    Hi Russell, it’s hard to diagnose a project without seeing it. I can recommend a couple of resources:

    To get a clear, step-by-step guide to exporting a valid EPUB from InDesign, look at Anne-Marie Concepcion’s video on Lynda.com. You might see things there that you’re missing or could do another way.

    And, FlightDeck is an excellent (paid) service that both validates and gives very helpful info in understable language on what’s going in your EPUB. The site (https://ebookflightdeck.com/) also includes a free handbook with a lot of information and tips.

    You can also join the conversation on Twitter at #eprdctn and ask any questions you have. Next Wednesday (October 7) at 11 AM (EST) will be an open session, where folks can ask any questions they have. There should be a lot of developers around at that point, so perhaps you’re problems can be addressed.

  3. Russell says:

    Hi Kevin,

    Thank you so for your valuable inputs. I will definitely look into Anne-Marie’s videos to learn the step-by-step way to create an ebook in inDesign! Hopefully they will be error/ warning free!

    Thanks for the help!

  4. […] is the ability to create ebooks with many layers of rich navigation. From InDesign you can create a full set of landmarks for a robust EPUB3 file. But compiling a Page List has been, up until now, a fairly onerous […]

  5. Claire says:

    Hi thanks for this tips, it’s run very fine. I work with indesign and I need some help. When I export my ePub 3, epubcheck is okay (No error or warning detected). But when I submit file to the distributor/broadcasters, they send me this error log :
    Controle de présence des attributs epub:type
    Il manque une balise section dans le(s) fichier(s) suivant(s):cover.xhtml Couverture.xhtml Titre.xhtml…
    (epub: type – missing “section” tag)
    Have you an idea / solution? Thanks