PDF→EPUB: Remove role="doc-footnote", recommend EPUBCheck.

“[…] when you add a role to an element you change its nature to
assistive technologies. So because doc-footnote isn't a list item role,
it would strip the li tag of its list item nature and turn it into
something more like a div or a p tag. That breaks the list semantics for
AT users, so they'd no longer be able to access the list as though it
were a list.”
<https://github.com/w3c/epubcheck/issues/1018#issuecomment-809376951>
This commit is contained in:
tastytea 2021-03-29 16:16:02 +02:00
parent cca19ccf17
commit fb921af466
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
1 changed files with 14 additions and 8 deletions

View File

@ -25,6 +25,8 @@ toc: true
:url-epub-spec: https://www.w3.org/publishing/epub/epub-contentdocs.html :url-epub-spec: https://www.w3.org/publishing/epub/epub-contentdocs.html
:url-ap-semantics: https://www.accessiblepublishing.ca/epub-semantic-aria-roles/ :url-ap-semantics: https://www.accessiblepublishing.ca/epub-semantic-aria-roles/
:url-epub3-rendering: http://idpf.org/forum/topic-623 :url-epub3-rendering: http://idpf.org/forum/topic-623
:url-epubcheck: https://github.com/w3c/epubcheck
:url-epubcheck-footnote: {url-epubcheck}/issues/1018#issuecomment-809385963
:wp-pdf: https://en.wikipedia.org/wiki/PDF :wp-pdf: https://en.wikipedia.org/wiki/PDF
:wp-epub: https://en.wikipedia.org/wiki/EPUB :wp-epub: https://en.wikipedia.org/wiki/EPUB
:wp-xhtml: https://en.wikipedia.org/wiki/XHTML :wp-xhtml: https://en.wikipedia.org/wiki/XHTML
@ -204,15 +206,14 @@ Once you are done, copy the result into Calibre.
Use the method from above to copy the footnotes into the now empty Emacs buffer Use the method from above to copy the footnotes into the now empty Emacs buffer
and clean them up until you have 1 paragraph per line. Footnotes need to be and clean them up until you have 1 paragraph per line. Footnotes need to be
hyperlink-able, so we can't just wrap them in plain `<p>` tags, they need IDs. I hyperlink-able, so we can't just wrap them in plain `<p>` tags, they need IDs. I
like to use `<li epub:type="footnote" role="doc-footnote" id="fn1">[…]</li>` if like to use `<li epub:type="footnote" id="fn1">[…]</li>` if the footnote numbers
the footnote numbers are increasing throughout the book or `<li are increasing throughout the book or `<li epub:type="footnote"
epub:type="footnote" role="doc-footnote" id="fn1_1">[…]</li>` if they start with id="fn1_1">[…]</li>` if they start with 1 in each chapter. We are going to use a
1 in each chapter. We are going to use a macro with a counter to generate macro with a counter to generate consecutively numbered IDs. First, set the
consecutively numbered IDs. First, set the counter to 1 with kbd:[C-x] kbd:[C-k] counter to 1 with kbd:[C-x] kbd:[C-k] kbd:[C-c] `1`. Then, record this macro:
kbd:[C-c] `1`. Then, record this macro:
`<li epub:type="footnote" role="doc-footnote" id="fn1_` kbd:[C-x] kbd:[C-k] `<li epub:type="footnote" id="fn1_` kbd:[C-x] kbd:[C-k] kbd:[<tab>] `">`
kbd:[<tab>] `">` kbd:[<end>] `</li>` kbd:[<down>] kbd:[<down>] kbd:[<home>] kbd:[<end>] `</li>` kbd:[<down>] kbd:[<down>] kbd:[<home>]
[TIP] [TIP]
Use kbd:[M-x] `describe-key` (mapped to kbd:[C-h] kbd:[k] by default) to find Use kbd:[M-x] `describe-key` (mapped to kbd:[C-h] kbd:[k] by default) to find
@ -252,6 +253,8 @@ copyright page, beginning of text and so on.
Select menu:Tools[Check book] and fix the errors. Select menu:Tools[Check book] and fix the errors.
Use link:{url-epubcheck}[EPUBCheck] for a more thorough check.
You're done! Enjoy your cleanly formatted book. 😊 You're done! Enjoy your cleanly formatted book. 😊
== Updates == Updates
@ -265,5 +268,8 @@ You're done! Enjoy your cleanly formatted book. 😊
`<span><aside>` with `<li>`. `<span><aside>` with `<li>`.
* [2021-03-27] Added conversion to EPUB 3, use HTML 5 and ARIA attributes in * [2021-03-27] Added conversion to EPUB 3, use HTML 5 and ARIA attributes in
example, added accessibility-advice. example, added accessibility-advice.
* [2021-03-29] Removed `role="doc-footnote"` from ``<li>``s because it
link:{url-epubcheck-footnote}[breaks the list semantics for Assistive
Technology users].
// LocalWords: Calibre // LocalWords: Calibre