minirst: add margin around definition items
authorMartin Geisler <mg@lazybytes.net>
Sun, 18 Apr 2010 15:47:49 +0200
changeset 10936 2853c891ac41
parent 10935 5f10634f9e68
child 10937 a9d5943d2a30
minirst: add margin around definition items This greatly improves the output of 'hg help env'.
mercurial/minirst.py
tests/test-convert.out
tests/test-minirst.py.out
--- a/mercurial/minirst.py	Fri Apr 16 19:18:20 2010 +0200
+++ b/mercurial/minirst.py	Sun Apr 18 15:47:49 2010 +0200
@@ -261,7 +261,7 @@
     i = 1
     while i < len(blocks):
         if (blocks[i]['type'] == blocks[i - 1]['type'] and
-            blocks[i]['type'] in ('bullet', 'option', 'field', 'definition')):
+            blocks[i]['type'] in ('bullet', 'option', 'field')):
             i += 1
         else:
             blocks.insert(i, dict(lines=[''], indent=0, type='margin'))
--- a/tests/test-convert.out	Fri Apr 16 19:18:20 2010 +0200
+++ b/tests/test-convert.out	Sun Apr 18 15:47:49 2010 +0200
@@ -103,8 +103,10 @@
         ignore integrity errors when reading. Use it to fix Mercurial
         repositories with missing revlogs, by converting from and to
         Mercurial.
+
     --config convert.hg.saverev=False         (boolean)
         store original revision ID in changeset (forces target IDs to change)
+
     --config convert.hg.startrev=0            (hg revision identifier)
         convert start revision and its descendants
 
@@ -125,25 +127,30 @@
     --config convert.cvsps.cache=True         (boolean)
         Set to False to disable remote log caching, for testing and debugging
         purposes.
+
     --config convert.cvsps.fuzz=60            (integer)
         Specify the maximum time (in seconds) that is allowed between commits
         with identical user and log message in a single changeset. When very
         large files were checked in as part of a changeset then the default
         may not be long enough.
+
     --config convert.cvsps.mergeto='{{mergetobranch ([-\w]+)}}'
         Specify a regular expression to which commit log messages are matched.
         If a match occurs, then the conversion process will insert a dummy
         revision merging the branch on which this log message occurs to the
         branch indicated in the regex.
+
     --config convert.cvsps.mergefrom='{{mergefrombranch ([-\w]+)}}'
         Specify a regular expression to which commit log messages are matched.
         If a match occurs, then the conversion process will add the most
         recent revision on the branch indicated in the regex as the second
         parent of the changeset.
+
     --config hook.cvslog
         Specify a Python function to be called at the end of gathering the CVS
         log. The function is passed a list with the log entries, and can
         modify the entries in-place, or add or delete them.
+
     --config hook.cvschangesets
         Specify a Python function to be called after the changesets are
         calculated from the the CVS log. The function is passed a list with
@@ -170,8 +177,10 @@
 
     --config convert.svn.branches=branches    (directory name)
         specify the directory containing branches
+
     --config convert.svn.tags=tags            (directory name)
         specify the directory containing tags
+
     --config convert.svn.trunk=trunk          (directory name)
         specify the name of the trunk branch
 
@@ -202,8 +211,10 @@
 
     --config convert.hg.clonebranches=False   (boolean)
         dispatch source branches in separate clones.
+
     --config convert.hg.tagsbranch=default    (branch name)
         tag revisions branch name
+
     --config convert.hg.usebranchnames=True   (boolean)
         preserve branch names
 
--- a/tests/test-minirst.py.out	Fri Apr 16 19:18:20 2010 +0200
+++ b/tests/test-minirst.py.out	Sun Apr 18 15:47:49 2010 +0200
@@ -25,10 +25,12 @@
 ----------------------------------------------------------------------
 A Term
   Definition. The indented lines make up the definition.
+
 Another Term
     Another definition. The final line in the definition
     determines the indentation, so this will be indented
     with four spaces.
+
   A Nested/Indented Term
     Definition.
 ----------------------------------------------------------------------
@@ -39,6 +41,7 @@
   Definition. The indented
   lines make up the
   definition.
+
 Another Term
     Another definition. The
     final line in the
@@ -46,6 +49,7 @@
     indentation, so this will
     be indented with four
     spaces.
+
   A Nested/Indented Term
     Definition.
 ----------------------------------------------------------------------