Skip to content

Instantly share code, notes, and snippets.

@tofi86
Last active August 29, 2015 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tofi86/20e9ab2f04239f05794a to your computer and use it in GitHub Desktop.
Save tofi86/20e9ab2f04239f05794a to your computer and use it in GitHub Desktop.
Abbreviations and acronyms in EPUB3 - best practice

Following an #eprdct discussion about abbreviations and acronyms and tagging conventions for EPUB 3 (https://twitter.com/tobias_fischer/status/537239302892425216) this is a first draft for future acronym/abbrev. tagging for my companies EPUBs.

Abbreviations spelled out

<p>A paragraph about <span class="abbr spell-out">HTML</span> and <span class="abbr spell-out">CSS</span>.</p>
span.abbr.spell-out {
    speak: spell-out;
    -epub-speak-as: spell-out;
}

Abbreviations read as word

<p>An article about <abbr class="read-word">NASAs</abbr> activity on the moon.</p>
abbr:not([title]) {
    speak: normal;
}

Abbreviations read full word

<p>This it the <abbr class="read-full" title="table of contents">TOC</abbr> file.</p>
abbr[title] {
    speak: normal;
}

Digits

<p>Call <span class="read-digits">911</span> to call for help!</p>
span.read-digits {
    speak: spell-out;
    -epub-speak-as: digits;
}
@tofi86
Copy link
Author

tofi86 commented Nov 25, 2014

Feedback is very appreciated! Go ahed and show me how to tag for SMIL or PLS – I don't get it ;-)

@Cuadratin
Copy link

And what about the use of <dfn> tags?:

<p>While they're essential reading material for our job, the <dfn><abbr title="World Wide Web Consortium">W3C</abbr></dfn> specifications are not exactly George R. R. Martin-level reading material.</p>

@danielweck
Copy link

Unfortunately support for the CSS Speech Module in web browsers / e-readers is not great (some Aural properties have been supported for some time, albeit not consistently across platforms).
Note that screen readers have special modes / keyboard shortcuts to read out "title" HTML attributes (VoiceOver and JAWS certainly do), and screen readers tend to use their own lexicons for known pronunciations vs. letter-by-letter spell.
Old article, still relevant (watch out for the use of dot '.' and space characters): http://lab.dotjay.co.uk/tests/screen-readers/abbreviations/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment