-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Am 03.07.2010 09:37, schrieb Luc Saffre: > Today I managed to upgrade my Mercurial copy of Sphinx. I had been using > an old version dated 2009-05-25. > > The upgrade took some time because I had been using the deprecated > old-style method of defining sidebars, which obviously doesn't work any > more after the upgrade (the sidebar simply disappeared). So I converted > to the new method using html_sidebars, as documented on > http://sphinx.pocoo.org/latest/config.html#confval-html_sidebars > > But still the sidebar didn't reappear. I got it back only after making a > change to sphinx\themes\basic\layout.html > > In lines 16-17 there's written: > > {%- set render_sidebar = (not embedded) and > (not theme_nosidebar|tobool) and > (not sidebars == []) %} > > (Indentation changed to avoid wrapping) > > For my tests I inserted the following fragment after line 17: > > <p> > sidebars={{ sidebars }} > <br>embedded={{ embedded }} > <br>theme_nosidebar={{ theme_nosidebar }} > <br>render_sidebar={{ render_sidebar }} > </p> > > And the rendered result was: > > sidebars=['select_lang.html', 'globaltoc.html', 'searchbox.html'] > embedded=False > theme_nosidebar=false > render_sidebar=False > > Isn't that strange? I'd expect `render_sidebar` to be `True`! > > I got the expected result by changing the condition in line 17 from > > (not sidebars == []) > > into > > (sidebars != []) > > I was puzzled because this seems to happen only to me. The explanation > is that I used a rather old Jinja2 version 2.1.1. The problem > disappeared after upgrading Jinja2 to the latest development version. > I'd guess that there was a bug in the parser of 2.1.1. > > In case you want to reproduce this problem, I add a zip file with the > relevant configuration files of my project. > > In case you want Sphinx to work also with Jinja2 2.1.1, simply change > line 17 of sphinx\themes\basic\layout.html as explained above.
Hi Luc, thanks for the report! Note that Sphinx 1.0 officially does require Jinja2 >= 2.2, as noted in setup.py and CHANGES. However, the proposed change won't hurt, so I've committed in in trunk. Thanks, Georg -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.15 (GNU/Linux) iEYEARECAAYFAkwu9QMACgkQN9GcIYhpnLBP1gCggtmkQTRLDKqM/CV9Owm+l949 pFEAn3N2WtzVRuWuT9jMewG3YIlkHJos =PzfN -----END PGP SIGNATURE----- -- You received this message because you are subscribed to the Google Groups "sphinx-dev" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sphinx-dev?hl=en.
