Doc linking changes

This commit is contained in:
Griatch 2022-11-09 20:25:22 +01:00
parent 305bbe4d5e
commit 343d630245
14 changed files with 125 additions and 120 deletions

View file

@ -1,35 +1,39 @@
#
# This creates a Google wiki page for all default commands with __doc__ strings.
#
# Import this from a Django-aware shell, then call run_update.
#
#
"""
from os.path import dirname, abspath, join as pathjoin
from evennia.utils.utils import mod_import, variable_from_module, callables_from_module
Generates Components/Default-Commands.md from sources.
To test - import this from a Django-aware shell, then call run_update.
"""
from os.path import abspath, dirname
from os.path import join as pathjoin
from evennia.utils.utils import callables_from_module, mod_import, variable_from_module
__all__ = "run_update"
PAGE = """
# Default Commands
The full set of default Evennia commands currently contains {ncommands} commands in {nfiles} source
files. Our policy for adding default commands is outlined [here](Using-MUX-as-a-Standard). The
[Commands](Commands) documentation explains how Commands work as well as make new or customize
existing ones. Note that this page is auto-generated. Report problems to the [issue
tracker](github:issues).
[Commands](Commands) documentation explains how Commands work as well as how to make new or customize
existing ones.
> Note that this page is auto-generated. Report problems to the [issue tracker](github:issues).
```{{note}}
Some game-states adds their own Commands which are not listed here. Examples include editing a text
Some game-states add their own Commands which are not listed here. Examples include editing a text
with [EvEditor](EvEditor), flipping pages in [EvMore](EvMore) or using the
[Batch-Processor](Batch-Processors)'s interactive mode.
```
{alphabetical}
"""
""".strip()
def run_update(no_autodoc=False):
@ -83,13 +87,13 @@ def run_update(no_autodoc=False):
alias[1:] if alias and alias[0] == "@" else alias for alias in sorted(cmd.aliases)
]
aliases = f" [{', '.join(sorted(cmd.aliases))}]" if aliases else ""
cmdlink = f"[**{cmd.key}**{aliases}]({cmd.__module__}.{cmd.__name__})"
cmdlink = f"[**{cmd.key}**{aliases}](api:{cmd.__module__}#{cmd.__name__})"
category = f"help-category: _{cmd.help_category.capitalize()}_"
cmdset = cmd_to_cmdset_map.get(f"{cmd.__module__}.{cmd.__name__}", None)
if cmdset:
cmodule = cmdset.__module__
cname = cmdset.__class__.__name__
cmdsetlink = f"cmdset: [{cname}]({cmodule}.{cname}), "
cmdsetlink = f"cmdset: [{cname}](api:{cmodule}#{cname}), "
else:
# we skip commands not in the default cmdsets
continue