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

Use EmbedLiveSample for all MathML examples #20506

Merged
merged 1 commit into from
Sep 27, 2022
Merged

Conversation

fred-wang
Copy link
Contributor

Description

  • Add live sample to show the result in the browser, replacing "rendering in your browser" for some examples.
  • Remove "sample rendering" for some examples, the only exception being <mfenced> which is not intended to be supported by browsers in the future, so it's still useful show how it was supposed to render.
  • Use display="block" for MathML examples, so they show up more "beautifully" (centered in their own line with optimization on readability).
  • Add a hidden link to math web font for some of them, to ensure that stretchy characters can display correctly.
  • Adjust indentation and spacing.
  • Other minimal tweaks of the examples (adding background to spacing elements, add click instruction to maction, split token element examples into multiple lines, fix one quote in ms example, ...)

Motivation

  • Makes examples a bit clearer and consistent.
  • All browsers are going to have MathML in the short future (or can already be enabled by a flag), using EmbedLiveSample is more convenient for maintenance of the wiki pages.

Additional details

N/A

Related issues and pull requests

N/A

@fred-wang fred-wang requested a review from a team as a code owner September 10, 2022 06:41
@fred-wang fred-wang requested review from bsmth and removed request for a team September 10, 2022 06:41
@fred-wang
Copy link
Contributor Author

cc @Elchi3

@github-actions github-actions bot added the Content:MathML MathML docs label Sep 10, 2022
@bsmth bsmth requested a review from Rumyra September 12, 2022 13:50
@Elchi3
Copy link
Member

Elchi3 commented Sep 12, 2022

cc @Elchi3

Looks good to me. I'm unsure about loading the CSS with the fonts. Is that something that you guarantee to work going forward?
An issue about assets in mdn/content is here, but it is not resolved yet: mdn/yari#5727

@fred-wang
Copy link
Contributor Author

@Elchi3 OK, this was also done in #19467 FWIW. If we don't use those web fonts, some math content may not render well in browsers, which may make some examples confusing. Alternatively, we can remove that and add a warning box, pointing to https://developer.mozilla.org/en-US/docs/Web/MathML/Fonts.

Done:

- Add live sample to show the result in the browser, replacing "rendering in your browser" for some examples.
- Remove "sample rendering" for some examples, the only exception being `<mfenced>` which is not intended to be supported by browsers in the future, so it's still useful show how it was supposed to render.
- Use display="block" for MathML examples, so they show up more "beautifully" (centered in their own line with optimization on readability).
- Add a hidden link to math web font for some of them, to ensure that stretchy characters can display correctly.
- Adjust indentation and spacing.
- Other minimal tweaks of the examples (adding background to spacing elements, add click instruction to maction, split token element examples into multiple lines, fix one quote in ms example, ...)

Rationale:

- Makes examples a bit clearer and consistent.
- All browsers are going to have MathML in the short future (or can already be enabled by a flag), using EmbedLiveSample is more convenient for maintenance of the wiki pages.
Copy link
Member

@Elchi3 Elchi3 left a comment

Choose a reason for hiding this comment

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

I think the font loading is great. I just wasn't sure about how to load it (whether it is okay to load from an external [your] GitHub repo). However, as this has been approved before, I won't block it :)

@Elchi3 Elchi3 merged commit 95be180 into mdn:main Sep 27, 2022
@fred-wang fred-wang deleted the mathml-examples branch September 27, 2022 07:11
himanshugarg pushed a commit to himanshugarg/content that referenced this pull request Sep 27, 2022
Done:

- Add live sample to show the result in the browser, replacing "rendering in your browser" for some examples.
- Remove "sample rendering" for some examples, the only exception being `<mfenced>` which is not intended to be supported by browsers in the future, so it's still useful show how it was supposed to render.
- Use display="block" for MathML examples, so they show up more "beautifully" (centered in their own line with optimization on readability).
- Add a hidden link to math web font for some of them, to ensure that stretchy characters can display correctly.
- Adjust indentation and spacing.
- Other minimal tweaks of the examples (adding background to spacing elements, add click instruction to maction, split token element examples into multiple lines, fix one quote in ms example, ...)

Rationale:

- Makes examples a bit clearer and consistent.
- All browsers are going to have MathML in the short future (or can already be enabled by a flag), using EmbedLiveSample is more convenient for maintenance of the wiki pages.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:MathML MathML docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants