Support for EU requirements on EPUB accessibility

Hello!

I recently compiled a new EPUB post EU accessibility requirements changes, and I was wondering if it’s possible to add/change a couple of things in Scrivener, to reduce the amount of manual work in Sigil later?

  1. Change the language from (e.g.) “English” to “en” when the EPUB is compiled:

Currently: html xml:lang=“English” lang=“English”

Wish: html xml:lang=“en” lang=“en”

  1. Add / manage the mandatory metadata at project level (or even Scrivener level) - The Access-Aide plugin for Sigil does add some of it, but not all (in the opf) :
<metadata xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:opf="http://www.idpf.org/2007/opf">
    <dc:title>xxxxxx6</dc:title>
    <dc:language>english</dc:language>
    <meta property="dcterms:modified">2025-12-10T18:30:14Z</meta>
    <dc:creator id="author">xxxxx</dc:creator>
    <meta refines="#author" property="file-as">xxxxx</meta>
    <meta refines="#author" property="role">aut</meta>
    <meta property="schema:accessibilitySummary">This publication conforms to WCAG 2.0 AA.</meta>
    <meta property="schema:accessMode">textual</meta>
    <meta property="schema:accessMode">visual</meta>
    <meta property="schema:accessModeSufficient">textual</meta>
    <meta property="schema:accessibilityFeature">structuralNavigation</meta>
    <meta property="schema:accessibilityHazard">none</meta>
    <dc:identifier id="PrimaryID">xxxxxxx</dc:identifier>
    <meta name="cover" content="cover-image" />
    <meta name="Sigil version" content="2.7.0" />
    <meta property="a11y:certifiedBy">xxxxx</meta>
    <meta property="a11y:certifierCredential">xxxxx</meta>
    <meta property="a11y:certifierReport">reports/a11y.xhtml</meta>
    <meta property="dcterms:conformsTo">http://www.idpf.org/epub/a11y/accessibility-20170105.html#wcag-a</meta>

Thank you!

1 Like

Somehow the HTML got lost (and I can’t figure out how to edit the post):

?xml version=“1.0” encoding=“utf-8”?>

package version=“3.0” unique-identifier=“PrimaryID” xml:lang=“English” xmlns=“http ://www.idpf.org/2007/opf”>
metadata xmlns:dc=“http ://purl.org/dc/elements/1.1/” xmlns:opf=“http ://www.idpf.org/2007/opf”>
dc:title>xxxx</dc:title>
dc:language>english</dc:language>
meta property=“dcterms:modified”>2025-12-10T18:30:14Z
dc:creator id=“author”>xxxx</dc:creator>
meta refines=“#author” property=“file-as”>xxxx
meta refines=“#author” property=“role”>aut
meta property=“schema:accessibilitySummary”>This publication conforms to WCAG 2.0 AA.
meta property=“schema:accessMode”>textual
meta property=“schema:accessMode”>visual
meta property=“schema:accessModeSufficient”>textual
meta property=“schema:accessibilityFeature”>structuralNavigation
meta property=“schema:accessibilityHazard”>none
dc:identifier id=“PrimaryID”>urn:uuid:xxxxxxxxxxxxxxxxxx</dc:identifier>
meta name=“cover” content=“cover-image” />
meta name=“Sigil version” content=“2.7.0” />
meta property=“a11y:certifiedBy”>xxxx
meta property=“a11y:certifierCredential”>xxxx
meta property=“a11y:certifierReport”>reports/a11y.xhtml
meta property=“dcterms:conformsTo”>http ://www.idpf.org/epub/a11y/accessibility-20170105.html#wcag-a
/metadata>

What version of Scrivener do you have, please, and on what platform?

Version: 3.1.6.0 (2862669) 64-bit on Windows

1 Like

By the way, I fixed the formatting in your original post. For future reference, you will find a code button on the formatting toolbar (looks like </>) which you can use to safely insert XML, HTML or anything else that is preformatted.

Language markers

On this, I have not been able to achieve the result you describe, of getting the word “English” inserted into language fields rather than the ISO standard marker for it. When I select English as the language in Scrivener’s Metadata tab, this is what I get at the top of the XHTML files:

<html xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">

If I select Spanish, I get:

<html xml:lang="es" lang="es" xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">

So that’s all how it should be. But one thing I do note is that your code sample is has been edited by another program, Sigil in this case. So we aren’t really looking at what Scrivener produces.

What I see that we could do better is explicitely declaring “en” in the OPF file rather than leaving it to defaults. If you do pick something else, then the OPF is formatted correctly:

<dc:language>es</dc:language>

We should be using that with English, too, and this is a problem specific to the Windows version. I’ll make sure we have a ticket for getting that fixed.

Freeform metadata

As to the rest, at this time we don’t have plans to add a complicated freeform metadata editor like Sigil has. That might change, I wouldn’t rule it out entirely, but for now you would want to finalise the ePub in a production tool like Sigil. Scrivener at least saved you the two weeks of manual assemble of your content in it. :wink:

The Pandoc Option

I would also give consideration to use Scrivener’s alternative conversion engine, Pandoc (which you would need to install first and restart for it to pick up). It includes a much better ePub generator, if we are to look at things from the side of internal code quality, semantics and structural ease of design. If you’re looking at it from the standpoint of wanting to use a GUI to change how your heading font looks, it’s not so good for that. It expects you to bring all of your CSS with you.

But, one aspect you gain from using it is that it appears to have a fairly comprehensive amount of accessibility metadata built-in to its stock output, and what it also provides is a mechanism for inserting your own code directly into the OPF (which is what we’re using to get Scrivener’s metadata fields in there). Hence freeform metadata entry.

Such would mean not using Scrivener’s Pandoc → ePub setting, you’d have to set up the cover page, CSS file and metadata insertion file yourself, then compile the .md file and use Pandoc to generate it from these materials. But if you are inclined toward setting things up like that, it might overall be easier for you to do that then muck about in GUIs that don’t do everything you want and require you to manually click on buttons and fields every time you output. Approaches like Pandoc take more up-front setup, but once you’ve got it set up, it’s easy one-shot output from that point onward. Scrivener goes one step further and lets you set the command into your compile settings, so that it truly does become as simple as clicking the compile button once you have it set up, no matter how much automated post-processing you are doing.

See also

Further on the matter of making accessiblity-friendly ebooks, here are a couple of forum threads with discussion:

4 Likes

Thank you Amber!

Pandoc looks way too complicated for my usage, but thank you for the comprehensive explanation nonetheless.

And thank you for the ticket about the language issue, I’ll keep on editing manually in the meantime!