Skip to content

Commit

Permalink
Feature autodocs stormcmds (#1866)
Browse files Browse the repository at this point in the history
* Add refs to stormcmds made from stormpackages in autodocs
  • Loading branch information
vEpiphyte authored Sep 1, 2020
1 parent d0f5234 commit a021f23
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions synapse/tests/test_tools_autodoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ async def test_tools_autodoc_stormsvc(self):
self.isin('StormvarServiceCell Storm Service', s)
self.isin('This documentation is generated for version 0.0.1 of the service.', s)
self.isin('Storm Package\\: stormvar', s)
self.isin('.. _stormcmd-stormvar-magic:\n', s)
self.isin('magic\n-----', s)
self.isin('Test stormvar support', s)
self.isin('forms as input nodes', s)
Expand Down
4 changes: 2 additions & 2 deletions synapse/tools/autodoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,8 +551,8 @@ def get(self, key):
cargs = cdef.get('cmdargs')

# command names cannot have colons in them thankfully

rst.addHead(cname, lvl=3)
cref = f'.. _stormcmd-{pname.replace(":", "-")}-{cname.replace(".", "-")}:'
rst.addHead(cname, lvl=3, link=cref)

# Form the description
lines = ['::\n']
Expand Down

0 comments on commit a021f23

Please sign in to comment.