Listing local sections first, linked pages last in TOC
<p>Let's say I have the following <code>index.rst</code>:</p>

<pre><code>Some global topic
=====================

.. toctree::
  :glob:

  nested/index

Global topic introduction
------------------------
</code></pre>

<p>And <code>nested/index.rst</code>:</p>

<pre><code>Some sub-topic
==============
</code></pre>

<p>I want TOC to be like:</p>

<ul>
<li>Some global topic

<ul>
<li>Global topic introduction</li>
<li>Some sub-topic</li>
</ul></li>
</ul>

<p>Instead, I get the following:</p>

<ul>
<li>Some global topic

<ul>
<li>Some sub-topic</li>
<li>Global topic introduction</li>
</ul></li>
</ul>

<p>How to make local sections appear first, and linked pages after them?</p>