byorgey / BlogLiterately

Command-line tool for formatting and publishing blog posts.
GNU General Public License v3.0
19 stars 4 forks source link

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

Open byorgey opened 11 years ago

byorgey commented 11 years ago

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 commented 11 years ago

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

idontgetoutmuch commented 10 years ago

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

idontgetoutmuch commented 7 years ago

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

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