Skip to content

Instantly share code, notes, and snippets.

@tofi86
Last active August 29, 2015 14:10
Show Gist options
  • 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;
}
@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