MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   Plugins (https://www.mobileread.com/forums/forumdisplay.php?f=268)
-   -   [Plugin] ACE - DAISY EPUB Accessibility Checker wrapper (https://www.mobileread.com/forums/showthread.php?t=294678)

Doitsu 02-09-2018 04:39 PM

[Plugin] ACE - DAISY EPUB Accessibility Checker wrapper
 
1 Attachment(s)
Updated: October 4, 2019
Current Version: "0.2.2"

This plugin is a simple DAISY ACE (=Accessibility Checker for EPUB) wrapper.

Credits: This plugin uses an epubcfi module originally written by Kovid Goyal, which was adapted for Sigil by KevinH.

System requirements:

This plugin requires Sigil 0.9.5 or higher. Obviously, you'll also need to install DAISY ACE. (Theoretically, the plugin should work on Macs, too, however, I couldn't get it to work on a Mac.)

Installation:

1. Visit the Inclusive Publishing website and follow the ACE installation instructions.

2. Select Manage Plugins from the Plugins menu and select Use Bundled Python, if it isn't already selected.

3. Click Add Plugin and select ACE_v0.2.2.zip. This will install the plugin, which you can select via Plugins > Validation > ACE.

If ACE doesn't crash, it'll display all messages in the validation panel and in the default browser.
If you don't want the plugin to display the results in a web browser change the following value in the ACE.json preferences file to false.

Code:

{
  "html_output": false
}

BTW, KevinH has created an accessibility plugin that'll automatically add recommended attributes to epub files. You can download it here.

Known Issues:

Since the developers apparently haven't implemented the July 2019 recommendations of the EPUB Type to ARIA Role Authoring Guide, ACE 1.1.1 might erroneously flag some tags that can't have ARIA roles attributes.

License: GNU General Public License v3 (GPL-3)

elibrarian 02-12-2018 09:46 AM

Quote:

Originally Posted by Doitsu (Post 3654635)
Released: February 9, 2018
Current Version: "0.1.0"
Known Issues:

ACE often crashes before generating the report files. Hopefully these crashes will be fixed in future versions.

Just to let you know: I've been using ACE since v. 0.6, and haven't seen a crash yet, neither when I use it by dumping the epub on a batchfile nor by using your plugin (Windows 10 Pro 64 bit).

And thanks for the plugin, it spares my old fingers some clicks :thumbsup:

Regards,

Kim

KevinH 02-23-2018 12:53 PM

Hi Doitsu,

I have modifed Kovid's Calibre cfi parsing code to run purely on Python 3 and to return stepnums in a manner that make sense to me (with -1 step indicators to indicate redirection) . With this new cfiparse.py code I should be able write an edit plugin that uses the bk to quickly convert the cfi to find the name of the problem file. I will then write some new code to walk the gumbo tree dom and return a line number and hopefully a correct character offset.

With this information, you should be able to create a validation plugin that will work fully inside Sigil.

Give me another week or so to put something together.

KevinH

Doitsu 02-23-2018 12:58 PM

Quote:

Originally Posted by KevinH (Post 3661403)
I have modifed Kovid's Calibre cfi parsing code to run purely on Python 3 [...] With this information, you should be able to create a validation plugin that will work fully inside Sigil.

:thanks:

I really appreciate your efforts and will update the plugin once you've released the code.

KevinH 02-26-2018 12:39 PM

See: https://www.mobileread.com/forums/sh...&postcount=358

Doitsu 02-26-2018 12:54 PM

Quote:

Originally Posted by KevinH (Post 3662547)

Thanks! I'll check it out.

Doitsu 02-28-2018 07:03 AM

Thanks to KevinH's help, I was able to convert the plugin from an edit plugin to a validation plugin.
I've attached a new version to the first post.

ways2read 05-18-2018 07:45 AM

Thanks for the great plug in. Able to install and run it without a hitch- good work!

ways2read 05-18-2018 11:29 AM

Quote:

Originally Posted by ways2read (Post 3694976)
Thanks for the great plug in. Able to install and run it without a hitch- good work!

I should clarify that this was on Windows

ways2read 05-18-2018 11:31 AM

Quote:

Originally Posted by Doitsu (Post 3663384)
Thanks to KevinH's help, I was able to convert the plugin from an edit plugin to a validation plugin.
I've attached a new version to the first post.

Ace is running fine from terminal on my Macbook.

The plugin fails though. When I look at details, I see:

"Status: failed
Running ACE ... please wait.
-V: ace command not found"

Doitsu 05-18-2018 12:12 PM

Quote:

Originally Posted by ways2read (Post 3695045)
The plugin fails though. When I look at details, I see:

"Status: failed
Running ACE ... please wait.
-V: ace command not found"

This is a known limitation that I mentioned in the first post:

Quote:

Originally Posted by Doitsu (Post 3654635)
(Theoretically, the plugin should work on Macs, too, however, I couldn't get it to work on a Mac.)

Unfortunately, I don't know how to fix this.

thiago.eec 11-04-2018 02:20 PM

Hi, Doitsu.

Thank you for this great plugin!

I've been using ACE BY DAISY for a while as a command line tool. It's really great to use it integrated with Sigil.

Now... I wish this Plugin would be available for Calibre Editor as well. =)
Can it be done?

Doitsu 11-04-2018 05:40 PM

Quote:

Originally Posted by thiago.eec (Post 3769623)
Now... I wish this Plugin would be available for Calibre Editor as well. =) Can it be done?

I don't intend to create a Calibre plugin version. You might want to ask about it in the Calibre Plugin Ideas thread.

thiago.eec 11-04-2018 05:58 PM

Quote:

Originally Posted by Doitsu (Post 3769711)
I don't intend to create a Calibre plugin version. You might want to ask about it in the Calibre Plugin Ideas thread.


:( ... Thanks, anyway. :thumbsup:

polizoto 06-06-2019 05:16 AM

Any Updates to a Fix for the Macbook?
 
Quote:

Originally Posted by Doitsu (Post 3695059)
This is a known limitation that I mentioned in the first post:



Unfortunately, I don't know how to fix this.


Has there been any progress on this issue? Thanks!

Joseph

Doitsu 06-06-2019 06:55 AM

Quote:

Originally Posted by polizoto (Post 3853400)
Has there been any progress on this issue? Thanks!

No. I still don't know how to fix this. However, you could try the Calibre version by thiago.eec.
If the Calibre version works on your Mac, I might be able to update the code for Macs.

cmcclaflinprcvi 09-10-2019 01:38 PM

Error: Using unsupported cfi feature
 
We've been using this plugin for quite a while now, and we're suddenly getting an error!

I cannot seem to track down why. We've tried using older / current versions of sigil, ace is installed at 1.1.1, we're running windows 10. It also seems to not be related to our epub, as we're able to open sigil and have a new file created, save it, run, and we still get the error. We've also verified the error occurs on several machines. Is anyone else getting this error now?

Status: failed

Running ACE ... please wait.

Traceback (most recent call last):
File "C:\Users\*redacted*\AppData\Local\sigil-ebook\sigil\plugins\ACE\plugin.py", line 155, in run
res = cfi_convert(bk, real_epubcfi)
File "C:\Users\*redacted*\AppData\Local\sigil-ebook\sigil\plugins\ACE\cficonvert.py", line 37, in cfi_convert
raise CFIConvertException("Error: Using unsupported cfi feature")
cficonvert.CFIConvertException: Error: Using unsupported cfi feature

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Program Files\Sigil\plugin_launchers\python\launcher.py", line 135, in launch
self.exitcode = target_script.run(container)
File "C:\Users\*redacted*\AppData\Local\sigil-ebook\sigil\plugins\ACE\plugin.py", line 159, in run
print(str(e))
NameError: name 'e' is not defined
Error: name 'e' is not defined

Doitsu 09-10-2019 02:18 PM

Quote:

Originally Posted by cmcclaflinprcvi (Post 3888348)
We've been using this plugin for quite a while now, and we're suddenly getting an error!

I was able to reproduce this error with ACE 1.1.1. Most likely the Daisy/ACE developers have changed the .json output format.

I'll investigate and try to update the plugin.

Doitsu 09-11-2019 09:07 AM

Quote:

Originally Posted by cmcclaflinprcvi (Post 3888348)
We've been using this plugin for quite a while now, and we're suddenly getting an error!

I've updated the plugin and attached a new version to the first post. Please note that the ACE developers apparently haven't implemented the July 2019 recommendations of the EPUB Type to ARIA Role Authoring Guide.

For example, ACE will flag the following tag:

Code:

<body epub:type="chapter" id="chapter001">
because there's an equivalent doc-chapter ARIA role, however, it can only be used on <section> tags.

cmcclaflinprcvi 09-12-2019 03:59 PM

All fixed up!
 
Thanks so much for your quick response, we've tested and this seems to have resolved the issue!

jennie2486 12-13-2020 03:13 AM

Hi,
I have been trying to use the ACE plugin with Sigil, and keep running into problems. I'm hoping someone can help me. I have used ACE with Calibre and have never had a problem. When trying to install in Sigil, I followed the instructions to use the command: $ npm install -g @daisy/ace.

I kept getting the message: '$' is not recognized as an internal or external command. Then I realized I installed the Calibre plugin without the $, so ran it without, and it installed no problem. Anybody know why ACE says to use $ yet I get '$' is not recognized as a command? (My apologies if this is dumb question, I am a beginner.��)

Next I attempted to run it through Sigil and received an error message: 'ace' is not recognized as an internal or external command, operable program or batch file.

I went back to the command window and tried to run some commands suggested. Had no problem when asking for help, and the version. (As long as I left out the $).

When I ran: ace ~C:/Books/Looking for Clara - Simona Grossi.epub

error: Couldn’t find EPUB file
info: Closing logs.
Re-run Ace using the --verbose option to enable full debug logging.

When I ran: ace --verbose I got: error: Input required

Ace by DAISY, an Accessibility Checker for EPUB

Usage: ace [options] <input>

Options:

-h, --help output usage information
-v, --version output the version number

-o, --outdir <path> save final reports to the specified directory
-t, --tempdir <path> specify a custom directory to store the temporary reports
-f, --force override any existing output file or directory
--subdir output reports to a sub-directory named after the input EPUB

-V, --verbose display verbose output
-s, --silent do not display any output

-l, --lang <language> language code for localized messages (e.g. "fr"), default is "en"
Examples
$ ace -o out ~/Documents/book.epub

I even tried several variations of the: ace ~/C:/Books/Looking for Clara - Simona Grossi.epub. I even copied the path from my file explorer and tried that: ~C:\Books\Looking for Clara - Simona Grossi.epub. I get the the same error every time.

Please, I am lost and don't know what to do. It's probably something basic that I did wrong, I am a beginner.

Doitsu 12-13-2020 03:45 AM

Quote:

Originally Posted by jennie2486 (Post 4068474)
Anybody know why ACE says to use $ yet I get '$' is not recognized as a command?

The ACE authors erroneously assumed that ACE will be primarily used by Linux and macOS users.
($ is the default Linux/macOS terminal command line prompt.)

Quote:

Originally Posted by jennie2486 (Post 4068474)
When I ran: ace ~C:/Books/Looking for Clara - Simona Grossi.epub [...]

If ACE was properly installed and Thiago's Calibre ACE plugin works, you shouldn't have to use the command line at all.

If you want to test whether ace works, you'll need to enclose path names in double quotation marks and omit the tilde.

Code:

ace "C:/Books/Looking for Clara - Simona Grossi.epub"
If you don't get any ACE error messages, the ACE plugin should work.
(You should see some messages with curly braces, but that's by design.)
If the plugin doesn't work, please copy and paste the complete plugin output.

Also please provide the following information:
1. Operating system
2. Sigil version

jennie2486 12-13-2020 10:23 PM

Hi,
I'm pleased to say, I have figured everything out. I now have ACE running successfully on both terminal and Sigil.

I've also figured out the "$" meant to run the code in the terminal, (not to run the $ as code). :smack: The rest of my problem had to do with the space in my epub's file location.

I am very happy to have the plugin working! Thanks for an awesome plugin. :thanks:

jennie2486 12-29-2020 02:15 AM

I wonder if anyone else has experienced the same issue as me. After running Access-Aide on an epub 2 and then running ACE, ACE consistently flags the same 4 errors:

Code:

content.opf Serious  Publications must declare the 'schema:accessMode' metadata
content.opf Moderate  Publications must declare the 'schema:accessModeSufficient' metadata
content.opf Serious  Publications must declare the 'schema:accessibilityFeature' metadata
content.opf Serious  Publications must declare the 'schema:accessibilitySummary’ metadata

Yet, I've run Access-Aide and made sure all 4 are there:

Code:

<meta content="This publication conforms to WCAG 2.0 AA." name="schema:accessibilitySummary"/>
<meta content="textual" name="schema:accessMode"/>
<meta content="textual" name="schema:accessModeSufficient"/>
<meta content="structuralNavigation" name="schema:accessibilityFeature"/>

However, if I use ACE on an epub 3, after running Access-Aide, I get no errors. I re-read the summaries on both Access-Aide and ACE, neither one said anything about not working for epub 2's.

Is this normal?

elibrarian 12-29-2020 04:39 AM

Quote:

Originally Posted by jennie2486 (Post 4074870)
I wonder if anyone else has experienced the same issue as me. After running Access-Aide on an epub 2 and then running ACE, ACE consistently flags the same 4 errors:

Code:

content.opf Serious  Publications must declare the 'schema:accessMode' metadata
content.opf Moderate  Publications must declare the 'schema:accessModeSufficient' metadata
content.opf Serious  Publications must declare the 'schema:accessibilityFeature' metadata
content.opf Serious  Publications must declare the 'schema:accessibilitySummary’ metadata

Yet, I've run Access-Aide and made sure all 4 are there:

Code:

<meta content="This publication conforms to WCAG 2.0 AA." name="schema:accessibilitySummary"/>
<meta content="textual" name="schema:accessMode"/>
<meta content="textual" name="schema:accessModeSufficient"/>
<meta content="structuralNavigation" name="schema:accessibilityFeature"/>

However, if I use ACE on an epub 3, after running Access-Aide, I get no errors. I re-read the summaries on both Access-Aide and ACE, neither one said anything about not working for epub 2's.

Is this normal?

Sort of, yes. The Epub Accessibility specs tells you it's made for both epub2 and epub3 - in the real world, if you wan't to make accessible epubs, forget about epub2 - it's the road to insanity.

Regards,

Kim

KevinH 12-29-2020 05:12 PM

In the daisy/ace epub-utils/epub-parser.js it only extracts epub3 style meta tags (those using the "property" attribute) and dc: tags, but has no code to extract a epub2 style meta tag with name and content attributes.

Thus you get that false error message. You can choose to ignore that false error but if you truly care about accessibility then opting for an epub3 is probably your best path forward.

That said a bug report against daisy-ace to support epub2 metadata meta tags in epub2 OPF couldn't hurt.

graycyn 09-14-2021 12:38 AM

First, thanks for the plugin!

I just today installed the Ace by Daisy app and the plugin. However, running my first ePUB through it came up with ONE single, solitary, but supposedly serious error, the gist of which is that I need to:

Add a 'schema:accessibilityHazard' metadata property to the Package Document

FWIW, the epub is fiction, primarily text, there are no flashing hazards or audio hazards or anything I can think of that could be hazardous about it! There are: a cover image (JPG), a title page image (PNG), a author photo (JPG) and one small vector image (SVG).

There is no audio, video, or any kind of script calling such, no links to external content, no embedded fonts, it's a very simple little epub of a 150 page novel.


I'm old and not so technical, could someone tell me how to add this to my epub with the Sigil metadata editor? Because if it's a problem on this epub, it's going to crop up in any other epub I make.

Or if it's not doable in the Sigil metadata editor, does anyone know what I should put in the .opf directly?

It sounds like I would need to declare a value of "none" for the 'schema:accessibilityHazard' metadata property.

EDIT: Can I just stick something like this in the .opf?

Code:

<meta property="schema:accessibilityHazard">none</meta>
I tried it and it seems to make ACE by Daisy happy. EPUBCheck didn't have anything against it either.

KevinH 09-14-2021 11:08 AM

Based on the Daisy docs shown here:

http://kb.daisy.org/publishing/docs/...ityHazard.html

that should be absolutely correct.

I am just not sure why it is even needed if there is no audio or video resources. Have you added the metadata that tells the user that this is a text only epub:

ie:

schema:accessMode
schema:accessModeSufficient

set to be "textual".

See:

http://kb.daisy.org/publishing/docs/...ccessMode.html

http://kb.daisy.org/publishing/docs/...ufficient.html

graycyn 09-14-2021 04:58 PM

Thanks, Kevin!

I had run my epub through Access-Aide plugin prior, this is what was already in the metadata when I ran it through the Ace by Daisy app:

Code:

    <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>

So I didn't have it *exactly* like the examples in your link, though I would've thought it would be good to go. So I tried changing to the version below, like your link:

Code:

  <meta property="schema:accessModeSufficient">textual,visual</meta>
I stripped the schema:accesibilityHazard line out, ran through Ace by Daisy again, NO DIFFERENCE! Same error. It wants that Hazard metadata!


There's NOTHING in the epub that wasn't put there by me, Sigil, Access-Aide or the Pagelist plugin. The only things I can remotely imagine triggering this are the non-transparent title page image (a shocker in night mode, but transparency creates black on black in most apps) and I do have a few Spanish words marked up with:

Code:

xml:lang="es"
I was so puzzled, last night I ran a very recently purchased epub (HarperCollins, Stargazer by Anne Hillerman) and Ace by Daisy did not flag it as having any serious violations (some 300+ minor ones, tho). I opened Stargazer up in Sigil, took a look and lo and behold, they have SEVERAL schema:accessibilityHazard statements, even though there doesn't appear to be anything more hazardous about their ebook than mine. Their title page image is also non-transparent, FWIW. No audio, video, fonts or miscellaneous in their book either. They had three images, all JPG.

Here's what they had:

Code:

    <meta property="schema:accessibilityHazard">noFlashingHazard</meta>
    <meta property="schema:accessibilityHazard">noSoundHazard</meta>
    <meta property="schema:accessibilityHazard">noMotionSimulationHazard</meta>

So the mystery remains. I just can't imagine why my little book would be flagged as needing this particular metadata. I can see no reason the HarperCollins book would require it either. But I guess I best have it in there.

Question, should I go with the value as none which appeared to satisfy ACE by Daisy, or copy what HC did?

I'm a hobbyist, I have no idea what all the accessibility requirements are, I'd just like to cover the bare-bones basics and have my book pass the check.

graycyn 09-14-2021 05:34 PM

I also found this page where they write it slightly differently:


Code:

  <meta property="schema:accessibilityHazard">noFlashing</meta>
    <meta property="schema:accessibilityHazard">noSound</meta>
    <meta property="schema:accessibilityHazard">noMotionSimulation</meta>

Though as far as I can tell, if there are no hazards, the simpler version of:

Code:

<meta property="schema:accessibilityHazard">none</meta>
is perhaps more correct.

From https://www.w3.org/wiki/WebSchemas/Accessibility it says:

Quote:

If none of the hazards are known to exist instead of calling out each nonHazard it is recommended to use "none".
So I guess I've more or less answered my own question! :D Maybe it'll help some other confused soul who has the itch to make ebooks.

KevinH 09-14-2021 10:48 PM

Perhaps this is a new check recently added to their Daisy ACE checker. I will update Access-Aide to add the schema:accessibilityHazard none just to be safe. It can not hurt.

graycyn 09-16-2021 12:44 AM

Quote:

Originally Posted by KevinH (Post 4154286)
Perhaps this is a new check recently added to their Daisy ACE checker. I will update Access-Aide to add the schema:accessibilityHazard none just to be safe. It can not hurt.

Sounds good to me!

And thanks for your help and appreciation for all the work you do!

KevinH 09-17-2021 12:30 PM

Happy to help. A new Access-Aide v054 is now available with this change.
Please do verify you are not using any animated GIFS in your epub since we set that value to none.

Quote:

Originally Posted by graycyn (Post 4154580)
Sounds good to me!

And thanks for your help and appreciation for all the work you do!


graycyn 09-19-2021 02:45 AM

Quote:

Originally Posted by KevinH (Post 4154907)
Happy to help. A new Access-Aide v054 is now available with this change.
Please do verify you are not using any animated GIFS in your epub since we set that value to none.

Definitely no animations of any sort! And I saw that you mention that on the first page, which is good, since everyone should probably be aware of checking for hazards.

Already downloaded and installed!


All times are GMT -4. The time now is 08:24 PM.

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.