4 ms·
Documentation could definitely use a nicer coat of paint. Not sure how to do syntax highlighting in raw markdown, and GitHub won't accept a new language definit
by titzer 4y ago
Documentation could definitely use a nicer coat of paint. Not sure how to do syntax highlighting in raw markdown, and GitHub won't accept a new language definition unless it is in "hundreds" of projects. So maybe an image?
- brabel 4y agoI'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/