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

docs(mkdocs): enable instant loading of mathjax equations #3846

Merged
merged 5 commits into from
May 27, 2023

Conversation

soblin
Copy link
Contributor

@soblin soblin commented May 26, 2023

Description

I fixed the rendering error mathjax equations of the autoware.universe documentation. (like this page: https://autowarefoundation.github.io/autoware.universe/main/planning/obstacle_avoidance_planner/docs/eb/)

It looks like the page should be reloaded on some environments (like mobile Firefox, google chrome desktop).

Currently, autoware-documentation and autoware.universe documentation do not seem to support instant loading of math equations.
related: squidfunk/mkdocs-material#2530

How to reproduce

When you open the home page of obstacle_avoidance_planner and then go to the details of getEBTrajectory part by clicking the link on here, you are likely to see the math equations not rendered first. Then you need to reload the page to get the equations rendered.

After this PR

You do not need to reload the detail page to get the equations rendered.

Tests performed

Not applicable.

Effects on system behavior

Not applicable.

Pre-review checklist for the PR author

The PR author must check the checkboxes below when creating the PR.

In-review checklist for the PR reviewers

The PR reviewers must check the checkboxes below before approval.

Post-review checklist for the PR author

The PR author must check the checkboxes below before merging.

  • There are no open discussions or they are tracked via tickets.

After all checkboxes are checked, anyone who has write access can merge the PR.

Signed-off-by: Mamoru Sobue <mamoru.sobue@tier4.jp>
@soblin soblin requested a review from kenji-miyake May 26, 2023 15:26
@github-actions github-actions bot added the type:ci Continuous Integration (CI) processes and testing. (auto-assigned) label May 26, 2023
@soblin soblin removed the request for review from kenji-miyake May 26, 2023 15:32
@soblin
Copy link
Contributor Author

soblin commented May 26, 2023

It looks like regardless of this PR the documentation page should be reloaded to render math equations. I'll close this.

@soblin soblin closed this May 26, 2023
soblin added 2 commits May 27, 2023 00:52
Signed-off-by: Mamoru Sobue <mamoru.sobue@tier4.jp>
Signed-off-by: Mamoru Sobue <mamoru.sobue@tier4.jp>
@soblin soblin reopened this May 26, 2023
@github-actions github-actions bot added the type:documentation Creating or refining documentation. (auto-assigned) label May 26, 2023
@soblin soblin changed the title fix(docs): fixed rendering error mathjax feat(mkdocs): enable instant loading of mathjax equations May 26, 2023
@soblin soblin added the run:deploy-docs Mark for deploy-docs action generation. (used-by-ci) label May 26, 2023
@github-actions
Copy link

Documentation URL: https://autowarefoundation.github.io/autoware.universe/pr-3846/
Modified URLs:

@soblin soblin requested a review from kenji-miyake May 26, 2023 16:57
Copy link
Contributor

Choose a reason for hiding this comment

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

Sync this file is synced with autoware-documentation, could you edit either of the following?

- source: mkdocs.yaml
pre-commands: |
sd "Autoware Documentation" "Autoware Universe Documentation" {source}
sd "autoware-documentation" "autoware.universe" {source}
sd "repo_url: .*" "repo_url: https://github.com/autowarefoundation/autoware.universe" {source}
sd "/edit/main/docs/" "/edit/main/" {source}
sd "docs_dir: .*" "docs_dir: ." {source}
sd "assets/(\w+)" "docs/assets/\$1" {source}

https://github.com/autowarefoundation/autoware-documentation/blob/445a776ca7207e305371daf43376b7704ba9073d/mkdocs.yaml

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So should I create a PR to autoware-documentation as well that apply the same change to mkdocs.yaml ?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's better.
If you want to apply this change only to autoware.universe, please update sync-files.yaml instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice, I was just making an another PR to autoware-documentation because same behavior is happening there too ! And that should be fixed with the same change as this PR.
autowarefoundation/autoware-documentation#380

Copy link
Contributor

Choose a reason for hiding this comment

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

Great. I'll take a look.

@kenji-miyake kenji-miyake changed the title feat(mkdocs): enable instant loading of mathjax equations docs(mkdocs): enable instant loading of mathjax equations May 26, 2023
Copy link
Contributor

Choose a reason for hiding this comment

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

Also, could you specify which page/part of the documentation has an error?

Copy link
Contributor Author

@soblin soblin May 26, 2023

Choose a reason for hiding this comment

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

@kenji-miyake Very weirdly, in some cases math equations are not rendered across all the documentation. For example when you opened the obstacle avoidance planner documentation, and then go to the link attached with "here" in the last sentence:

More details about elastic band can be seen here

On my google chrome desktop and firefox on iPhone the math equations are not rendered at first, and I need to reload the page to see them. On firefox desktop, the equations are rendered from the beginning.
I think this should be fixed for developers who are interested in the implementation of autoware.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see, I was able to reproduce the behavior.
image

Copy link
Contributor

Choose a reason for hiding this comment

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

[optional] Could you add sync settings for this file just in case?

Related: https://github.com/autowarefoundation/autoware.universe/pull/3846/files#r1207080761

Signed-off-by: Mamoru Sobue <mamoru.sobue@tier4.jp>
@kenji-miyake kenji-miyake merged commit 96aa6b8 into autowarefoundation:main May 27, 2023
@soblin soblin deleted the fix/mathjax branch May 27, 2023 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
run:deploy-docs Mark for deploy-docs action generation. (used-by-ci) type:ci Continuous Integration (CI) processes and testing. (auto-assigned) type:documentation Creating or refining documentation. (auto-assigned)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants