scragg0x / realms-wiki

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

Switch from marked to markdown-it markdown renderer #167

Closed gazpachoking closed 7 years ago

gazpachoking commented 7 years ago

Had a few issues with the marked renderer, and decided to see how easy it would be to switch it out. markdown-it looks a bit more actively updated, flexible, and has nice extensions so I switched that in. I think it would also be nice if the renderer options/extensions could be specified from the realms config file, but I haven't tried anything like that yet.

It'd be lovely if someone tested this out on their wiki, I'm not sure how compatible it is with the current renderer. Also, I don't javascript very often, so I'm not sure I did that bit right either. Any comments are welcome.

TODO:

These issues may relate:

106

117

gazpachoking commented 7 years ago

Running this on our prod site now (http://flexget.com), a couple small tweaks were needed to our markdown, but we are liking this engine better.

gazpachoking commented 7 years ago

So, I want to add back in the anchors to the headings, and this looks like a markdown-it extension that will do it https://www.npmjs.com/package/markdown-it-anchor it doesn't look like that package is on bower though. @scragg0x (or anyone who knows about javascripty stuff) is there a clean way to include this if I can't just add it to the bower requirements?

scragg0x commented 7 years ago

@gazpachoking I usually use webpack/npm for new projects but realms is simple with no frontend build tools. You could get this file, https://wzrd.in/standalone/markdown-it-anchor@latest and toss it into realms and try it out.

scragg0x commented 7 years ago

I got it from here btw: https://jsfiddle.net/9ukc8dy6/

gazpachoking commented 7 years ago

@scragg0x Thanks, that seems to work. I think that should be all of the old functionality restored now.