Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPython sphinx directive fails when promptin isn't in certain formats only for pure python #11631

Open
MatthewFlamm opened this issue Mar 6, 2019 · 0 comments

Comments

@MatthewFlamm
Copy link

MatthewFlamm commented Mar 6, 2019

I'm using Sphinx v.1.8.4 and IPython 7.2.0.

For 'regular' .. ipython:: blocks like this,

.. ipython::

   In [1]: print('hello world')

I can use any format for promptin config in my conf.py as long as it has %d in the string, see below for examples I've tried. I'm going to request the requirement for %d be removed, but this is a separate issue.
ipython_promptin = 'In [%d]:'
ipython_promptin = 'In [%d]: '
ipython_promptin = '[%d]'
ipython_promptin = '%d'

However, if I use a pure python block like this

.. ipython:: python

   print('hello world')

I can use the first two custom promptin above, but the last two fail with messages like this:

path/to/python3.6/site-packages/IPython/sphinxext/ipython_directive.py", line 1018, in run
    raise RuntimeError(message)
RuntimeError: Code input with no code at path/to/file.rst
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant