@@ -183,6 +183,11 @@ def process_file(f):
return docs
+def decorate(l):
+ # type: (str) -> str
+ l = re.sub(r"@(\w+)", "**\\1**", l)
+ return l
+
def convert_to_rst(info):
# type: (Dict[str, Any]) -> List[Tuple[int, str]]
lst = []
@@ -217,6 +222,7 @@ def convert_to_rst(info):
for (n, name, l) in info.get('tags', []):
if name != 'return':
name = 'param ' + name
+ l = decorate(l)
l = '\t:%s: %s' % (name, l)
lst.append((n, l))
lst.append((n+1, ''))
@@ -225,6 +231,7 @@ def convert_to_rst(info):
n = desc[0]
r = ''
for l in desc[1:]:
+ l = decorate(l)
r += '\t' + l + '\n'
lst.append((n, r))
return lst
The syntax for a parameter is '@<name>'. Let also use this when referencing a parameter name in another section (other parameters or long description) and mark these references in bold (the same as the parameters themseelves are presented). Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com> --- Documentation/sphinx/cdoc.py | 7 +++++++ 1 file changed, 7 insertions(+)