mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-05 23:13:42 +02:00
Fix sphinx get_toc_tree deprecation
This commit is contained in:
parent
bd9de17f37
commit
b5dff9ba89
1 changed files with 3 additions and 1 deletions
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
from docutils import nodes
|
||||
from itertools import count
|
||||
from sphinx.environment.adapters.toctree import TocTree
|
||||
|
||||
id_counter = count()
|
||||
ID = 'sidebar-collapsible-toc'
|
||||
|
|
@ -69,7 +70,8 @@ def modify_li(li):
|
|||
|
||||
|
||||
def create_toc(app, pagename):
|
||||
toctree = app.env.get_toc_for(pagename, app.builder)
|
||||
tt = TocTree(app.env)
|
||||
toctree = tt.get_toc_for(pagename, app.builder)
|
||||
if toctree is not None:
|
||||
subtree = toctree[toctree.first_child_matching_class(nodes.list_item)]
|
||||
bl = subtree.first_child_matching_class(nodes.bullet_list)
|
||||
|
|
|
|||
Loading…
Reference in a new issue