Andrew schrieb:
> Hi,
>
> I was hoping to use the ifconfig to build slightly different versions
> of my documentation (for different platforms).
>
> I put the following code in my .rst file:
>
> .. ifconfig:: livecd
>
> Some Live CD specific text
>
> and then added
>
> livecd = True
>
> to the conf.py. However, because (I think) of the line "if name in
> self.values:" in "init_values" in "config.py", my 'custom' variable is
> never loaded and so I get a warning when I build: "NameError: name
> 'livecd' is not defined" . I don't want to have to add "livecd" into
> the "config_values" variable at the start of "config.py" as it's not a
> general option - it's specific to this project.
>
> Is there a reason that other variables can't be included in the
> environment used by ifconfig? Is there a better way of achieving what
> I'm trying to do (without maintaining two different sets of
> documents)?
Yes -- new config values should be made known to Sphinx via the extension
API.
Put this into your conf.py:
def setup(app):
app.add_config_value('livecd', <the default: True or False>, True)
For more, see <http://sphinx.pocoo.org/ext/appapi.html>.
cheers,
Georg
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---