Re: [sphinx-dev] subsection on a distinct html page. Subsection turns into a section. :-/

255 views
Skip to first unread message

Bernhard Grotz

unread,
Oct 9, 2012, 2:09:21 PM10/9/12
to sphin...@googlegroups.com

Hi,

* cornelius <corneliu...@lsexperts.de> [09.10.2012 19:15]:
> Any idea how I can have subsections on distinct html pages?

I would recommend to create a new folder for the large section. In your case,
the file ``mytopic.rst`` is grown to large, so create a folder ``mytopic`` and
move the file ``mytopic.rst`` to ``mytopic/index.rst``. Don't forget to change
this path in the ``index.rst``-file of the main directory (substitute
``mytopic.rst`` with ``mytopic/index.rst`` there).

In the subdirectory ``mytopic``, you can easily take contents out of the
``index.rst``-file and put them in separate files -- for example, each
"subsection" in a new file. Create a toc-tree in the ``mytopic/index.rst``
file and just link to the appropiate files then.

You can start each file with a section header. When including it via a toc-tree,
Sphinx turns the section types to the fitting depth.

[
If you don't use a separate source-directory (question no.2 when using
sphinx-quickstart), you can even copy your ``Makefile`` and your ``_static``-
and ``_templates``-folders to create a new full-featured "sub-project" which
can be build on its own.. ;-)
]

Greetings,

Bernhard




signature.asc

cornelius

unread,
Oct 12, 2012, 10:59:30 AM10/12/12
to sphin...@googlegroups.com

Hello Bernhard,

thanks a lot finally it worked.

the file mytopc/index.rst had to look like this

======
Mytopic
======
.. toctree::
   :maxdepth: 2

   mytopc-sub1
   mytopc-sub2
   mytopc-sub3


Thanks a lot and kind regards
Cornleius




Reply all
Reply to author
Forward
0 new messages