-
Notifications
You must be signed in to change notification settings - Fork 141
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
feat: add mhchem katex extension #678
base: master
Are you sure you want to change the base?
Conversation
mhchem package provides commands for typesetting chemical molecular formulae and equations
solara/components/markdown.py
Outdated
@@ -157,6 +158,11 @@ def _markdown_template( | |||
async loadMermaid() { | |||
return (await this.import([`${this.getCdn()}/mermaid@10.8.0/dist/mermaid.min.js`]))[0] | |||
}, | |||
async loadMHchem() { | |||
await this.loadKatex(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
await this.loadKatex(); | |
await this.loadKatex(); |
await this.loadKatex(); |
This will cause the CSS to be added twice,
solara/components/markdown.py
Outdated
@@ -92,6 +92,7 @@ def _markdown_template( | |||
await this.loadRequire(); | |||
this.mermaid = await this.loadMermaid(); | |||
this.mermaid.init(); | |||
await this.loadMHchem(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we need to move that to after line 110, if/when we use katex.
I've now added the loading of mhchem to the same |
86646f5
to
df2fd66
Compare
mhchem package provides commands for typesetting chemical molecular formulae and equations
mhchem katex extension docs are here
this contribution is a combination of copy-paste with suggestions from codeium
example:
output: