-
Notifications
You must be signed in to change notification settings - Fork 661
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accessibility for the Jupyter Book interface #436
Comments
When you get more into this, if you want any advice: Shoot me an email and I'm happy to provide support, and am on campus so I'm happy to meetup! I've done a lot of work in the past and am happy to help here, though I may not yet have time to write code. |
hey @cycomachead - I'd love to grab a coffee and chat about this soon if you'd be willing. There are a number of a11y efforts in the Jupyter community now and perhaps you'd be interested to hear about them? |
I had a more specific question about this: is there a recommended method to specify alt text? I'm thinking specifically of inline-rendered notebook figures and embedded html5 animations, but I would expect this problem to pop up with any kind of media object. I didn't see anything in the documentation about it, and nothing's immediately obvious from the ipython side of the docs as well. (Tacking on here since it seems like an appropriate existing issue, but I'm happy to relocate to a new issue if that would be better.) |
If you're using markdown then this should work: ![image-alt-text](image.url) |
@bmcfee - I feel like this is an issue that each library would need to figure out for themselves when it comes to outputting an HTML bundle. For example, best-practice would be to include an alt-tag for any images that are being output in a notebook. Jupyter Book is just going to directly convert those outputs into the HTML that's seen on each page. For example, I just opened up an issue to discuss this in Matplotlib (matplotlib/matplotlib#15971), I imagine it'd be a similar fix in other packages. |
Circling back on this, @choldgraf I think you're right that it probably belongs in each plotting library, but it seems unlikely to be implemented any time soon. It'd be nice to have an override option for users that really need this, even if it's less than elegant. Nbconvert does seem to support cell output image alt tags (in a limited form) via cell tags: jupyter/nbconvert#1112 but threading that through sphinx seems like a bit of a challenge. (I tried this locally with a book build and it didn't work.) |
I think the way that it'd be best to handle alt-tags in matplotlib images right now would be to use |
Interesting suggestion! I don't see how to put alt-text in a glued figure though? |
If it's not possible, then we should add it - here's where we're adding in the sphinx figure node: https://github.com/executablebooks/MyST-NB/blob/master/myst_nb/nb_glue/domain.py#L196 I think there we should figure out a way to add an alt text since it is possible in the rst figure directive that said, can you try just adding |
No dice: /home/bmcfee/git/dstbook/content/ch05/Cosine.ipynb:70002: WARNING: Directive 'glue:figure': Unknown option: alt |
bummer! OK then wanna open an issue in MyST-NB about adding an |
awesome! and just a note that if you get this working, you could even have the code and the "glued" figure on the same page. Just add a |
I noticed that nbconvert now has support to add alt text via cell metadata. However, somewhere in the jupyter book build process these are clobbered with the path to the image. Is there anyway to prevent this? Thanks! |
Well thats quite possibly because jupyter book does not use nbconvert 😆 |
@chrisjsewell Ah, missed that😄. Probably the main ones would be |
Most of the accessibility changes in Jupyter Book would probably need to be in the HTML templates for the sphinx-book-theme here: https://github.com/executablebooks/sphinx-book-theme/tree/master/sphinx_book_theme Another possibility is to add accessibility metadata when myst-nb converts notebook outputs etc into docutils nodes. Maybe somewhere around here: https://github.com/executablebooks/MyST-NB/blob/master/myst_nb/converter.py |
I'm gonna close this one as it's not super actionable and has a lot of different stuff in here. We should definitely address any a11y issues but it'll be easier to do so with specific issues. If there's specific stuff that we've missed here let's open up new issues for it. |
We should ensure that Jupyter Book is as accessible as possible out-of-the-box. My guess is that right now, it is not, and this is supported by this accessibility audit:
http://wave.webaim.org/report#/https://jupyterbook.org/intro
It would be fantastic to improve upon some of the easier things from the audit above, so that most accessibility issues are dealt with early on.
The text was updated successfully, but these errors were encountered: