You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ipython Sphinx directive executes code when excluded by only, ifconfig #9339
The ipython directive for Sphinx provided by IPython.sphinxext.ipython_directive executes its code block at the parsing stage. As a result, even if an ipython directive is surrounded by an only or ifconfig directive with a false-y condition, the code block is still executed. I have posted a minimum working example for this issue that includes a Sphinx configuration file and a reStructuredText file to reproduce the problem.
Confirmed. Not surprising however, I don't think the ipython_directive was written with those use cases in mind. Haven't yet had a chance to look into how much work would be involved to fix this.
Activity
takluyver commentedon Mar 21, 2016
Ping @chebee7i and @y-p who have worked on the IPython sphinx directive.
chebee7i commentedon Mar 27, 2016
Confirmed. Not surprising however, I don't think the
ipython_directivewas written with those use cases in mind. Haven't yet had a chance to look into how much work would be involved to fix this.LucianaMarques commentedon Oct 18, 2018
Has any pull request been made on this? I'd like ti give it a try!
Fix: Skip ipython directive execution inside excluded only blocks (#1…