summaryrefslogtreecommitdiff
path: root/sandbox/latex_directive/rst2html.py
blob: 4a044fb3d203ec176a4b0b81656a4d95df6e75d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env python

# Author: John Gill
# Contact: swfiua@gmail.com
# Revision: $$
# Date: $ $
# Copyright: This module has been placed in the public domain.

"""
A minimal front end to the Docutils Publisher, producing HTML.

Extended to add support for a latex directive.

Latex code is processed by latex and turned into a png.
"""

import locale
try:
    locale.setlocale(locale.LC_ALL, '')
except:
    pass

from docutils.core import publish_cmdline, Publisher, default_description

import latex_directive
latex_directive.register()  # Enable the ABC directive

description = ('Generates (X)HTML documents from standalone reStructuredText '
               'sources.  ' + default_description)

publish_cmdline(writer_name='html', description=description)