Commit Graph

19 Commits

Author SHA1 Message Date
Erik Zielke
cd95a50630 minirst: improved support for option lists.
This enables minirst to parse and print option lists which have both
long and short options. Before, we could only parse option lists with
long options.
2010-11-02 17:44:19 +01:00
Erik Zielke
87792363c2 minirst: modified minirst to also recognize empty comments.
The modifies minirst to also handle empty comments. An empty comment
is a block with a single line containing two dots.
2010-11-16 13:29:08 +01:00
Dan Villiom Podlaski Christiansen
f385faac7a *: kill all unnecessary shebangs. 2010-10-26 12:18:39 +02:00
Martin Geisler
98ed55bc01 minirst: ignore comments 2010-10-23 17:30:08 +02:00
Erik Zielke
208cfeec63 minirst: Support for admonitions
The old asciidoc format supported something like this,
this is why there is NOTE: scattered here and there.
2010-09-22 15:51:59 +02:00
Martin Geisler
0d2cf4548b minirst: support all recommended title adornments 2010-04-25 18:19:54 +02:00
Martin Geisler
52cafb8233 minirst: correctly format sections containing inline markup
Before, a section like

  ``foo``
  -------

would be formatted as

  "foo"
  -------

We now recompute the length of the underline when formatting the
section.
2010-04-25 17:48:26 +02:00
Martin Geisler
3213b9890f minirst: add test for sections 2010-04-25 16:17:24 +02:00
Martin Geisler
1d06245892 doc, minirst: support hg interpreted text role 2010-04-22 10:04:53 +02:00
Martin Geisler
5d5d51ef46 minirst: support line blocks 2010-02-13 21:21:40 +01:00
Martin Geisler
9abe6f2e23 minirst: report pruned container types 2010-02-13 18:11:08 +01:00
Martin Geisler
5d09b1af66 minirst: support containers
Text can be grouped into generic containers in reStructuredText:

  .. container:: foo

     This is text inside a "foo" container.

     .. container:: bar

        This is nested inside two containers.

The minirst parser now recognizes these containers. The containers are
either pruned completely from the output (included all nested blocks)
or they are simply un-indented. So if 'foo' and 'bar' containers are
kept, the above example will result in:

     This is text inside a "foo" container.

     This is nested inside two containers.

If only 'foo' containers are kept, we get:

     This is text inside a "foo" container.

No output is made if only 'bar' containers are kept.

This feature will come in handy for implementing different levels of
help output (e.g., verbose and debug level help texts).
2009-10-04 22:03:41 +02:00
Matt Mackall
9b18b4fac2 test-minirst: hide trailing whitespace from check-code 2010-01-28 22:44:36 -06:00
Martin Geisler
1a33bb5ceb minirst: improve layout of field lists
Before, we used the padding following the key to compute where to wrap
the text. Long keys would thus give a big indentation. It also
required careful alignment of the source text, making it cumbersome to
items to the list.

We now compute the maximum key length and use that for all items in
the list. We also put a cap on the indentation: keys longer than 10
characters are put on their own line. This is similar to how rst2html
handles large keys: it uses 14 as the cutoff point, but I felt that 10
was better for monospaced text in the console.
2009-12-13 23:49:53 +01:00
Martin Geisler
4c7564177a minirst: support enumerated lists 2009-11-07 03:14:56 +01:00
Martin Geisler
7271a9da14 test-minirst: don't test on invalid reST input
Input such as

      Only the
    left-most line
  (this line!)
    is significant
      for the indentation

is not valid reStructuredText: the first line starts a block quote,
but then the second line is not allowed to be unindented.
2009-11-05 21:53:22 +01:00
Martin Geisler
d2c1c263b4 minirst: parse field lists 2009-08-02 23:38:07 +02:00
Martin Geisler
65b64640d1 minirst: indent literal blocks with two spaces
The vast majority* of them are formatted like this in the source, so
this basically reverts the output to how it looked before we got the
minirst parser.

*: the help on templating use four spaces for some examples and will
   now shown with an indentation of just two spaces.
2009-08-02 17:17:17 +02:00
Martin Geisler
7953ecf0bd minimal reStructuredText parser 2009-07-16 23:25:25 +02:00