Hi I’m new to Grav. I just got setup with the default Antimatter theme. I was reading through the tutorial and it seems like syntax highlighting should work if I enable Markdown extra in system.yaml. After setting extra: true and using the backquote syntax it doesn’t seem to work. The code just blockquoted and no highlighting is applied. Is there some other step I need to do to enable syntax highlighting other than enabling markdown extra in config?
I tried setting extra: true to both system.yaml in system and user folder. Either case didn’t work
Markdown Extra doesn’t highlight code for you. The only thing what it does, is setting the appropriate classes. Usually you write something like
``php
<?php phpinfo();
``
(with three instead of two backticks of course). On top of that you need a syntax highlighter. Highlight uses for example the well known Highlight.js. If you want to process the code with PHP you can do so for example with Geshi, but there is no plugin yet, so that you have to write it on your own.
The documentation you referred is indeed unclear, but in order to highlight code (inside fenced code) you need the Highlight plugin (https://github.com/getgrav/grav-plugin-highlight) I mentioned earlier. Further, on the client side JavaScript must be enabled. Without you only see the non-highlighted code.