File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 1
1
import re
2
+ from textwrap import dedent
2
3
from typing import Dict , List , Union
3
4
4
5
_GOOGLE_SECTIONS : List [str ] = [
10
11
"Examples" ,
11
12
"Attributes" ,
12
13
"Note" ,
14
+ "Todo" ,
13
15
]
14
16
15
17
ESCAPE_RULES = {
@@ -52,18 +54,21 @@ def _parse(self, content: str) -> None:
52
54
53
55
# Format section
54
56
for part in parts :
57
+ indentation = ""
58
+
55
59
if ":" in part [0 ]:
56
60
spl = part [0 ].split (":" )
57
61
58
62
arg = spl [0 ]
59
- description = ":" .join (spl [1 :])
63
+ description = ":" .join (spl [1 :]).lstrip ()
64
+ indentation = (len (arg ) + 6 ) * " "
60
65
61
66
self .content += "- `{}`: {}\n " .format (arg , description )
62
67
else :
63
68
self .content += "- {}\n " .format (part [0 ])
64
69
65
70
for line in part [1 :]:
66
- self .content += " {} \n " .format (line )
71
+ self .content += "{}{} \n " .format (indentation , line . lstrip () )
67
72
68
73
self .content = self .content .rstrip ("\n " )
69
74
You can’t perform that action at this time.
0 commit comments