Recent Sphinx changes cause unexpected results

36 views
Skip to first unread message

Vinay Sajip

unread,
Apr 6, 2019, 2:19:33 AM4/6/19
to sphinx-users
Not sure if this has come up before, but ...

I was using Sphinx 1.5 on a documentation set, with a custom theme (based on an existing theme called Guzzle). All was well until I recently upgraded Sphinx to 2.0. After that, the documentation doesn't look as expected any more. Two problems are immediately apparent:

The global TOC doesn't show any more on the landing page (index.html), which instead appears to be showing a local TOC. This is indicated by the following screenshot. The left-hand side shows how it was, and the right-hand side shows the new (wrong) appearance.

ss1.png



On other pages, the global TOC does show. However, the CSS classes used appear to have changed, so the custom CSS in the theme doesn't have the intended effect. This is indicated in the following screenshot. Again, the left-hand side shows how it was, and the right-hand side shows the new (wrong) appearance.

ss2.png



After a bit of back-and-forth, it appears that the breaking change happened in 1.7 - the documentation builds as expected with Sphinx 1.6.7. However, I don't see anything in the change log which describes this breaking change.

Before Sphinx 1.7, the <li> elements in the rendered toctree had classes like 'toctree-l1', 'toctree-l2' etc. which allowed styling the different levels individually. These classes appear not to be present in the toctree rendering for Sphinx >= 1.7.

Is there any way I can get these classes and the old globaltoc behaviour back - e.g. by changing the configuration? In the above examples, only the Sphinx version was changed - everything else was left the same.

Regards,

Vinay Sajip

Komiya Takeshi

unread,
Apr 7, 2019, 5:32:48 AM4/7/19
to sphinx...@googlegroups.com
Hi,

Let's take a look step by step. At first, could you share the source of document please? I'd like to check the document directly.
Especially, I'd like to know the value of `html_sidebars` config.
Since v1.7, string value for `html_sidebars` is deprecated. It might be related with this case.

Thanks,
Takeshi KOMIYA

2019年4月6日(土) 15:19 'Vinay Sajip' via sphinx-users <sphinx...@googlegroups.com>:
--
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 https://groups.google.com/group/sphinx-users.
For more options, visit https://groups.google.com/d/optout.

Vinay Sajip

unread,
Apr 7, 2019, 8:03:02 AM4/7/19
to sphinx-users



Hi,

I found the problem today - it was indeed the sidebars setting. I cured it by setting sidebars= in the theme.conf. It wasn't there in theme.conf before, so perhaps it was picking up the sidebars from the inherited theme (classic).

Thanks for the pointer!

Regards,

Vinay Sajip
To unsubscribe from this group and stop receiving emails from it, send an email to sphinx...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages