Update to auto relinker
This commit is contained in:
parent
117b1af304
commit
a1290cdb5e
1 changed files with 2 additions and 2 deletions
|
|
@ -24,7 +24,6 @@ def create_toctree():
|
||||||
for path in Path(_SOURCE_DIR).rglob("*.md"):
|
for path in Path(_SOURCE_DIR).rglob("*.md"):
|
||||||
# find the source/ part of the path and strip it out
|
# find the source/ part of the path and strip it out
|
||||||
# support nesting of 3 within source/ dir
|
# support nesting of 3 within source/ dir
|
||||||
# from pudb import debugger;debugger.Debugger().set_trace()
|
|
||||||
fname = path.name
|
fname = path.name
|
||||||
if fname in _IGNORE_FILES:
|
if fname in _IGNORE_FILES:
|
||||||
# this is the name including .md
|
# this is the name including .md
|
||||||
|
|
@ -32,6 +31,7 @@ def create_toctree():
|
||||||
ind = path.parts[-4:].index("source")
|
ind = path.parts[-4:].index("source")
|
||||||
pathparts = path.parts[-4 + 1 + ind:]
|
pathparts = path.parts[-4 + 1 + ind:]
|
||||||
url = "/".join(pathparts)
|
url = "/".join(pathparts)
|
||||||
|
url = url.rsplit(".", 1)[0]
|
||||||
fname = fname.rsplit(".", 1)[0]
|
fname = fname.rsplit(".", 1)[0]
|
||||||
if fname in docref_map:
|
if fname in docref_map:
|
||||||
raise RuntimeError(f"'{url}' and '{docref_map[fname]}': Auto-link correction does not "
|
raise RuntimeError(f"'{url}' and '{docref_map[fname]}': Auto-link correction does not "
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue