[PATCH 2/5] doc: automatically insert the blank line for lists

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 Documentation/sphinx/cdoc.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/sphinx/cdoc.py b/Documentation/sphinx/cdoc.py
index dfb28a5bb..318e9b236 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']
-- 
2.18.0




[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux