I'm working on a Domain extension that has its own specialized Index: I'm
starting with someone else's code, not building from scratch, and I've
reached a bit of an impasse.
I'd /like/ to be able to put a dictionary configuration variable into
conf.py like this:
MyExt_dict_var = { "One" : "1", "Two" : "2" }
And then get access to that dictionary /inside/ my Index class's generate()
method.
In my Domain module's setup function, I do have this:
app.add_config_value('MyExt_dict_var', {}, False)
And inside my MyDomain class, I do have:
indices = [MyIndex]
>From looking at the source for the Python domain, and it's
PythonModuleIndex's generate method, it seems that I /should/ be able to
gain access to the Domain owning the Index, now, and do this:
self.domain.env.config['MyExt_dict_var'] and get back the dictionary.
But I get an error saying "No such config value: MyExt_dict_var".
Please can someone tell me how to get access to the building environment
properly from within an Index? I can't quite figure out how the Python
domain constructs its "self.domain.env.config" set of attributes, and I
don't get passed the same thing in MyDomain just by inheriting from the
Domain class (and then this reference being passed on to the instantiated
MyIndex)?
Thanks!
--
You received this message because you are subscribed to the Google Groups
"sphinx-dev" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/sphinx-dev/-/eV0xKmRRsHoJ.
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.