[PATCH 2 of 6] minimal reStructuredText parser

Greg Ward greg-hg at gerg.ca
Fri Jul 10 14:08:26 CDT 2009


On Fri, Jul 10, 2009 at 7:54 AM, Martin Geisler<mg at lazybytes.net> wrote:
> # HG changeset patch
> # User Martin Geisler <mg at lazybytes.net>
> # Date 1247223358 -7200
> # Node ID 860b4d1f8341f5042ccbe51e2a83d57127c7df71
> # Parent  5bb490a0b3ac97ad85f1848d72edd20757782904
> minimal reStructuredText parser
>
> diff --git a/mercurial/minirst.py b/mercurial/minirst.py
> new file mode 100644
> --- /dev/null
> +++ b/mercurial/minirst.py
> @@ -0,0 +1,299 @@
> +# minirst.py - minimal reStructuredText parser
> +#
> +# Copyright 2009 Matt Mackall <mpm at selenic.com> and others
> +#
> +# This software may be used and distributed according to the terms of the
> +# GNU General Public License version 2, incorporated herein by reference.
> +
> +"""simplified reStructuredText parser.
> +
> +This parser knows just enough about reStructuredText to parse the
> +Mercurial docstrings.

Ugh.  I hate to rain on your parade, but is this *really* the right
approach?  Where will we be in two years -- debating the finer points
of "standard" reST versus "Mercurial" reST?  The whole point of reST
is that there is a formal grammar and a well-tested reference
implementation.  Granted, it's a big chunk of code that Mercurial
really shouldn't depend for day-to-day use.

So is this intended for generating "hg help" output, or for generating
man pages, or for both?

Greg



More information about the Mercurial-devel mailing list