Mercurial > public > mercurial-scm > hg-stable
diff doc/gendoc.py @ 9158:d6eecafaf12f
doc: use reStructuredText for man and HTML pages
The Makefile now requires the rst2html and rst2man programs. Both can
be found in Debian testing or downloaded from the Docutils homepage:
http://docutils.sf.net/
http://docutils.sf.net/sandbox/manpage-writer/
The new HTML and man pages no longer contain huge amounts of
un-wrapping literal blocks, thanks to how snippets of reStructuredText
can easily be included inside other reStructuredText documents.
The HTML pages now have anchors for all sections, including the help
topics in hgrc.1 which were missing from the old HTML pages.
author | Martin Geisler <mg@lazybytes.net> |
---|---|
date | Thu, 16 Jul 2009 23:25:26 +0200 |
parents | 335f749cc369 |
children | d98cef25b5af |
line wrap: on
line diff
--- a/doc/gendoc.py Thu Jul 16 23:25:26 2009 +0200 +++ b/doc/gendoc.py Thu Jul 16 23:25:26 2009 +0200 @@ -62,7 +62,7 @@ # print options underlined(_("OPTIONS")) for optstr, desc in get_opts(globalopts): - ui.write("%s::\n %s\n\n" % (optstr, desc)) + ui.write("%s\n %s\n\n" % (optstr, desc)) # print cmds underlined(_("COMMANDS")) @@ -78,15 +78,15 @@ if f.startswith("debug"): continue d = get_cmd(h[f]) # synopsis - ui.write("[[%s]]\n" % d['cmd']) - ui.write("%s::\n" % d['synopsis'].replace("hg ","", 1)) + ui.write(".. _%s:\n\n" % d['cmd']) + ui.write("``%s``\n" % d['synopsis'].replace("hg ","", 1)) # description ui.write("%s\n\n" % d['desc'][1]) # options opt_output = list(d['opts']) if opt_output: opts_len = max([len(line[0]) for line in opt_output]) - ui.write(_(" options:\n")) + ui.write(_(" options:\n\n")) for optstr, desc in opt_output: if desc: s = "%-*s %s" % (opts_len, optstr, desc)