Mercurial > hg
comparison doc/runrst @ 10971:cbe400a8e217
doc: add generic frontend to rst2man and rst2html
This will allow us to easily register new roles and directives.
author | Martin Geisler <mg@aragost.com> |
---|---|
date | Thu, 22 Apr 2010 09:57:04 +0200 |
parents | |
children | 0a2c6948f5f4 |
comparison
equal
deleted
inserted
replaced
10970:3213e8947975 | 10971:cbe400a8e217 |
---|---|
1 #!/usr/bin/env python | |
2 # | |
3 # runrst - register custom roles and run correct writer | |
4 # | |
5 # Copyright 2010 Matt Mackall <mpm@selenic.com> and others | |
6 # | |
7 # This software may be used and distributed according to the terms of the | |
8 # GNU General Public License version 2 or any later version. | |
9 | |
10 """usage: %s WRITER args... | |
11 | |
12 where WRITER is the name of a Docutils writer such as 'html' or 'manpage' | |
13 """ | |
14 | |
15 import sys | |
16 from docutils.core import publish_cmdline | |
17 | |
18 if __name__ == "__main__": | |
19 if len(sys.argv) < 2: | |
20 sys.stderr.write(__doc__ % sys.argv[0]) | |
21 sys.exit(1) | |
22 | |
23 writer = sys.argv[1] | |
24 del sys.argv[1] | |
25 | |
26 publish_cmdline(writer_name=writer) |