Closed jambonrose closed 7 years ago
I was having the same problem on ReadTheDocs and it seems to be solved by commenting out the "make_toctree" function inside the "html_page_context" function. In my build make_toctree was not being called, so I took a chance and tried commenting it out. That seems to work.
My "fix" is shown below
def html_page_context(app, pagename, templatename, context, doctree):
"""Event handler for the html-page-context signal.
Modifies the context directly.
- Replaces the 'toc' value created by the HTML builder with one
that shows all document titles and the local table of contents.
- Sets display_toc to True so the table of contents is always
displayed, even on empty pages.
- Replaces the 'toctree' function with one that uses the entire
document structure, ignores the maxdepth argument, and uses
only prune and collapse.
"""
rendered_toc = get_rendered_toctree(app.builder, pagename)
context['toc'] = rendered_toc
context['display_toc'] = True # force toctree to display
#def make_toctree(collapse=True):
# result = get_rendered_toctree(app.builder,
# pagename,
# prune=False,
# collapse=collapse,
# )
# #sys.__stderr__.write( 'From make_toctree, result =' + repr(result) )
# return result
#context['toctree'] = make_toctree
@dhellmann Do you have a recommendation for how to solve this problem? It appears to me that fulltoc is incompatible with sphinx json support, which is required for RTD. Furthermore, according to @ericholscher in https://github.com/rtfd/readthedocs.org/issues/1676, RTD now fails builds when json fails. Commenting out context['toctree'] = make_toctree
and does not seem to affect my docs, which makes me wonder whether it's used at all.
@reece I believe the recommendation at this point is to use the RTD template, whichprovides the same behavior as the fulltoc project.
https://read-the-docs.readthedocs.org/en/latest/theme.html https://github.com/snide/sphinx_rtd_theme
@jambonrose Thanks... and drat... I'd like to not have to change themes.
I've added a pull request which (I think) fixes this issue. Please let me know if anyone finds glitches in the approach I used. (PR #11)
This was fixed in PR #11, hope to release soon.
I'm running into problems when building documentation on Read the Docs. The command being used is:
This results in an error that states that:
The full output:
I am running Python 3.4 on Mac OS 10.10 (Yosemite). My current Sphinx extensions are:
Removing
sphinxcontrib.fulltoc
removes the problem.