Open sbrl opened 9 years ago
it shouldn't be too hard to implement this as an extension - u could check the example at https://github.com/erusev/parsedown/wiki/Tutorial:-Create-Extensions#add-multi-line-element - it was created by the community and i haven't tested it but it looks fine
p.s. since this math syntax uses a "$" and it is a special characters that the parser is unfamiliar with, u'll also need sth like this in the constructor:
$this->BlockTypes['$'] []= 'MathExpression';
Right. Thanks! I'll take a look when I have some time.
I don't see the need to do it in php. If many people use your blog, it might create unnecessary strain to render the LaTeX math on the server.
Why not leave the equations alone and include something like this in the header of your blog:
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
processEscapes: true,
skipTags: ["script","noscript","style","textarea","pre","code"]
}
});
</script>
<script type="text/javascript" async src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"></script>
@con-f-use That looks awesome! I think I'll take a look at including that in Pepperminty Wiki and my blog now.
Oh and do you have any suggestions for a good LaTeX tutorial, @con-f-use?
I've found that the LaTeX Wikibook has just about all the information I need.
@con-f-use Looks good, thanks!
@con-f-use thanks, very helpful, but I think now shold use:
skipTags: ["<pre>","<code>"]
I do have this extension for Parsedown, there still need some work on the documentation but else it should work perfect. https://github.com/BenjaminHoegh/parsedown-extreme
@BenjaminHoegh WOW! nice work!
@BenjaminHoegh the extension looks great, you can list it at https://github.com/erusev/parsedown/wiki/Extensions-and-Related-Libraries
I use Parsedown-Extra for my blog, and I would love to be able to use math equations in my posts.
Using stackedit.io, I can include math equations like this:
They are then rendered using MathJax. There isn't a PHP version of this library I don't think, but simply having the inline MathML is enough as I can find and use a library to render the MathML in the user's browser.
I'm open to helping out wherever I can - I know some PHP, but I am not familiar with the parsedown codebase.