Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Table of Content and self #4602

Open
dilyanpalauzov opened this issue Feb 12, 2018 · 4 comments
Open

Table of Content and self #4602

dilyanpalauzov opened this issue Feb 12, 2018 · 4 comments

Comments

@dilyanpalauzov
Copy link

The attached file contains in x.rst:

.. toctree::
     x

and in y.rst:

.. toctree::
    self

Sphinx 1.6.7 warns with:

preparing documents...
x.rst: WARNING: self referenced toctree found. Ignored.
done
writing output... [100%]
z
x.rst: WARNING: circular toctree references detected, ignoring: x <- x
x.rst: WARNING: circular toctree references detected, ignoring: x <- x

According to my understanding a self-reference under ..toctree:: shall not be by filename, but with the self keyword. However if you check the generated files, the menu in x.html is

  • X Ulala
    • X Hm, hm, hm
    • X Bam, bam, bam

hence referencing as wanted all elements on the current page, while the menu in z.html is:

  • Z Ulala

and the sub-sections do not appear in the TOC. Playing with :maxdepth: does not help.

The problem is, that self does not include the subsections, which works when in place of self the current file name is written.

toc-self.zip

@tk0miya
Copy link
Member

tk0miya commented Feb 13, 2018

Unfortunately, self keyword does not work from its beginning. It is a well known bug.

Please use contents directive instead
http://docutils.sourceforge.net/docs/ref/rst/directives.html#table-of-contents

@dilyanpalauzov
Copy link
Author

dilyanpalauzov commented Feb 20, 2018

Does contents allow referencing the current file and other files at the same time, so that it is used not only for rendering, but also for updating the global table of content structure?

@tk0miya
Copy link
Member

tk0miya commented Mar 20, 2018

No, there are no way to do that at this moment.

@tk0miya
Copy link
Member

tk0miya commented Mar 20, 2018

refs: #2103

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants