Get rid of WARNING: document isn't included in any toctree while using toctree with include

4,287 views
Skip to first unread message

Patryk Małek

unread,
Aug 21, 2013, 6:47:53 AM8/21/13
to sphin...@googlegroups.com
I am generating documentation with following code : 


.. _codingstandard:

C++ Coding standard
#####################

.. toctree::

.. include::  codingstandard/purpose.rst
.. include::  codingstandard/scope.rst
.. include::  codingstandard/acknowledgments.rst
.. include::  codingstandard/files.rst
.. include::  codingstandard/includedirectives.rst
.. include::  codingstandard/comments.rst
 
 and my aim here is to produce table of contents and to have the document in one web page (not to go to separate web page for each chapter). 

But this produces warning like : 

WARNING: document isn't included in any toctree

I can do something like this as well :

.. _codingstandard:

C++ Coding standard
#####################

.. toctree::

  codingstandard/purpose
  codingstandard/scope
  codingstandard/acknowledgments
  codingstandard/files
  codingstandard/includedirectives

And then I won't get warnings but I will get table of contents with each chapter in a subpage. 

How can I achieve the desired effect without the warnings ?  

Robert Lehmann

unread,
Aug 21, 2013, 8:31:57 AM8/21/13
to sphin...@googlegroups.com
I'd recommend the singlehtml builder instead (make singlehtml should work.)  If that doesn't work for you, you could have a normal version using toctree and then another page— say, codingstandard/single.rst —which just includes all other pages.


--
You received this message because you are subscribed to the Google Groups "sphinx-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sphinx-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

purnank h g

unread,
Aug 23, 2013, 2:12:51 PM8/23/13
to sphin...@googlegroups.com
Option 1: (Will have complications. But would basically work for you.)
use :orphan: as the first line in codingstandard/purpose.rst, codingstandard/scope.rst, etc.

Option 2: (Recommended)
Use .txt extension for these files. And include them as .. include:: codingstandard/purpose.txt

And as Robert suggested:
Option 3:
``make singlehtml`` with normal toctree


Joe Ward

unread,
Jan 31, 2014, 2:01:01 PM1/31/14
to sphin...@googlegroups.com
(For posterity's sake) There is also an option 4, which is to add the folder containing the included .rst files to the ``exclude_patterns`` patterns list in your Sphinx conf.py.

Jose Casas

unread,
May 20, 2014, 5:17:09 AM5/20/14
to sphin...@googlegroups.com, malek...@gmail.com
Hello,

This code works for me: 

.. toctree::
   :numbered:
   :maxdepth: 2

   MSO4054B </instrument_docs/MSO4054B.rst>
   MSO40xx </instrument_docs/MSO40xx.rst>
   TekMSO20xx </instrument_docs/TekMSO20xx.rst>
   Waverunner104MXi </instrument_docs/Waverunner104MXi.rst>
   WaverunnerHRO66Zi </instrument_docs/WaverunnerHRO66Zi.rst>
   Agilent34410A </instrument_docs/Agilent34410A.rst>


I think you want to do something similar.

Best regards,
Reply all
Reply to author
Forward
0 new messages