/[gzz]/gzz/metacode/pegboard.py
ViewVC logotype

Diff of /gzz/metacode/pegboard.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by benja, Wed Oct 9 09:00:45 2002 UTC revision 1.3 by tjl, Mon Oct 28 08:37:27 2002 UTC
# Line 19  Line 19 
19  # Creating the pegboard  # Creating the pegboard
20  # Must be run in the main directory (the one Makefile is in).  # Must be run in the main directory (the one Makefile is in).
21    
22    import docutils
23  import docutils.core  import docutils.core
24  import sys, os, os.path  import sys, os, os.path
25    
# Line 44  for peg in pegs: Line 45  for peg in pegs:
45      print "Process PEG %s" % (peg,)      print "Process PEG %s" % (peg,)
46            
47      args = '-stg --stylesheet doc/gzz.css %s.rst %s.html' % (f,f)      args = '-stg --stylesheet doc/gzz.css %s.rst %s.html' % (f,f)
48    
49        # Generate the HTML
50      docutils.core.publish(writer_name='html', argv=args.split())      docutils.core.publish(writer_name='html', argv=args.split())
51    
52        if 0:
53            #config = docutils.frontend.ConfigParser()
54            #defaults = config.get_section('options')
55            opts = docutils.frontend.OptionParser()
56            #opts.set_defaults(**defaults)
57            opts.input_encoding = "utf-8"
58            opts.report_level = "0"
59            opts.halt_level = "3"
60            opts.warning_stream = sys.stdout
61            opts.debug = "0"
62            opts.language_code = "en"
63    
64            ioobj = docutils.io.FileIO(opts, source_path="%s.rst" % (f,))
65            reader = docutils.readers.get_reader_class("rst")(None, None)
66            # doc = reader.read(ioobj, "restructuredtext", opts)
67            reader.set_parser("restructuredtext")
68            doc = reader.read(ioobj, None, opts)
69            print doc

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26