sharpchi / moodle-filter_syntaxhighlighter

14 stars 10 forks source link

Hljs helper #8

Closed simon-nicalis closed 4 years ago

simon-nicalis commented 4 years ago

This will automatically create code tags for special pre-blocks with a line like %highlight={lang} where {lang} should be the highlightJS language class, see https://highlightjs.org/usage/ In Atto editor, select "Pre-Formatted" for your code blocks and add that highlight line

This is more flexible than the old way with ``` which tries to auto-detect the language. Auto-detection does not work that well in our experience. Also, by using pre-formatted blocks in Atto editor, it is much easier to copy code from your IDE without messing up the formatting.

sharpchi commented 4 years ago

Thanks for the pull request. I'm pretty full on with some other things atm, but will have a look when I can.

sharpchi commented 4 years ago

I've implemented a language specification feature, so am going to close this pull request. Many thanks.