Partly solved.
 
It seems that the rst bit *has* to have a list, e.g. infconf_product in
('main','') makes it happy.
 
Also, it seems I have to declare the variable in conf.py, even though it
has a default value in ifconfig.py.

________________________________

From: sphinx-dev@googlegroups.com [mailto:sphinx-dev@googlegroups.com]
On Behalf Of Alastair Dent
Sent: 19 July 2011 16:48
To: sphinx-dev@googlegroups.com
Subject: [sphinx-dev] can't get inconfig extension working.


In ifconfig.py I have:
 
def setup(app):
    app.add_node(ifconfig)
    app.add_directive('ifconfig', IfConfig)
    app.connect('doctree-resolved', process_ifconfig_nodes)
    app.add_config_value('infconf_product', 'main', True)
 
 
In an rst file I have:
 
.. ifconfig:: infconf_product in ('main')
    
    Hello this should be included for main builds.
   
 
When I build I get the message:
Exception occurred in .... ifconfig expression:
NameError: name 'ifconfig_product' is not defined.
 
anyone spot what I have done wrong?

-- 
You received this message because you are subscribed to the Google
Groups "sphinx-dev" group.
To post to this group, send email to sphinx-dev@googlegroups.com.
To unsubscribe from this group, send email to
sphinx-dev+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/sphinx-dev?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-dev" group.
To post to this group, send email to sphinx-dev@googlegroups.com.
To unsubscribe from this group, send email to 
sphinx-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sphinx-dev?hl=en.

Reply via email to