I'd like to embed local files as code snippets in a static website I'm making with jade, marked and codemirror for syntax highlighing. I will write a jade filter to do this.
What it boils down to is that I need to come up with the codemirror mode and github flavored markdown language (what you write when you do ```language) from the file extension.
At least some codemirror modes correspond to gfm languages. Do all of them coincide? Is there a list somewhere, or some rationale for the names?
Thanks
The
mode/meta.js
file in CodeMirror's distribution associates names with modes (via theCodeMirror.findModeByName
function), and if you get CodeMirror version 4.8 (released yesterday), thegfm
mode will use this list to try and use the right mode for fenced code blocks that declare a language.