I didn't make a test case, but we have found (with at least Sphinx 1.4.x) 
you can't always have the same file in two different tocrees go into the 
same document.  The behavior tends to be build specific.  For example if 
you included bar in both toctrees (without using :hidden:) and the first 
instance was section 3.3 you would get different results with html vs pdf:

html: bar would show up twice, but they both would be 3.3, even though the 
second instance is in the middle of section 4 or 5
pdf: The second instance would be silently dropped and not show up in the 
output at all

You may be running into something similar.

We work around this issue by creating symlinks to create 2nd instances of 
our source files so they can be included more than once if required.


On Friday, May 19, 2017 at 7:41:40 AM UTC-7, Horse Radish wrote:
>
> I have a use case where I want to use the same toctree in two different 
> contexts.  In one place I want it :hidden: (because it's just being used to 
> populate a sidebar), in another, I actually want the content visible on the 
> page.   I was hoping to do something like this:
>
>
> content.rst -       foo
>                     bar
>                     baz
>
>
> index.rst -         .. toctree::
>                        :maxdepth: 2
>                        :hidden:
>                        .. include:: ./content.rst
>
>
> otherpage.rst-         .. toctree::
>                           :maxdepth: 4
>
>                           .. include:: ./content.rst
>
> This seems not to work.  Is there a way to factor a toctree  directive 
> like this or am I forced to maintain two separate copies of the contents 
> (yuck)?
>
> Thanks
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to sphinx-users@googlegroups.com.
Visit this group at https://groups.google.com/group/sphinx-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to