markdown_it - texmath / dollarmath #202
-
Hi, I'm not sure this is the right place to ask, but I've been struggling to use the Example: >>> l = markdown_it.MarkdownIt().use(texmath.texmath_plugin)
>>> l.render("$x^1$")
'<p><eq>x^1</eq></p>\n' Now this gives me some html with this Thanks a bunch, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Heya, yes indeed you would need to use something like mathjax or katex to convert the "identified" math to rendered items. I have only focussed on creating these plugins to generate the math syntax tokens, so that they can be passed to sphinx to do the actual rendering (via mathjax), and so haven't looked much into "direct" rendering I'm afraid. As mentioned in the docs, We welcome PRs, but likely won't be working on this ourselves any time soon. |
Beta Was this translation helpful? Give feedback.
-
Ok thanks! |
Beta Was this translation helpful? Give feedback.
Heya, yes indeed you would need to use something like mathjax or katex to convert the "identified" math to rendered items.
I have only focussed on creating these plugins to generate the math syntax tokens, so that they can be passed to sphinx to do the actual rendering (via mathjax), and so haven't looked much into "direct" rendering I'm afraid.
As mentioned in the docs,
texmath
is directly derived from https://github.com/goessner/markdown-it-texmath, and you can see how that uses katex.Ideally you would want a "pure-python" alternative to
texmath.katex.renderToString(tex, options)
(e.g. a complete version of https://github.com/tabatkins/katex),or the math would need to be tagged in suc…