BlogLiterately
BlogLiterately copied to clipboard
Ability to "bake in" syntax highlighting for languages other than Haskell
Currently, applying syntax highlighting to other languages just generates span tags with classes indicating syntax class. To actually apply highlighting, an external CSS file must be given.
The key is to look at generalizing defaultStylePrefs
, getStylePrefs
, and bakeStyles
.
Another issue is that it would be nice to be able to just give a .css
file instead of a special "style" file, so perhaps we should look into a way to parse .css
files and use that. We can use http://hackage.haskell.org/packages/archive/css-text/0.1.1/doc/html/Text-CSS-Parse.html for this purpose (in particular see the parseBlocks
function).
Ah, apparently Pandoc can already do this: see http://hackage.haskell.org/packages/archive/pandoc/latest/doc/html/Text-Pandoc-SelfContained.html#v:makeSelfContained !
I'd like syntax highlighting for languages other than Haskell.
Is there anyway I can get syntax highlighting for e.g. python?
https://gist.github.com/idontgetoutmuch/c638fd0dd2a6af8b3503a8f05c89c326