mirror of
https://github.com/evennia/evennia.git
synced 2026-03-24 08:46:31 +01:00
Handle no-auto-doc builds with no api ref in docs
This commit is contained in:
parent
5a0f698ad5
commit
c09ffbc80a
2 changed files with 5 additions and 3 deletions
|
|
@ -34,7 +34,7 @@ _USED_REFS = {}
|
|||
_CURRFILE = None
|
||||
|
||||
|
||||
def auto_link_remapper():
|
||||
def auto_link_remapper(no_autodoc=False):
|
||||
"""
|
||||
- Auto-Remaps links to fit with the actual document file structure. Requires
|
||||
all doc files to have a unique name.
|
||||
|
|
@ -197,7 +197,8 @@ def auto_link_remapper():
|
|||
with open(_TOC_FILE, "w") as fil:
|
||||
fil.write("# Toc\n")
|
||||
|
||||
fil.write("- [API root](api/evennia-api.rst)")
|
||||
if not no_autodoc:
|
||||
fil.write("- [API root](api/evennia-api.rst)")
|
||||
|
||||
for ref in sorted(toc_map.values()):
|
||||
|
||||
|
|
|
|||
|
|
@ -317,7 +317,8 @@ def setup(app):
|
|||
sys.path.insert(1, os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
|
||||
from docs.pylib import auto_link_remapper
|
||||
|
||||
auto_link_remapper.auto_link_remapper()
|
||||
_no_autodoc = os.environ.get("NOAUTODOC")
|
||||
auto_link_remapper.auto_link_remapper(no_autodoc=_no_autodoc)
|
||||
print("Updated source/toc.md file")
|
||||
|
||||
# custom lunr-based search
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue