Custom sidebars in website

138 views
Skip to first unread message

Andreas Mueller

unread,
Mar 10, 2013, 1:15:42 PM3/10/13
to sphinx...@googlegroups.com
Hi everybody.
I'm trying to make the scikit-learn.org website a bit easier to navigate.
We usually use the standard sidebar, the content of which is generated
using the ``toc`` variable.
For pages that only contain the definition of toctrees (for example
http://scikit-learn.org/dev/user_guide.html)
the ``toc`` variable seems to be empty.

Is there a way to generate a sidebar containing all the sub-toctrees of
a page?
I know about the ``toctree()`` function, but that gives me a tree from
the main page. I'd rather like to have
a list of all the content below the current page.

I think I know how to generate such a menu in rst, but I'm not sure if
there is a way to render a rst as the sidebar.

Any help or pointers to the relevant documentation would be much
appreciated.

Cheers,
Andy

Takayuki SHIMIZUKAWA

unread,
Mar 10, 2013, 11:37:34 PM3/10/13
to sphinx...@googlegroups.com
Hi Andy,

Is there a way to generate a sidebar containing all the sub-toctrees of
a page?
I know about the ``toctree()`` function, but that gives me a tree from
the main page. I'd rather like to have
a list of all the content below the current page.
 
I think there is no way to render subtree in sidebar from the current page.

But I made a little extension, I got the behavior you expect.

Please try it and feedback is welcome.

Regards.
--
Takayuki SHIMIZUKAWA
http://about.me/shimizukawa

Kevin Horn

unread,
Mar 11, 2013, 1:44:44 PM3/11/13
to sphinx...@googlegroups.com
Very cool extension.  Any chance you might put it in the sphinx-contrib repo?

--
Kevin Horn

Andreas Mueller

unread,
Mar 13, 2013, 9:43:10 AM3/13/13
to sphinx...@googlegroups.com
Hi Takayuki.
Thanks for your reply.
That sounds good, I'll give it a try!
Cheers,
Andy
--
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 post to this group, send email to sphinx...@googlegroups.com.
Visit this group at http://groups.google.com/group/sphinx-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages