7 # Docutils front-end with syntax highlight.
9 # :Author: David Goodger, Georg Brandl, Günter Milde
10 # :Date: $Date: 2008-05-22 08:42:52 +0200 (Do, 22. Mai 2008) $
11 # :Copyright: This module has been placed in the public domain.
13 # This is a merge of the docutils_ `rst2html` front end with an extension
14 # suggestion by Felix Wiemann.
19 A front end to docutils, producing HTML with syntax colouring using pygments
21 Generates (X)HTML documents from standalone reStructuredText sources. Uses
22 `pygments` to parse and mark up the content of ``.. code::` directives.
23 Needs an adapted stylesheet
33 locale
.setlocale(locale
.LC_ALL
, '')
37 from docutils
.core
import publish_cmdline
, default_description
39 # The `pygments_code_block_directive`_ module defines and registers a new
40 # directive `code` that uses the `pygments`_ source highlighter to
41 # render code in color::
43 import pygments_code_block_directive
45 # Call the docutils publisher to render the input as html::
47 description
= __doc__
+ default_description
48 publish_cmdline(writer_name
='html', description
=description
)
50 # .. _docutils: http://docutils.sf.net/
51 # .. _pygments_code_block_directive: pygments_code_block_directive.py
52 # .. _pygments: http://pygments.org/
53 # .. _Using Pygments in ReST documents: http://pygments.org/docs/rstdirective/