Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[misc] use highlight.js for syntax highlighting in blog post
Toe get highlighting to work, we just need to import the CSS and run the highlight.js that does the highlighting in JS client side. We can add the lines at the top of the blog post to do this. I've made it only support bash and python for now to help with detection. But if we have a reason to, we can remove that and let it try them all. In a previous PR I've added the necessary <code> tags. But since we're highlighting nicely now, we can just remove the extra indendation. I've also noticed that we're pretty good at specifying the language in code blocks in the changelog. So we can take that language and use it in the code block as a class to tell highlight.js exactly what language that code block is in. If this is useful, we can remove the limitation of only python and bash support from the top configuration in the future. This is useful for smaller blocks of a few lines where maybe it doesn't detect the language properly.
- Loading branch information