-
Notifications
You must be signed in to change notification settings - Fork 339
Fix redundant logo alt #1459
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
Closed
Closed
Fix redundant logo alt #1459
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logical possibilities here are:
project
+version
+ "documentation" variables fromconf.py
are printed as text.html_title
inconf.py
. This is displayed as text instead ofproject
.html_theme_options["logo"] = dict(text="foo")
. Works basically the same as (2).html_logo
inconf.py
(or specifieshtml_theme_options["logo"] = dict(image_light="path/to/foo", image_dark="path/to/bar")
. Only image, no text.html_theme_options["logo"] = dict(text="foo")
).I'm inferring that options 1,2,3 clearly don't need alt text (no images), option 4 does, and option 5 does not? Is that right @gabalafou? To me it would make sense to include alt text in option 5 as well, since we don't necessarily know what additional text the user is providing. For example if they show a logo and the additional text says "the best package for MRI analysis", I think it would still be good for the logo alt text to say "name_of_package - Home" or something. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it didn't feel quite right to me to give the user the ability to specify both fields but only use one. In other words, it seems wrong to me make the combo of (alt_text provided, text provided) equivalent to (alt_text not provided, text provided). I could almost hear the frustrated user in my head: no but really, trust me, I know what I'm doing, I want to use both alt text and regular text (as in your example of "the best package for MRI analysis").
My approach here is probably too heavy handed.
A lighter approach would be to check if the text and alt text are partial matches of each other and if so, warn the user that what they're doing is probably bad for accessibility, but not go so far as to prevent them from doing it.
I'm just not sure how to get the warning across in a way that's efficacious. I feel like a lot of people using a third-party dependency ignore the warnings from the dependency unless something looks broken to them in the end result. And that's the problem here: to an abled user it won't look broken, but to a subset of disabled readers, it will sound broken, and not making that bug more apparent to abled users feels to me like a small injustice.
I thought about adding a flag to the logo dictionary that a user could set to mean: no really, I know what I'm doing, use both fields. If they don't include that flag, then the logo
text
nullifiesalt_text
(just like in this PR). But adding such a flag also feels like config creep to me.I feel like there must be a more elegant solution, but it eludes me at the moment.
On a related note, this logic is complicated enough that I think I need to add a test to this PR eventually, but without some help, given my lack of Python experience, I think it's going to take a lot of time for me. Would someone be willing to pair program with me for an hour to help me add tests for the logo component?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the approach of checking for alt-text and extra-text being matched, and warning if they are, is a good one.
What the user does with our warnings is outside of our control. IMO it is our responsibility to raise awareness that duplicating the extra text in the alt-text is anti-adaptive, but we're not responsible for whether users heed or ignore our advice. I'd vote to raise a warning and also add advice to the docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normally I'd volunteer but I'm super swamped --- teaching workshop thursday, running week-long training next week, then traveling+working the week after. Any other volunteers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think all of that is fair. This also isn't a critical accessibility issue, so there's no real urgency around it.
In the meantime, I will submit two separate PRs to speed along more simple fixes, one for the test suite, one for the docs.