Handle no-auto-doc builds with no api ref in docs

This commit is contained in:
Griatch 2020-10-13 23:08:21 +02:00
parent 5a0f698ad5
commit c09ffbc80a
2 changed files with 5 additions and 3 deletions

View file

@ -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()):

View file

@ -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