2 ms·
I've used a markdown to html converter to convert my blog posts into HTML with very nice and customizable code samples... in my case I used Go's Blackfriday lib
by brabel 4y ago
I've used a markdown to html converter to convert my blog posts into HTML with very nice and customizable code samples... in my case I used Go's Blackfriday library with bfchroma[1] doing syntax highlighting with Chroma[2]. To add your language to Chroma you have to provide a lexer, which in turn is written in Pygments[3] syntax.
Once you have that, you can post your docs in GitHub Pages (or something like Netlify[4] or Cloudflare[5]), they both can run a command to build your website (from markdown to html) every time you push to a branch, and then serve the HTML generated as a static site.
Before this though, your language seems similar enough to others (maybe Java or C#?) that if you tell the converter to use those languages, you'll get decent enough highlighting. I did this to highlight Zig code before it became supported by telling the converter it was typescript code (coincidentally, many keywords seem to have aligned well enough)!
[1] https://github.com/Depado/bfchroma/ https://github.com/Depado/bfchroma/
[2] https://github.com/alecthomas/chroma#supported-languages https://github.com/alecthomas/chroma#supported-languages
[3] https://pygments.org/docs/lexerdevelopment/ https://pygments.org/docs/lexerdevelopment/
[4] https://www.netlify.com/blog/2016/10/27/a-step-by-step-guide-deploying-a-static-site-or-single-page-app/ https://www.netlify.com/blog/2016/10/27/a-step-by-step-guide...
[5] https://pages.cloudflare.com/ https://pages.cloudflare.com/