aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Documentation/sphinx
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-08-20 23:20:44 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-08-21 22:16:01 +0200
commit136cc7ed387be8e0309d4f7b7b99ed5a4851907a (patch)
treeb6e32709b4d198aec8da08b2a6d0514ff4091cd6 /Documentation/sphinx
parent4d1f05ecdfa31a3212508b0c7e1ef1cac7893332 (diff)
downloadsparse-dev-136cc7ed387be8e0309d4f7b7b99ed5a4851907a.tar.gz
doc: automatically insert the blank line for lists
ReST requires a blank line to start a list. This is a bit annoying for the internal documentation because this makes, IMO, things less readable in the code. Tweak the documentation extraction tool to automatically insert these blank lines (between a line ending with ':' and the next one if not empty). Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'Documentation/sphinx')
-rwxr-xr-xDocumentation/sphinx/cdoc.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Documentation/sphinx/cdoc.py b/Documentation/sphinx/cdoc.py
index dfb28a5b..318e9b23 100755
--- a/Documentation/sphinx/cdoc.py
+++ b/Documentation/sphinx/cdoc.py
@@ -217,6 +217,9 @@ def convert_to_rst(info):
for i in range(1, len(desc)):
l = desc[i]
lst.append((n+i, l))
+ # auto add a blank line for a list
+ if re.search(r":$", desc[i]) and re.search(r"\S", desc[i+1]):
+ lst.append((n+i, ''))
elif typ == 'func':
(n, l) = info['func']