Skip to content

Commit

Permalink
Merge pull request #13 from njzjz/sphinx
Browse files Browse the repository at this point in the history
fix links in sphinx directive
  • Loading branch information
y1xiaoc authored Jun 11, 2022
2 parents 3c96e6e + 0aab0b6 commit 582e07a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions dargs/sphinx.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,15 @@ def run(self):
if not isinstance(argument, (Argument, Variant)):
raise RuntimeError("The function doesn't return Argument")
rst = argument.gen_doc(make_anchor=True, make_link=True)
items.extend(parse_rst(rst))

node = parse_rst(rst)
self.state.document.nameids.update(node.nameids)
self.state.document.ids.update(node.ids)
self.state.document.refnames.update(node.refnames)
self.state.document.substitution_defs.update(node.substitution_defs)
self.state.document.substitution_names.update(node.substitution_names)
self.state.document.nametypes.update(node.nametypes)
self.state.document.indirect_targets.extend(node.indirect_targets)
items.extend(node)
return items


Expand Down

0 comments on commit 582e07a

Please sign in to comment.