New Nikola Feature: code listings

This is a new feature in Nikola, my static website and blog generator.

It's aimed at showing pieces of files in the posts, and giving you a link to the full file, does reasonable syntax highlight thanks to pygments, and the syntax for embedding in your posts is not excessively awful, so I can use it for some of my tutorial / book projects.

Here's an example:

.. listing:: md.py python
   :start-at: def compile_html
   :end-before: output =

System Message: ERROR/3 (<string>, line 14)

Error in "listing" directive: unknown option: "start-at".

.. listing:: md.py python
    :start-at: def compile_html
    :end-before: output =

This is not merged into master yet, but should be soon.

Comments

Comments powered by Disqus