Skip inclusion of JavaScript when the output format is not raw#132
Open
tsibley wants to merge 1 commit intomgaitan:masterfrom
Open
Skip inclusion of JavaScript when the output format is not raw#132tsibley wants to merge 1 commit intomgaitan:masterfrom
tsibley wants to merge 1 commit intomgaitan:masterfrom
Conversation
Only raw output requires rendering by JS. This avoids loading and executing JS that's unnecessary. Diff best viewed with whitespace ignored due to an indentation change.
tsibley
added a commit
to nextstrain/cli
that referenced
this pull request
Nov 21, 2023
Mermaid.js¹ supports a number of useful diagrams types that are otherwise difficult to create programmatically. The addition now is motivated by wanting to add some sequence diagrams for new authn documentation. The Sphinx/Mermaid integration, sphinxcontrib-mermaid, defaults to client-side rendering at page load time, but this comes with some downsides and practically no upsides. Configure it to render at doc build time instead. Related to this change, I submitted two patches upstream to the Sphinx integration which I think improve the build-time render results: a patch to remove unnecessary JS from the page by default² and a patch to display the SVGs as images rather than embedded documents.³ ¹ <https://mermaid.js.org> ² <mgaitan/sphinxcontrib-mermaid#132> ³ <mgaitan/sphinxcontrib-mermaid#131>
tsibley
added a commit
to nextstrain/cli
that referenced
this pull request
Nov 21, 2023
Mermaid.js¹ supports a number of useful diagrams types that are otherwise difficult to create programmatically. The addition now is motivated by wanting to add some sequence diagrams for new authn documentation. The Sphinx/Mermaid integration, sphinxcontrib-mermaid, defaults to client-side rendering at page load time, but this comes with some downsides and practically no upsides. Configure it to render at doc build time instead. Related to this change, I submitted two patches upstream to the Sphinx integration which I think improve the build-time render results: a patch to remove unnecessary JS from the page by default² and a patch to display the SVGs as images rather than embedded documents.³ ¹ <https://mermaid.js.org> ² <mgaitan/sphinxcontrib-mermaid#132> ³ <mgaitan/sphinxcontrib-mermaid#131>
tsibley
added a commit
to nextstrain/cli
that referenced
this pull request
Nov 21, 2023
Mermaid.js¹ supports a number of useful diagrams types that are otherwise difficult to create programmatically. The addition now is motivated by wanting to add some sequence diagrams for new authn documentation. The Sphinx/Mermaid integration, sphinxcontrib-mermaid, defaults to client-side rendering at page load time, but this comes with some downsides and practically no upsides. Configure it to render at doc build time instead. Related to this change, I submitted two patches upstream to the Sphinx integration which I think improve the build-time render results: a patch to remove unnecessary JS from the page by default² and a patch to display the SVGs as images rather than embedded documents.³ ¹ <https://mermaid.js.org> ² <mgaitan/sphinxcontrib-mermaid#132> ³ <mgaitan/sphinxcontrib-mermaid#131>
tsibley
added a commit
to nextstrain/cli
that referenced
this pull request
Nov 22, 2023
Mermaid.js¹ supports a number of useful diagrams types that are otherwise difficult to create programmatically. The addition now is motivated by wanting to add some sequence diagrams for new authn documentation. The Sphinx/Mermaid integration, sphinxcontrib-mermaid, defaults to client-side rendering at page load time, but this comes with some downsides and practically no upsides. Configure it to render at doc build time instead. Related to this change, I submitted two patches upstream to the Sphinx integration which I think improve the build-time render results: a patch to remove unnecessary JS from the page by default² and a patch to display the SVGs as images rather than embedded documents.³ ¹ <https://mermaid.js.org> ² <mgaitan/sphinxcontrib-mermaid#132> ³ <mgaitan/sphinxcontrib-mermaid#131>
tsibley
added a commit
to nextstrain/cli
that referenced
this pull request
Nov 22, 2023
Mermaid.js¹ supports a number of useful diagrams types that are otherwise difficult to create programmatically. The addition now is motivated by wanting to add some sequence diagrams for new authn documentation. The Sphinx/Mermaid integration, sphinxcontrib-mermaid, defaults to client-side rendering at page load time, but this comes with some downsides and practically no upsides. Configure it to render at doc build time instead. Related to this change, I submitted two patches upstream to the Sphinx integration which I think improve the build-time render results: a patch to remove unnecessary JS from the page by default² and a patch to display the SVGs as images rather than embedded documents.³ ¹ <https://mermaid.js.org> ² <mgaitan/sphinxcontrib-mermaid#132> ³ <mgaitan/sphinxcontrib-mermaid#131>
tsibley
added a commit
to nextstrain/cli
that referenced
this pull request
Jan 13, 2024
Mermaid.js¹ supports a number of useful diagrams types that are otherwise difficult to create programmatically. The addition now is motivated by wanting to add some sequence diagrams for new authn documentation. The Sphinx/Mermaid integration, sphinxcontrib-mermaid, defaults to client-side rendering at page load time, but this comes with some downsides and practically no upsides. Configure it to render at doc build time instead. Related to this change, I submitted two patches upstream to the Sphinx integration which I think improve the build-time render results: a patch to remove unnecessary JS from the page by default² and a patch to display the SVGs as images rather than embedded documents.³ ¹ <https://mermaid.js.org> ² <mgaitan/sphinxcontrib-mermaid#132> ³ <mgaitan/sphinxcontrib-mermaid#131>
tsibley
added a commit
to nextstrain/cli
that referenced
this pull request
Jan 18, 2024
Mermaid.js¹ supports a number of useful diagrams types that are otherwise difficult to create programmatically. The addition now is motivated by wanting to add some sequence diagrams for new authn documentation. The Sphinx/Mermaid integration, sphinxcontrib-mermaid, defaults to client-side rendering at page load time, but this comes with some downsides and practically no upsides. Configure it to render at doc build time instead. Related to this change, I submitted two patches upstream to the Sphinx integration which I think improve the build-time render results: a patch to remove unnecessary JS from the page by default² and a patch to display the SVGs as images rather than embedded documents.³ ¹ <https://mermaid.js.org> ² <mgaitan/sphinxcontrib-mermaid#132> ³ <mgaitan/sphinxcontrib-mermaid#131>
grove825
approved these changes
Jan 24, 2025
gastmaier
approved these changes
Jul 17, 2025
Contributor
gastmaier
left a comment
There was a problem hiding this comment.
yep, it shouldn't inject js when not needed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Only raw output requires rendering by JS. This avoids loading and executing JS that's unnecessary.
Diff best viewed with whitespace ignored due to an indentation change.