6 # Docutils front-end with syntax highlight.
8 # :Author: David Goodger, a Pygments author|contributor, Guenter Milde
9 # :Date: $Date: 2008-05-22 08:42:52 +0200 (Do, 22. Mai 2008) $
10 # :Copyright: This module has been placed in the public domain.
12 # This is a merge of the docutils_ `rst2latex` front end with an extension
13 # suggestion taken from the Pygments_ documentation.
18 A front end to docutils, producing LaTeX with syntax colouring using pygments
20 Generates LaTeX documents from standalone reStructuredText sources. Uses the
21 `Pygments` syntax highlighter to parse and mark up the content of ``..
22 code::` directives. Needs an adapted stylesheet.
32 locale
.setlocale(locale
.LC_ALL
, '')
36 from docutils
.core
import publish_cmdline
, default_description
38 # `<pygments_code_block_directive.py>`_ defines and registers a new
39 # directive `code` that uses the `Pygments`_ syntax highlighter to
40 # render code in color::
42 import pygments_code_block_directive
44 # Call the docutils publisher to render the input as latex::
46 description
= __doc__
+ default_description
47 publish_cmdline(writer_name
='latex2e', description
=description
)
51 # .. _docutils: http://docutils.sf.net/
52 # .. _pygments: http://pygments.org/
53 # .. _Using Pygments in ReST documents: http://pygments.org/docs/rstdirective/