3

Let's say I have the following index.rst:

Some global topic
=====================

.. toctree::
  :glob:

  nested/index

Global topic introduction
------------------------

And nested/index.rst:

Some sub-topic
==============

I want TOC to be like:

  • Some global topic
    • Global topic introduction
    • Some sub-topic

Instead, I get the following:

  • Some global topic
    • Some sub-topic
    • Global topic introduction

How to make local sections appear first, and linked pages after them?

bad_coder
  • 11,289
  • 20
  • 44
  • 72
EugZol
  • 6,476
  • 22
  • 41
  • And of course, putting the `toctree` at the bottom of the page [causes this to nest under the introduction](http://stackoverflow.com/q/25276415/102441) instead... – Eric Apr 12 '17 at 18:18
  • I've made a PR concerning this, but it won't fix your case (no `:hidden:` by choice. If you want that to change, please make an argument at https://github.com/sphinx-doc/sphinx/pull/3622. – Eric Apr 12 '17 at 20:55

1 Answers1

0

It's not a perfect solution, but how about

.. contents::
   :local:

.. toctree::       
   :glob:
    nested/index

That will give you:

  • Some global topic
    • Global topic introduction
  • Some sub-topic
Sascha
  • 986
  • 10
  • 30
  • Nah, that will not look good for my documentation. My example is simplified, actually I have multi-level nesting. I think I was getting result similar to yours by just manually listing documents in some top-level page's TOC and wasn't satisfied with it. – EugZol Aug 24 '16 at 08:57