Skip to content

Commit 61d0751

Browse files
amotlbmunkholm
andauthored
LinkTree: Fix TocTree import
Co-authored-by: Brian Munkholm <brian.munkholm@crate.io>
1 parent 756cedd commit 61d0751

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

sphinx_design_elements/lib/linktree.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@
55
from sphinx import addnodes
66
from sphinx.builders import Builder
77
from sphinx.builders.html import StandaloneHTMLBuilder
8-
from sphinx.environment import TocTree
8+
try:
9+
# Sphinx 8.x+
10+
from sphinx.environment.adapters.toctree import TocTree
11+
except ImportError:
12+
# Sphinx 7.x and earlier
13+
from sphinx.environment import TocTree
914
from sphinx.errors import SphinxError
1015
from sphinx.ext.intersphinx import resolve_reference_detect_inventory
1116
from sphinx.util import logging

0 commit comments

Comments
 (0)