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_directive.py fails on multiline when prompt number < 100 #2995

Closed
bchareyre opened this issue Mar 4, 2013 · 4 comments
Closed

ipython_directive.py fails on multiline when prompt number < 100 #2995

bchareyre opened this issue Mar 4, 2013 · 4 comments
Milestone

Comments

@bchareyre
Copy link

with ipython 0.13.1, the sphinx extension process multiline input differently depending on the prompt number typed in the rst files.

It can be reproduced with the ipython_directive.txt of ipython's documentation, playing with line 138.

The original:

   In [109]: for i in range(10):
      .....:     print i
      .....:
      .....:

The output:

In [2]: for i in range(10):
   ...:      print i
   ...: 
   ...: 
0
1
2
3
4
5
6
7
8
9

Modified:

   In [11]: for i in range(10):
      .....:     print i
      .....:
      .....:

Output:

In [2]: for i in range(10):

NB: Edited by @bfroehle to add code blocks for clarity.

@bfroehle
Copy link
Contributor

bfroehle commented Mar 4, 2013

Looks like you have an extra . in each of the continuation rows. Remove the extra . and it should work fine.

@bchareyre
Copy link
Author

You are right bfroehle, thanks!
Actually, it was processed whatever the number of dots in IPython<=0.12. Then big parts of our directives stopped working with 0.13 because we never noticed the mismatch.
Plain copy/paste from prompt will probably avoid this problem, but it when the directive is edited there is a chance to miss the trick.

@bfroehle
Copy link
Contributor

bfroehle commented Mar 4, 2013

Well it'd be nice if either the system was a bit more flexible in the
formatting of continuation lines, or, preferably, raised some sort of
syntax error.

On Mon, Mar 4, 2013 at 1:42 PM, Bruno Chareyre notifications@github.comwrote:

You are right bfroehle, thanks!
Actually, it was processed whatever the number of dots in IPython<=0.12.
Then big parts of our directives stopped working with 0.13 because we never
noticed the mismatch.
Plain copy/paste from prompt will probably avoid this problem, but it when
the directive is edited there is a chance to miss the trick.


Reply to this email directly or view it on GitHubhttps://github.com//issues/2995#issuecomment-14407513
.

@bchareyre
Copy link
Author

I closed the issue but I agree, it could be improved.
Another problem is that the continuation string is no longer customizable, which imposes 3 spaces + N dots for everyone (we have 5 spaces in yade's prompt). Not sure it is worth opening an issue though.

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

2 participants