scragg0x / realms-wiki

Git based wiki inspired by Gollum
http://realms.io
GNU General Public License v2.0
833 stars 90 forks source link

How use display math formula? #124

Open hlyang1992 opened 8 years ago

hlyang1992 commented 8 years ago

How to display math formula? For example, use mathjax?

vmarkovtsev commented 7 years ago

+1 This is the main problem with built-in GitHub wiki and why I have to search for something else.

gazpachoking commented 7 years ago

We switched to markdown-it markdown renderer, which has plugin support. Currently there isn't a way to customize the installed plugins, but if you do a git install it shouldn't be to hard to edit the source to have it use the plugin.

Here's a plugin I found: https://github.com/classeur/markdown-it-mathjax

And here you can see how markdown-it-anchor plugin is used: https://github.com/scragg0x/realms-wiki/blob/08221dd143a06f52c83bb8ef7d5869cd1ce94ca6/realms/__init__.py#L234 https://github.com/scragg0x/realms-wiki/blob/master/realms/static/js/mdr.js#L55

I think adding some way to specify markdown-it plugins from the config would be a nice solution, not sure the best way to do that though.