Skip to content
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

Show a warning if an image has no alternative text #2024

Merged
merged 4 commits into from Jul 19, 2023

Conversation

brichet
Copy link
Contributor

@brichet brichet commented Jul 19, 2023

This PR changes the default alternative text for images, when exporting to HTML, and it also adds a warning in logs.

It also adds test on the warning, and some tests for the language code (which were missing).

EDIT: follows #2021

@blink1073 blink1073 added the bug label Jul 19, 2023
Copy link
Member

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@blink1073 blink1073 merged commit 1cbb0a4 into jupyter:main Jul 19, 2023
22 of 24 checks passed
@brichet brichet deleted the warning_alt_missing branch July 19, 2023 14:10
@0x26res
Copy link

0x26res commented Aug 1, 2023

@brichet I've recently updated nbconvert and I started getting warnings.

[NbConvertApp] WARNING | Alternative text is missing on 2 image(s).

So, it makes sense to have these warnings, but I'm not entirely sure how to fix them.

For context I use simple plots from pandas, using `df.plot(title='foo').

From what I can see in pandas's doc and matplotlib's I don't think there's a way to provide an alternative text.

I found an example that overwrite the alternative text, but it's a lot of work: https://gist.github.com/tonyfast/d01a0248979b21c9484d0827e04c0e68

I'm wondering if nbconvert could provide an option to disable that warning?

@brichet
Copy link
Contributor Author

brichet commented Sep 13, 2023

@0x26res would you mind opening a separated issue for it.
It should probably be discussed as the issue mainly come from matplotlib and pandas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants