How to create an appendix

925 views
Skip to first unread message

David King

unread,
Dec 15, 2020, 2:53:03 AM12/15/20
to sphinx-users
Beginner's question. I am helping with documentation (written under Sphinx) for a popular open source project. The current docs are scanty, and the developers haven't time or inclination to look at this.

The current docs have .rst files which all get put into a single table of contents. The
docs need a load of detailed pages, which I'd like to put in an appendix, because
otherwise they'd frighten off new users.

So currently there is, in index.rst:
Table of Contents:
------------------

.. toctree::
   :maxdepth: 2

   introduction
   topic1
    etc...

I want separate .rst files for each appendix, and I want the toc to list eg
Table of Contents

Introduction
Topic 1
etc
...
Appendix
    appendix 1 - some topic
    appemdix 2 - another topic

My interest is in writing the docs - not in learning Sphinx I'm afraid. Would anyone be
kind enough to tell me what to do to implement this? Thank you

David King

unread,
Dec 15, 2020, 2:55:09 AM12/15/20
to sphinx-users
The docs compile to html only. Thanks

Luc Saffre

unread,
Dec 15, 2020, 3:16:17 AM12/15/20
to sphinx...@googlegroups.com
David,

thanks for your work on this! May you enjoy it and learn a lot of useful things. And when you are ready, then come and help us to make our docs better ;-)

a) you can have subtiltles and several toctree directives
b) you can have different levels of pages that contain a toctree directive

a)

Main title
=======

subtitle
---------


.. toctree::
   :maxdepth: 2

appendix
-------------

.. toctree::
   :maxdepth: 2


b) file index.rst:

Main title
=======

.. toctree::

   a
   b
   appendix

And file a.rst:

First part
=======

.. toctree::

  chapter1
  chapter2

 
Luc
--
You received this message because you are subscribed to the Google Groups "sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sphinx-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sphinx-users/aab913a7-cd4c-46d1-ab40-82f4cb270bddn%40googlegroups.com.

David King

unread,
Dec 15, 2020, 12:47:37 PM12/15/20
to sphinx-users
Thank you Luc, that is very helpful. Actually a) doesn't quite work, because the theme is rtd - with a second toc in the lefthand sidebar whcih does not recognise subtitles. Doubtless with some clever tweaking it could be made to work though.

However b), while not quite what I asked for, is in fact what I need. Great result.

Thanks again, appreciated
Reply all
Reply to author
Forward
0 new messages