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

Add AssistiveMML support to v3 #410

Merged
merged 6 commits into from Jan 25, 2020
Merged

Add AssistiveMML support to v3 #410

merged 6 commits into from Jan 25, 2020

Conversation

dpvc
Copy link
Member

@dpvc dpvc commented Dec 18, 2019

This PR implements an assistive-mml extension that corresponds to the version 2 AssistiveMML extension. It is implemented as an a11y extension similar to how semantic-enrich and the other ones operate (via extensions to the MathDocument and MathItem classes to add methods for creating the hidden MathML). Because the extension needed to be able to generate CSS styles to hide the MathML, this required extending the HTMLDocument class to allow extensions to add CSS to the document.

This also adds a menu item to to the accessibility menu to control whether assistive MathML is inserted into the page or not (default is yes), so that those who don't need it will be able to turn it off for faster rendering.

It would probably be a good idea to move the output/common/CssStyles.ts file to utilities at some point, but I didn't do that here since it touches a number of files.

Resolves issue mathjax/MathJax#2260

@dpvc dpvc requested a review from zorkow December 18, 2019 20:32
Copy link
Member

@zorkow zorkow left a comment

Choose a reason for hiding this comment

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

Some typos. One crucial.
Also I can't webpack a11y/assistive-mml. I investigated, but it is nothing obvious (e.g., capitalisation).

components/src/tex-chtml-full/preload.js Outdated Show resolved Hide resolved
ts/a11y/assistive-mml.ts Outdated Show resolved Hide resolved
ts/a11y/assistive-mml.ts Outdated Show resolved Hide resolved
ts/a11y/assistive-mml.ts Outdated Show resolved Hide resolved
@zorkow
Copy link
Member

zorkow commented Jan 24, 2020

OK, the webpack was probably my fault for not explicitly typescripting before building.
Nevertheless, the typo in preload.js should be fixed. That has no influence on the build.
But what's even more odd is that it does not seem to have any influence on the behaviour.

@dpvc
Copy link
Member Author

dpvc commented Jan 24, 2020

the typo in preload.js should be fixed.

Indeed.

But what's even more odd is that it does not seem to have any influence on the behaviour.

That string is used to tell MathJax that a11y/assisitve-mml was preloaded (even though there is no such thing). That is only to prevent MathJax from trying to load it dynamically. So because of the misspelling, MathJax would simply reload the (correctly spelled) a11y/assistive-mml when it is requested, so there is no harm to the functionality, but an extra file would be loaded that didn't need to be.

@dpvc
Copy link
Member Author

dpvc commented Jan 24, 2020

OK, I've made the update.

@dpvc dpvc requested a review from zorkow January 24, 2020 22:27
Copy link
Member

@zorkow zorkow left a comment

Choose a reason for hiding this comment

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

lgtm.

@dpvc dpvc merged commit 1e00675 into develop Jan 25, 2020
@dpvc dpvc deleted the assistive-mml branch January 25, 2020 00:46
@dpvc dpvc added this to the 3.0.1 milestone Mar 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants