Am 02.01.2010 12:53, schrieb Tarek Ziadé: > On Sat, Jan 2, 2010 at 8:44 AM, Georg Brandl <[email protected]> wrote: >> Am 01.01.2010 16:48, schrieb Tarek Ziadé: >>> Hi, >>> >>> I was trying to add an sidebar in *all* pages, using html_sidebars. >>> I ended up adding in conf.py a loop that lists all files in my Sphinx >>> source directory, to generate a dict for html_sidebars. >>> >>> Is there a simpler way to do this ? if not I would like to suggest >>> adding a glob-style pattern in html_sidebars, so one may >>> configure it like this: >>> >>> html_sidebars = {'*': 'my_sidebar.html'} -> the side bar will be >>> added in all pages >>> >>> html_sidebars = {'foo*': 'my_sidebar.html'} -> the side bar will be >>> added in all pages that starts with foo >> >> You're not the first to bring this up -- looks like there is really >> use for it... >> >> What would you propose for the case of multiple matching entries? > > I see two options, I am not 100% sure about the logic behind side bars: > > 1/ If one page matches two sidebars, I would append them both in that page. > But in that case, I would also allow the values in the dict to be > lists, since several sidebars > would be allowed per page. > > 2/ if there should be only one bar per page, I'd display a warning and > keep the last match. > > I am in favor of 1/ because it gives more flexibility and I can't see > any caveats
I do -- the order in which the sidebars are appended is unspecified in the case of multiple matches, since html_sidebars is a dictionary. So for the moment, I propose 2/, but allowing values to be lists. Georg
signature.asc
Description: OpenPGP digital signature
