ryan-roemer / sphinx-bootstrap-theme

Sphinx Bootstrap Theme
http://ryan-roemer.github.io/sphinx-bootstrap-theme/README.html
MIT License
586 stars 206 forks source link

Unlimited depth sidebar #135

Open sonictk opened 9 years ago

sonictk commented 9 years ago

Hi all:

I'm trying to look for other themes for Sphinx other than readthedocs, and came across this repo. I'm trying to make a sidebar with a global depth (i.e. like readthedocs theme where I can access every level of the documentation through the sidebar), but I'm running into issues where the sidebar doesn't show the nested sub-levels.

In my conf.py, I have the following:

html_sidebars = {'**': ['custom_sidebar.html', 'searchbox.html']}

And the custom_sidebar.htmlbasically contains:

<ul class="globaltoc">{{ toctree(maxdepth=theme_globaltoc_depth|toint, collapse=False,includehidden=theme_globaltoc_includehidden|tobool) }}</ul>

My documentation structure is split across several index files, like so:

root │ about.rst │ conf.py │ faq.rst │ glossary.rst │ index.rst │ ├───guide │ │ index.rst │ │ │ ├───guide_2d │ │ concept.rst │ │ index.rst │ │ │ ├───guide_3d │ │ animation.rst │ │ index.rst │ │ modeling.rst │ │ texturing.rst │ │ │ ├───guide_ui │ │ index.rst │ │ │ └───pipeline │ index.rst │ overview.rst │ processes.rst │ ├───_resources │ └───images │ ├───_static ├───_templates │ custom_sidebar.html │ └───_themes

Is it possible to get the sidebar to list out all items instead of just the guide?

Thanks!

ryan-roemer commented 9 years ago

Hi @sonictk !

Is this your issue? https://github.com/ryan-roemer/sphinx-bootstrap-theme/issues/88

Or, can you point me to an online demo + source code and explain what you'd like to see happen?

sonictk commented 9 years ago

Hi @ryan-roemer:

I'm not quite sure it is...so basically, when I build on readthedocs theme, I get this as my sidebar:

If I use a sphinx bootstrap theme, I get this:

The sidebar doesn't seem to have the ability to have the same depth level as the readthedocs theme. It only works for everything being in the same reST file and seperated by sections, but not if I start using multiple index files with multiple table of contents directives.

Is there any way to emulate the readthedocs theme behaviour for the sidebar and drop-down menus?

ryan-roemer commented 9 years ago

Is there any way to emulate the readthedocs theme behaviour for the sidebar and drop-down menus?

For the sidebar, our example does have nesting display capabilities, but I don't believe that it's hooked up to a sophisticated JS drilldown -- you can look at https://github.com/ryan-roemer/sphinx-bootstrap-theme/blob/master/demo/source/conf.py#L191-L193 and perhaps play with that?

For navbar drop-down menus, there are no longer nested menus because Bootstrap 3 explicitly dropped nested menus. See https://github.com/ryan-roemer/sphinx-bootstrap-theme/issues/88