Mercurial > public > mercurial-scm > hg
diff doc/runrst @ 10972:0a2c6948f5f4
doc, minirst: support hg interpreted text role
author | Martin Geisler <mg@aragost.com> |
---|---|
date | Thu, 22 Apr 2010 10:04:53 +0200 |
parents | cbe400a8e217 |
children | 854ac04d712c |
line wrap: on
line diff
--- a/doc/runrst Thu Apr 22 09:57:04 2010 +0200 +++ b/doc/runrst Thu Apr 22 10:04:53 2010 +0200 @@ -13,7 +13,16 @@ """ import sys +from docutils.parsers.rst import roles from docutils.core import publish_cmdline +from docutils import nodes, utils + +def role_hg(name, rawtext, text, lineno, inliner, + options={}, content=[]): + node = nodes.literal(rawtext, "hg " + utils.unescape(text, True)) + return [node], [] + +roles.register_local_role("hg", role_hg) if __name__ == "__main__": if len(sys.argv) < 2: