Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 02-17-2018, 04:49 PM   #1
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,160
Karma: 5450818
Join Date: Nov 2009
Device: many
[Plugin] Access-Aide - help improve epub accessibility

Updated: October 15, 2024
Current Version: "1.0.1"

See the Attached: Access-Aide_v101.zip

Requires: Sigil 1.6.0 or later.

Official Github site: https://github.com/kevinhendricks/Access-Aide

Changes since the Previous Release
version 1.0.1
- handle svg as special case when extracting metadata by parsing for top-level desc tag

version 1.0.0
- restrict adding xml:lang to the opf package tag to epub3 only
- make adding accessibility schema metadata conditional on no use
of audio, video, javascript, and mathml, no longer abort when they are found

version 0.9.7
- fix inadvertent whitespace indentation error caused by copy paste
version 0.9.6
- better handle cases where images have no xml metadata (Thank you BeckyEbook)
version 0.9.5
- added ability to auto fill empty image alt attributes from image metadata
including xmp AltTextAccessibility and exif ImageDescription

version 0.9.1
- reverted to allowing duplicate images each with their own alt tag per link
- Fix bug in Alt Text Editor cancel not actually cancelling the image alt text updates
- completely removed the use of the Tk graphical user interface for image
alt text editing because Tk and Pillow have no support for pure svg images.

To replace it, The Qt for Python graphical user interface as provided by
PySide6 (for Qt6) and PyQt5 (for Qt5) is used instead. The resulting Qt
based Alt Text Editing dialog is much improved and much more stable.

As a result the new minimum supported version of Sigil is ***Sigil 1.60 or later***

- if the OPF package tag does not have an xml:lang element to indicate the primary
language of its metadata tags, one is now added based the primary epub dc:language

- Beta testers have reported significant speed increases and useability improvements over the Tk version.


- version 0.5.5 - add workaround for quickparser bug not stripping attribute names properly


- version 0.5.4 - add schema::accessibilityHazard support

- version 0.5.3 - fix accessgui scaling for thin but wide images that truncate to 0 height

- version 0.5.2 - fix Windows mixed case path bug, extra whitespace bug
in xmlheader, handle self-closing title tags when updating titles

- version 0.5.1 - fix typo in variable name bug path vs apath

- version 0.5.0 - update to work with new Sigil 1.0 plugin interface

- version 0.4.3 - sync accessgui.py to master, do not add epub:type to body tags

- version 0.4.2 - update rules to assign aria roles based on epub 3.2/3.02 spec

- version 0.4.0 - initial release

License/Copying: GNU LGPL Version 2 or Version 3, your choice. Any other license terms are only available directly from the author in writing.

Minimum Sigil Version: support for this plugin is provided for Sigil 1.6.0 and later using the Python 3.4 or later Python interpreter.


Goal
The goal of this program is to help improve the Accessibility of your epub to help meet ACE requirements. It strives to create an epub that meets the following criteria:

Code:
schema:accessMode:              textual
schema:accessMode:              visual
schema:accessModeSufficient:    textual
schema:accessibilityFeature:    structuralNavigation
schema:accessibilitySummary:    This publication conforms to WCAG 2.0 AA.
schema:accessibilityHazard:     none

Before you run Access-Aide
Before running AccessAide you should make sure your epub has passed epubcheck and that you have properly added the appropriate semantic tags to mark your ebook files appropriately.


How it Works
This edit plugin will read/edit the content.opf to determine the primary language used, identify any nav or ncx and will add the appropriate metadata.
The ncx or nav is then parsed to collect titles for every xhtml file and in the case of the nav will also collect epub:type landmark information.

Then for each xhtml file, the plugin will:
1. add lang and xml:lang attributes to the html element and opf package tag
2. fill in any missing title tag that is a child of the head tag
3. will add empty alt attributes to any img tag where it is missing
4. collect a list of all image tags and their current alt text descriptions
5. add in appropriate epub:type semantic tags (for epub3 only)
6. map epub:type attributes to their appropriate aria role attribute

Then a graphical user interface is generated showing a thumbnail of every img tag image and its associated alt text description, so that the user can easily and quickly add improves textual descriptions for each image used


Limitations ...
1. In able to properly achieve the schema:accessModeSufficient: textual critieria, Access-Aide will not add the accessibiiltiy schema metadata when provided with epubs that use javascripts, audio resources, video resources, and mathml because Access-Aide simply can not tell if the proper textual descriptions are provided in these cases.

2. The schema:accessibilityHazard set to none indicates you are using only static images with no Video and no animated gifs. You need to verify that or manually edit this metadata value in your OPF.

3. svg image tags images are ignored as the "alt" attribute is not allowed on those tags. The proper way to handle svg: image tags is to provide the proper title and desc elements immediately after the svg start tag that contains the image element.

Access-Aide Plugin icon
This plugin includes a plugin icon that is in the public domain and provided by the The Accessible Icon Project that can be found at: https://accessibleicon.org for the express purpose for promoting accessibility.


Thanks to DiapDealer, Doitsu, and elibrarian with their help testing and debugging earlier versions of the this plugin and for elibrarian for for promoting the idea in the first place.

For access to fixes before the next release see my github repo for Access-Aide:
https://github.com/kevinhendricks/Access-Aide
Attached Files
File Type: zip Access-Aide_v055.zip (250.5 KB, 343 views)
File Type: zip Access-Aide_v097.zip (31.9 KB, 327 views)
File Type: zip Access-Aide_v100.zip (32.1 KB, 169 views)
File Type: zip Access-Aide_v101.zip (32.3 KB, 41 views)

Last edited by KevinH; 10-15-2024 at 11:19 AM. Reason: Adding Access-Aide_v101.zip
KevinH is offline   Reply With Quote
Old 02-19-2018, 12:04 AM   #2
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Hi

Thank you for this nice plugin!

Display question

I tried it with an Epub3 produced by ODTImport which passes Epubcheck. ODTImport produces a Text/nav.xhtml which I like to place at the end of all files and to add a link with my stylesheet.
It looks like this :
Spoiler:

Code:
<head>
  <title>EPUB 3 Navigation Document</title>
  <link href="../Styles/styles.css" rel="stylesheet" type="text/css"/>
</head>

<body>

  <nav epub:type="toc">
      <ol>
        <li>
          <a href="../Text/chapter3.xhtml">Quatrième de couverture</a>
        </li>
        <li>
          <a href="../Text/chapter6.xhtml">Préface</a>
        </li>
.../...


Once I have added semantics, your plugin adds under this nav (in the same xhtml file) the new landmarks nav.

Spoiler:

Code:
<nav epub:type="landmarks" id="landmarks" hidden="" role="directory">
    <h1>Points de repère</h1>
    <ol>
      <li>
        <a epub:type="cover" href="../Text/Chapitre-00.xhtml" role="doc-cover">Couverture</a>
      </li>
      <li>
        <a epub:type="titlepage" href="../Text/Chapitre-02.xhtml">Page de Titre</a>
      </li>
      <li>
        <a epub:type="copyright-page" href="../Text/Chapitre-03.xhtml">Page de Copyright</a>
      </li>
.../...


This one is displayed only with the Prince PDF and appears neither in Sigil or in Calibre editor preview. It appears though in Code View with the Calibre editor.

Also to the previous nav has been added the expression : role="doc-toc"

What did I miss to make it appear in Code view and display in preview?
roger64 is offline   Reply With Quote
Advert
Old 02-19-2018, 05:12 AM   #3
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Hi

I got a side help and -needed- explanation. It seems that the landmarks nav is not to be displayed in code view (hidden " ") and that Prince should in fact not display it.

So it was a misunderstanding of mine. The modified Epub3 with its new semantics attributes and the changes made with the Access-Aide plugin is just fine.

I learnt something. Thanks again for this plugin.
roger64 is offline   Reply With Quote
Old 02-19-2018, 09:35 AM   #4
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,160
Karma: 5450818
Join Date: Nov 2009
Device: many
The landmarks are to epub3 very much like the opf guide in epub2. Its entries are used to mark files as to their functional/structural role. They are a required part of a valid nav as the guide itself has been deprecated in epub3. The landmarks section of the nav is typically not displayed directly and is instead meant to be machine readable.

Both epub:type and aria role attributes are meant to be used by the ebook author/developer to add semantic information to aide structural navigation of the epub, and provide screen readers for use by readers with vision impairment or other accessibility issues more information to help better convey the epub.
KevinH is offline   Reply With Quote
Old 04-10-2018, 05:19 PM   #5
LauraB7
Junior Member
LauraB7 plays well with othersLauraB7 plays well with othersLauraB7 plays well with othersLauraB7 plays well with othersLauraB7 plays well with othersLauraB7 plays well with othersLauraB7 plays well with othersLauraB7 plays well with othersLauraB7 plays well with othersLauraB7 plays well with othersLauraB7 plays well with others
 
Posts: 9
Karma: 2744
Join Date: Nov 2017
Device: all
Help installing the plugin

I am so excited about this plugin. But I can't get it to work. Can someone point me in the right direction? When I try to load it via "Manage Plugins", navigate to the folder containing it, etc., everything is greyed out and not chose-able.

I have a feeling I am missing something that is mean to be installed underneath Sigil, but I don't know what it is.

Any help would be greatly appreciated.
LauraB7 is offline   Reply With Quote
Advert
Old 04-10-2018, 07:43 PM   #6
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,160
Karma: 5450818
Join Date: Nov 2009
Device: many
A Sigil plugin is a zip file. It should not be unzipped further. The install process will properly handle that.

Many people have download managers or browsers that unzip zip archives automatically when they are downloaded. These will mess up the downlad. Try using a brower like Firefox and right click on the link for the plugin and tell Firefox just to download it and not try to unpack it.
KevinH is offline   Reply With Quote
Old 04-11-2018, 04:52 PM   #7
LauraB7
Junior Member
LauraB7 plays well with othersLauraB7 plays well with othersLauraB7 plays well with othersLauraB7 plays well with othersLauraB7 plays well with othersLauraB7 plays well with othersLauraB7 plays well with othersLauraB7 plays well with othersLauraB7 plays well with othersLauraB7 plays well with othersLauraB7 plays well with others
 
Posts: 9
Karma: 2744
Join Date: Nov 2017
Device: all
Thank you!
LauraB7 is offline   Reply With Quote
Old 04-27-2018, 02:52 PM   #8
noteon
Connoisseur
noteon is on a distinguished road
 
Posts: 55
Karma: 54
Join Date: Apr 2011
Location: NYC
Device: Many
I'm doing a quick writeup of this plugin for epubsecrets.com, and have a couple of questions. Is this the right place to ask them?
noteon is offline   Reply With Quote
Old 04-27-2018, 05:50 PM   #9
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,160
Karma: 5450818
Join Date: Nov 2009
Device: many
Yes, this is the right place to ask questions about this plugin. There is some explanation of exactly what this plugin does in the first post of this thread.
KevinH is offline   Reply With Quote
Old 04-30-2018, 09:05 PM   #10
noteon
Connoisseur
noteon is on a distinguished road
 
Posts: 55
Karma: 54
Join Date: Apr 2011
Location: NYC
Device: Many
Thanks! A few things I'm unclear on:

1. The readme says to make sure you have "properly added the appropriate semantic tags to mark your ebook files appropriately." Then in the list of things the plugin does, #5 says it will "add in appropriate epub:type semantic tags," and #6 says it will "map epub:type attributes to their appropriate aria role attribute."

What semantic tags should the author have added? Are they something besides the epub:type semantic tags specified in #5? My best guess is the author must manually code epub:type semantic tags before running the plugin, and that only #6 is actually performed by the plugin, not #5. Is this correct?

2. In #2, the plugin "fills in any missing title tag that is a child of the head tag." Is this the text it collects when "The ncx or nav is then parsed to collect titles for every xhtml file?" I was not able to get this to work; is there a precondition of some sort in the xhtml file?

I think that's it, at least for the moment. It's a useful plugin, and I'd like to make sure I represent it accurately in the article.
noteon is offline   Reply With Quote
Old 05-01-2018, 04:31 PM   #11
doubleshuffle
Unicycle Daredevil
doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.
 
doubleshuffle's Avatar
 
Posts: 13,940
Karma: 185392166
Join Date: Jan 2011
Location: Planet of the Pudding Brains
Device: Aura HD (R.I.P. After six years the USB socket died.) tolino shine 3
Thanks for this great plugin! I've just run it for the first time on a book I'm planning to upload to the MR library, and everything went smoothly.

The one thing I don't understand is how to add the description to svg images. I've read the explanation in the first post:

Quote:
Originally Posted by KevinH View Post
2. svg image tags images are ignored as the "alt" attribute is not allowed on those tags. The proper way to handle svg: image tags is to provide the proper title and desc elements immediately after the svg start tag that contains the image element.
But I don't understand which proper title and desc elements and where exactly to insert them. I'm providing the code for my cover image:

Spoiler:
Code:
<div style="text-align: center; padding: 0pt; margin: 0pt;">
    <svg viewBox="0 0 1101 1440" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" height="100%" width="100%" preserveAspectRatio="xMidYMid meet"><image height="1440" width="1101" xlink:href="../Images/blind-cover2.jpg"/></svg>
  </div>

Could someone please put "This is the image description" in the appropriate place(s) for me please?
doubleshuffle is offline   Reply With Quote
Old 05-01-2018, 09:10 PM   #12
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,160
Karma: 5450818
Join Date: Nov 2009
Device: many
Here is an example of using title and desc to help improve accessibility in svg as found on the web.

Code:
<svg version="1.1" width="300" height="200">
<title>Green rectangle</title>
<desc>A light green rectangle with rounded corners and a dark green border</desc>
<rect width="75" height="50" rx="20" ry="20" fill="#90ee90" stroke="#228b22" stroke-fill="1" />
</svg>
In your case you would add the title tag immediately after the opening svg tag (just before the start of the image tag), followed by the desc tag and then the image tag.
KevinH is offline   Reply With Quote
Old 05-01-2018, 09:22 PM   #13
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,160
Karma: 5450818
Join Date: Nov 2009
Device: many
Quote:
Originally Posted by noteon View Post
Thanks! A few things I'm unclear on:

1. The readme says to make sure you have "properly added the appropriate semantic tags to mark your ebook files appropriately." Then in the list of things the plugin does, #5 says it will "add in appropriate epub:type semantic tags," and #6 says it will "map epub:type attributes to their appropriate aria role attribute."
For number 5, Yes, the nav has a landmarks section. These user supplied landmarks semantic tags (epub:type) will be added to the proper body tag or id for each chapter if possible by the plugin

But, the user can and should use the epub3 semantics tool and manually add epub:type attributes to various tags in each part of the book. They should do this before runnng the plugin. The plugin itself will convert the epub:type to an aria role and add that in as well.

Quote:

2. In #2, the plugin "fills in any missing title tag that is a child of the head tag." Is this the text it collects when "The ncx or nav is then parsed to collect titles for every xhtml file?" I was not able to get this to work; is there a precondition of some sort in the xhtml file?
It will not replace existing title tag contents in head. So make sure you have the latest version of the plugin and that the current title tags are truly empty (no whitespace). The titles for each file are taken from the nav.
KevinH is offline   Reply With Quote
Old 05-02-2018, 02:02 AM   #14
doubleshuffle
Unicycle Daredevil
doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.
 
doubleshuffle's Avatar
 
Posts: 13,940
Karma: 185392166
Join Date: Jan 2011
Location: Planet of the Pudding Brains
Device: Aura HD (R.I.P. After six years the USB socket died.) tolino shine 3
Quote:
Originally Posted by KevinH View Post
Here is an example of using title and desc to help improve accessibility in svg as found on the web.

Code:
<svg version="1.1" width="300" height="200">
<title>Green rectangle</title>
<desc>A light green rectangle with rounded corners and a dark green border</desc>
<rect width="75" height="50" rx="20" ry="20" fill="#90ee90" stroke="#228b22" stroke-fill="1" />
</svg>
In your case you would add the title tag immediately after the opening svg tag (just before the start of the image tag), followed by the desc tag and then the image tag.
Great. Thanks.
doubleshuffle is offline   Reply With Quote
Old 05-03-2018, 09:29 AM   #15
noteon
Connoisseur
noteon is on a distinguished road
 
Posts: 55
Karma: 54
Join Date: Apr 2011
Location: NYC
Device: Many
Quote:
Originally Posted by KevinH View Post
For number 5, Yes, the nav has a landmarks section. These user supplied landmarks semantic tags (epub:type) will be added to the proper body tag or id for each chapter if possible by the plugin

But, the user can and should use the epub3 semantics tool and manually add epub:type attributes to various tags in each part of the book. They should do this before runnng the plugin. The plugin itself will convert the epub:type to an aria role and add that in as well.



It will not replace existing title tag contents in head. So make sure you have the latest version of the plugin and that the current title tags are truly empty (no whitespace). The titles for each file are taken from the nav.
Got it, thank you.
noteon is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Plugin] ACE - DAISY EPUB Accessibility Checker wrapper Doitsu Plugins 37 07-15-2024 12:38 PM
Easier access to plugin prefs slowsmile Plugins 14 10-22-2017 02:42 PM
Help me improve my EPUB converter epubler Workshop 2 07-20-2011 10:15 PM
Epub Revision - accessibility support Nate the great ePub 1 02-23-2011 04:47 AM
Kindle 2 Accessibility Access Mode suggestions scotty1024 Amazon Kindle 4 02-28-2009 07:06 PM


All times are GMT -4. The time now is 02:09 AM.


MobileRead.com is a privately owned, operated and funded community.