mirror of
https://github.com/evennia/evennia.git
synced 2026-03-27 02:06:32 +01:00
Make auto-relinker's error message clearer
This commit is contained in:
parent
1e1766ab54
commit
c9e9ce2f54
1 changed files with 5 additions and 2 deletions
|
|
@ -6,6 +6,7 @@ directive somewhere.
|
|||
"""
|
||||
|
||||
import re
|
||||
from sphinx.errors import DocumentError
|
||||
from pathlib import Path
|
||||
from os.path import abspath, dirname, join as pathjoin, sep
|
||||
|
||||
|
|
@ -34,8 +35,10 @@ def create_toctree():
|
|||
url = url.rsplit(".", 1)[0]
|
||||
fname = fname.rsplit(".", 1)[0]
|
||||
if fname in docref_map:
|
||||
raise RuntimeError(f"'{url}' and '{docref_map[fname]}': Auto-link correction does not "
|
||||
"accept doc-files with the same name, even in different folders.")
|
||||
raise DocumentError(
|
||||
f" Tried to add '{url}.md' when '{docref_map[fname]}.md' already exists.\n"
|
||||
" Evennia's auto-link-corrector does not accept doc-files with the same \n"
|
||||
" name, even in different folders. Rename one.\n")
|
||||
docref_map[fname] = url
|
||||
|
||||
# normal reference-links [txt](urls)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue