Is it possible to suppress "document isn't included in any toctree" warnings?

885 views
Skip to first unread message

Libor Jelínek

unread,
May 16, 2019, 2:04:37 PM5/16/19
to sphinx-users
Ideally for specified documents only.

Closest is "suppress_warnings" setting but it doesn't what I ask.

Thanks
Libor

Gert van Dijk

unread,
May 16, 2019, 2:23:31 PM5/16/19
to sphinx...@googlegroups.com
On Thu, May 16, 2019 at 8:04 PM Libor Jelínek <ljel...@virtage.com> wrote:
Ideally for specified documents only.

Closest is "suppress_warnings" setting but it doesn't what I ask.

Looking at the code, it skips the warning if the document is marked as 'orphan', which appears to be marked as such with a directive like this at the top of the RST file:

:orphan:

Tried it out and seems to work for me. :-)


HTH

Stefano David

unread,
May 20, 2019, 5:04:20 AM5/20/19
to sphinx-users
Hi,
This seems not to work (as I would expect) if the "orphaned" foo.rst file is included in bar.rst file. In this case, while it suppresses the "not included" warning, it emits a warning about duplicated labels (which are written in the foo.rst file).
An alternative solution would be to put foo.rst (with path) in the exclude_patterns list of conf.py.

My 2 cents,
Stefano



HTH

Paul Everitt

unread,
Jul 1, 2019, 1:24:46 PM7/1/19
to sphinx-users
You can make a second toctree marked as hidden and put your orphans in there.
Reply all
Reply to author
Forward
0 new messages