Update relativelink sphinx extension to make relative work again

This commit is contained in:
Tom Parker-Shemilt 2024-02-18 14:02:05 +00:00 committed by Aaron Molitor
parent 3862709b3f
commit e50cef8e8c
1 changed files with 3 additions and 3 deletions

View File

@ -29,10 +29,10 @@
def setup(app):
import sphinx.environment
import sphinx.environment.adapters.toctree
from docutils import nodes
old_resolve = sphinx.environment.BuildEnvironment.resolve_toctree
old_resolve = sphinx.environment.adapters.toctree.TocTree.resolve
def resolve_toctree(
self,
@ -64,4 +64,4 @@ def setup(app):
node["refuri"] = node["refuri"][len("relative://") :]
return result
sphinx.environment.BuildEnvironment.resolve_toctree = resolve_toctree
sphinx.environment.adapters.toctree.TocTree.resolve = resolve_toctree