summaryrefslogtreecommitdiff
path: root/sandbox/code-block-directive/rst2html-highlight
diff options
context:
space:
mode:
Diffstat (limited to 'sandbox/code-block-directive/rst2html-highlight')
-rwxr-xr-xsandbox/code-block-directive/rst2html-highlight23
1 files changed, 19 insertions, 4 deletions
diff --git a/sandbox/code-block-directive/rst2html-highlight b/sandbox/code-block-directive/rst2html-highlight
index 737a8c802..0203c857e 100755
--- a/sandbox/code-block-directive/rst2html-highlight
+++ b/sandbox/code-block-directive/rst2html-highlight
@@ -1,11 +1,18 @@
#!/usr/bin/python
+# rst2html-highlight
+# ==================
+#
+# Docutils front-end with syntax highlight.
+#
# :Author: David Goodger, a Pygments author|contributor, Guenter Milde
# :Date: $Date: $
# :Copyright: This module has been placed in the public domain.
-
+#
# This is a merge of the docutils_ `rst2html` front end with an extension
# suggestion taken from the pygments_ documentation.
+#
+# ::
"""
A front end to docutils, producing HTML with syntax colouring using pygments
@@ -15,6 +22,10 @@ Generates (X)HTML documents from standalone reStructuredText sources. Uses
Needs an adapted stylesheet
"""
+# Requirements
+# ------------
+# ::
+
try:
import locale
locale.setlocale(locale.LC_ALL, '')
@@ -23,14 +34,18 @@ except:
from docutils.core import publish_cmdline, default_description
-# Define and register a new directive `code-block` that uses the `pygments`_
-# source highlighter to render code in color.
+# The `pygments_code_block_directive`_ module defines and registers a new
+# directive `code-block` that uses the `pygments`_ source highlighter to
+# render code in color::
+
import pygments_code_block_directive
# Call the docutils publisher to render the input as html::
+
description = __doc__ + default_description
publish_cmdline(writer_name='html', description=description)
-# .. _doctutile: http://docutils.sf.net/
+# .. _docutils: http://docutils.sf.net/
+# .. _pygments_code_block_directive.py: pygments_code_block_directive.py
# .. _pygments: http://pygments.org/
# .. _Using Pygments in ReST documents: http://pygments.org/docs/rstdirective/