There is no syntax highlighting in code blocks.
I expect markdown code blocks to have syntax highlighting (like the default mkdocs theme does).
Example markdown code block:
``` javascript
function add(a, b) {
return a + b
}
Syntax highlighting in default mkdocs theme:
If I use this mkdocs theme there is no syntax highlighting in code blocks:
pip install mkdocs-materialtheme: 'material'mkdocs servehttp://127.0.0.1:8000/ in the browsersite_name: Code Demo
theme: material
Did you install Pygments and activate CodeHilite extension in your theme?
http://squidfunk.github.io/mkdocs-material/extensions/codehilite/
Please read the docs:
http://squidfunk.github.io/mkdocs-material/extensions/codehilite/
The thing is: if you install mkdocs-material via pip, it SHOULD install Pygments for you, as it is specified as a dependency. Please check if Pygments is/was installed. If not, we can look into it.
Yes Pygments was installed with mkdocs-material. I just forgot to add
markdown_extensions:
- codehilite
to my mkdocs.yml. Sorry for that & Thanks!
Most helpful comment
Did you install Pygments and activate CodeHilite extension in your theme?
http://squidfunk.github.io/mkdocs-material/extensions/codehilite/