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

Text wrapping causes misinterpretation #15

Open
AllenDowney opened this issue Jan 24, 2021 · 3 comments
Open

Text wrapping causes misinterpretation #15

AllenDowney opened this issue Jan 24, 2021 · 3 comments

Comments

@AllenDowney
Copy link
Contributor

AllenDowney commented Jan 24, 2021

In the source notebook I have the following bullet item:

* The host, Monty Hall, shows you three closed doors numbered 1, 2, and 3. He tells you that there is a prize behind each door.

After fastdoc converts to asciidoc, it looks like this:

* The host, Monty Hall, shows you three closed doors numbered 1, 2, and
3. He tells you that there is a prize behind each door.

Because the second line begins with 3. , it gets interpreted as a numbered list item.

Is text wrapping necessary? Can it be turned off?

Or should I edit the text so the line break falls in a different place :)

Thanks!

@maxpumperla
Copy link

@AllenDowney, I think you can adapt this line (in the corresponding jupyter notebook generating this script):

https://github.com/fastai/fastdoc/blob/master/fastdoc/asciidoc.py#L162

to either output['text'] = '\\n'.join(lines) or output['text'] = '+\n'.join(lines), since I believe asciidoctor supports both + and the probably better \ for line continuations. I'm not sure why the wrapping functionality is there in the first place, since most good editors soft-wrap lines, but maybe @jph00 can speak to that (hi! btw).

In any case, you can either remove the wrapping functionality altogether locally, or use my fix above (untested). I can also create a PR for this if it works for you.

@AllenDowney
Copy link
Contributor Author

@maxpumperla Thanks very much!

@jph00
Copy link
Member

jph00 commented Aug 25, 2021

@maxpumperla I believe that wrapping is just for cell outputs. Without it, plain text outputs will go off the right-hand edge of the page if they're long.

It would be helpful if one of you could show a reproducible example that I could look at.

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

3 participants