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

Skip inclusion of JavaScript when the output format is not raw #132

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tsibley
Copy link

@tsibley tsibley commented Nov 9, 2023

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.

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>
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

1 participant