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 11import re
2+ from textwrap import dedent
23from typing import Dict , List , Union
34
45_GOOGLE_SECTIONS : List [str ] = [
1011 "Examples" ,
1112 "Attributes" ,
1213 "Note" ,
14+ "Todo" ,
1315]
1416
1517ESCAPE_RULES = {
@@ -52,18 +54,21 @@ def _parse(self, content: str) -> None:
5254
5355 # Format section
5456 for part in parts :
57+ indentation = ""
58+
5559 if ":" in part [0 ]:
5660 spl = part [0 ].split (":" )
5761
5862 arg = spl [0 ]
59- description = ":" .join (spl [1 :])
63+ description = ":" .join (spl [1 :]).lstrip ()
64+ indentation = (len (arg ) + 6 ) * " "
6065
6166 self .content += "- `{}`: {}\n " .format (arg , description )
6267 else :
6368 self .content += "- {}\n " .format (part [0 ])
6469
6570 for line in part [1 :]:
66- self .content += " {} \n " .format (line )
71+ self .content += "{}{} \n " .format (indentation , line . lstrip () )
6772
6873 self .content = self .content .rstrip ("\n " )
6974
You can’t perform that action at this time.
0 commit comments