aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-08-21 00:14:30 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-08-21 22:14:56 +0200
commit4d1f05ecdfa31a3212508b0c7e1ef1cac7893332 (patch)
tree21624118cbbb897f07053860c290d7753cc2fdc3
parent8a92181a03e1c6c6ce723a8edddc4b786ad3cebc (diff)
downloadsparse-dev-4d1f05ecdfa31a3212508b0c7e1ef1cac7893332.tar.gz
doc: simplify the creation of the viewlist
Each bloc-comment is entered in the view list as a single multiline plus a final blank line. This is more complicated than needed and it's useless to first concatenate these lines to split them directly after. Also it makes harder to correctly track the line numbers. Fix this by adding the lines one by one, each with their own lineno. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rwxr-xr-xDocumentation/sphinx/cdoc.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/Documentation/sphinx/cdoc.py b/Documentation/sphinx/cdoc.py
index 2718c86a..dfb28a5b 100755
--- a/Documentation/sphinx/cdoc.py
+++ b/Documentation/sphinx/cdoc.py
@@ -212,12 +212,11 @@ def convert_to_rst(info):
lst.append((n, l))
if 'desc' in info:
desc = info['desc']
- n = desc[0]
- r = ''
- for l in desc[1:]:
- r += l + '\n'
- lst.append((n, r))
- lst.append((n+1, '\n'))
+ n = desc[0] - 1
+ desc.append('')
+ for i in range(1, len(desc)):
+ l = desc[i]
+ lst.append((n+i, l))
elif typ == 'func':
(n, l) = info['func']