shakna-israel / docbuilder

Build Python Technical Documentation from Literate Programming Programs
http://docbuilder.rtfd.org
MIT License
1 stars 0 forks source link

Support GFM contextual highlighting #74

Open shakna-israel opened 9 years ago

shakna-israel commented 9 years ago

Currently docbuilder builds standard code blocks:

print("Hello World!")

It would be useful if it could take advantage of GitHub's markdown flavour for specifying a language, so it can do some highlighting magic:

print("Hello World!")

It still needs checking to see if this would break markdown rendering under MKDocs and Sphynx.

shakna-israel commented 9 years ago

This doesn't seem to break code highlighting, but might not be desirable in all circumstances.

Imgur

On both the standard MKDocs theme and the ReadTheDocs theme, the first codeblock gets some syntax highlighting, the bottom doesn't appear to get the same, though it uses a python tag.

So it seems the only time you'd want this, is if you were rendering to a GitHub or GFM-compatible engine.

shakna-israel commented 9 years ago

A solution would be an optional flag, maybe --force-highlight, to imply that it shouldn't normally be necessary.