Code

"upgrade you doofus" text inserted to appease anthony ;)
[roundup.git] / doc / build_html.py
1 #!/usr/bin/env python
3 """
4 :Author: David Goodger
5 :Contact: goodger@users.sourceforge.net
6 :Revision: $Revision: 1.2 $
7 :Date: $Date: 2002-05-06 23:38:07 $
8 :Copyright: This module has been placed in the public domain.
10 A minimal front-end to the Docutils Publisher.
12 This module takes advantage of the default values defined in `publish()`.
13 """
15 import sys, os.path
16 from docutils.core import publish
17 from docutils import utils
19 if len(sys.argv) < 2:
20     print >>sys.stderr, 'I need at least one filename'
21     sys.exit(1)
23 reporter = utils.Reporter(2, 4)
25 for file in sys.argv[1:]:
26     name, ext = os.path.splitext(file)
27     dest = '%s.html'%name
28     print >>sys.stderr, '%s -> %s'%(file, dest)
29     publish(writer_name='html', source=file, destination=dest,
30         reporter=reporter)