I’ve tried using jupyter-book and quarto to produce html/book output from a series of notebooks and was wondering how to add alt text for output cells with figures. nbconvert supports generating alt tags when
alt is in the cell metadata. Should other apps adopt the same approach? Does there need to be more formal guidelines around this?
I was thinking of filing issues with jupyter-book/sphinx and quarto to ask that they support the same, but I don’t know if this one method should be adopted by all.
I think it would be great if jupyter defined some conventions for how cells should define alt text for their outputs. Maybe @trallard or @isabela-pf have discussed this before and have ideas?
In my mind projects like jupyter book or quarto should follow the standards set by higher level projects like jupyter.
Hey there - we have indeed had some discussions about this.
IMHO - the best approach would be to have the alt-text within the cell metadata and would align nicely with what nbconvert does already in case anyone is using both (nbconvert + jupyter book).
Shall we move this to issues @ryan?
Yep I think this makes sense as well - to me there are two challenges to overcome:
- Agreeing on the “standard” that is useful / flexible enough for a few different usecases. But maybe this is just as simple as agreeing something like “it’s a field called
alttext and contains a single string, or a list of strings each corresponding to an output”.
- Improving the UI/UX story around editing cell metadata in JupyterLab. It needs to be as easy as “entering text (ideally markdown) into a text box”…it can’t involve hand-editing JSON in my opinion.
This was my PR! I’m happy to see more work is being done to improve support for
alt text. Thank you, I appreciate your efforts.