ubuntu.com
ubuntu.com copied to clipboard
Syntax Highlighting for code snippets
Summary
I would like syntax highlighting for shell scripts and python scripts.
Process
Code snippets will be inserted using Custom HTML blocks in Wordpress, following these examples: https://vanillaframework.io/docs/base/code
Current and expected result
There is no syntax highlighting on code snippets, on ubuntu.com, today: https://ubuntu.com/blog/planning-phased-ubuntu-22-04-enterprise-desktop-upgrades-with-landscape
A code block experience similar to this would be desirable: https://gist.github.com/rajannpatel/63bbc6aada41e0534ae5d09a098d0be7
Screenshot
Thanks for raising Rajan, we'll investigate, we should have it already according to our design system recommendations (https://vanillaframework.io/docs/base/code#syntax-highlighting) - possibly it hasn't been implemented yet.
So we already have the necessary Prism files in ubuntu.com and you just need to include the .js & .css files in that page and add the appropriate classes to the code block. However, I am not sure how hard it would be to communicate this from word press to our blog builder, any ideas @carkod