You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[misc] use highlight.js for syntax highlighting in blog post (#18480)
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.
Since we're highlighting nicely now, I also removed 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.
Used on mypy 1.14 blog post -
https://mypy-lang.blogspot.com/2024/12/mypy-114-released.html
0 commit comments