Skip to content

Latest commit

 

History

History
115 lines (90 loc) · 5.42 KB

README.en.md

File metadata and controls

115 lines (90 loc) · 5.42 KB

EpubTools README

Licence VS Code Marketplace Rating Installs Downloads

Tools to facilitate work on EPUBs.



Important

The EPUB file must be uncompressed. Then you can work in his directories.


EpubTools contents (ctrl+shift+P)

  • EpubTools : Insertion nav

    (If a title (<h.>) exists inside the <nav>, it will be preserve.)

    Display a drop list with:

    • TDM : Inserts or modifies table of content in (toc).xhtml or (toc).ncx using the spine of the opf.
      If needed, add id="toc-epubtools-XX" in the titles (<h.>) to create anchors.
    • Page List: Retrieves tags with the epub:type="pagebreak" attribute. Creates or modifies <nav epub:type="page-list"> in the table of contents file (toc).xhtml.
    • Table List: Inserts or modifies a list of <tables>.
    • Illustration List: Inserts or modifies a list of <figure> containing <img>.
    • Audio List: Inserts or modifies a list of <audio>. Retrieves aria-label in the tag otherwise the id.
    • Video List: Inserts or modifies a list of <video>. Retrieves aria-label in the tag otherwise the id.
  • EpubTools: A11Y

    Open a list of tools to improve accessibility (a11y):

  • EpubTools: Manifest

    Rebuilds the manifest in the OPF according to the files in the EPUB. The command must be launched in the .opf file.
    Rename the files with diacritics (e.g.: accents) or space in their names.

  • EpubTools: first <h.> => <title>

    Copy the first title (if any) of each xhtml page into the <title> tag of that page.

  • EpubTools: Problems?

    Displays problems or warnings in the OUTPUT tab:

    • Pages without <h>.
    • Bad hierarchy of titles (e.g., h1 followed by h3 without h2 between them).
    • Issues with <spine> if idref in <itemref> are missing in the <manifest>.
    • <table> without <th>, scope or <thead>
  • EpubTools : <span...>{numPage}</span> => <span {epub:type} />

    Converts...

    <span class="epubTools-numPage-style">{number}</span>

    ... to

     <span id="page{number}" title="{number}" epub:type="pagebreak" role="doc-pagebreak"></span>

    Tip: Use InDesign script epubTools-numPage before export EPUB from InDesign.


EpubTools Configuration (ctrl+,)

  • epub.activerA11ylint

    Activate a11ylint (default true)

  • epub.ancreTDM

    • ajouterAncre (addAnchor): boolean (default: true)
    • nomAncre (nameAnchor): prefix's name of the anchor (default: toc-epubtools)
  • epub.classeTDM

    CSS class applied to the <ol> tag in the TOC (default: ol-toc)

  • epub.coverImage

    Name of the file of the cover image (add properties="cover-image" to this image in <manifest> - default cover)

  • epub.emphaseStyleAChercher (A11yLint)

    Text strings in CSS class names on <span> to check with A11yLint.

    • italique (défaut ["italique","italic"])
    • gras (défaut ["bold", "gras", "strong"])
    • emphase (défaut ["emphase", "emphasis"])

    e.g.: <span class="fancy-italic"> will trigger an alert with a11yLint.

  • epub.emphaseStyleAEviter (A11yLint)

    Text strings to avoid in CSS class names on <span> with epub.emphaseStyleAChercher (default ["no-bold", "no-italique","no-emphase"])

    e.g.: <span class="no-bold-italic"> will NOT trigger an alert with a11yLint.

  • epub.navTDM

    Name of the TOC file (Allow to add properties="nav" to the TOC <item> in <manifest> - défaut : toc)

  • epub.niveauTitre

    Maximum titles level in the TOC generated by EpubTools: Table of contents (default: 3)

  • epub.titreTDM ('title' of the TOC)

    • titre: Text title of the TOC (default: Table des matières)
    • balise: HTML Tag for the title (default: h1)
    • classe: CSS class for the title (default: titre1)
  • epub.styleNumPage

    CSS class to search for EpubTools : <span...>{numPage}</span> => <span {epub:type} />


A11yLint

  • Display issues with <img>:
    • if alt is empty
    • if alt is missing
  • Check if <span> with class italic, bold, etc. => change to <em> ?
  • Check noteref in <sup> => remove <sup>...</sup>
  • aria-label and controls checking in <audio> and <video> tags.