Skip to content

Commit

Permalink
Made toctree context item a callable.
Browse files Browse the repository at this point in the history
Fixes #25.
  • Loading branch information
jrief authored and carltongibson committed Apr 4, 2023
1 parent ab8e3fa commit 6225286
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions sphinx_view/builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@ class SphinxViewBuilder(JSONHTMLBuilder):
def get_doc_context(self, docname, body, metatags):
doc = super().get_doc_context(docname, body, metatags)
self_toctree = TocTree(self.env).get_toctree_for(docname, self, True)
toctree = self.render_partial(self_toctree)['fragment']
doc['toctree'] = toctree
doc['toctree'] = lambda **kwargs: self.render_partial(self_toctree)['fragment']
return doc

0 comments on commit 6225286

Please sign in to comment.