BlogLiterately icon indicating copy to clipboard operation
BlogLiterately copied to clipboard

Ability to "bake in" syntax highlighting for languages other than Haskell

Open byorgey opened this issue 11 years ago • 3 comments

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).

byorgey avatar Mar 10 '13 01:03 byorgey

Ah, apparently Pandoc can already do this: see http://hackage.haskell.org/packages/archive/pandoc/latest/doc/html/Text-Pandoc-SelfContained.html#v:makeSelfContained !

byorgey avatar Mar 27 '13 00:03 byorgey

I'd like syntax highlighting for languages other than Haskell.

idontgetoutmuch avatar Jan 21 '14 15:01 idontgetoutmuch

Is there anyway I can get syntax highlighting for e.g. python?

https://gist.github.com/idontgetoutmuch/c638fd0dd2a6af8b3503a8f05c89c326

idontgetoutmuch avatar May 27 '17 07:05 idontgetoutmuch