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

Only the first cell is visible with certain files #6

Closed
improbable-22 opened this issue May 30, 2018 · 7 comments
Closed

Only the first cell is visible with certain files #6

improbable-22 opened this issue May 30, 2018 · 7 comments

Comments

@improbable-22
Copy link

I just found this program, and am having difficulty with certain notebooks. The ones I have saved myself work fine, but those produced by the Julia package Literate.jl don't seem to work.

This package turns files like example.jl into notebooks like example.ipynb. I attach an example of what I see. Only the first cell is shown by nbviewer-app, while nteract (the window behind) shows more.

I don't know which end has the problem here -- it only happens for me with this viewer and such files together. Files created directly in Jupyter work fine. And Jupyter itself works fine with these files.

screen shot 2018-05-30 at 3 59 57 pm

@tuxu
Copy link
Owner

tuxu commented May 30, 2018

Interesting... If you open the same file in Jupyter and then save it, it will correctly show also in nbviewer-app. This is actually a problem with the JSON produced from Literate.jl.. I could trace the problem to the first output cell, where nbviewer.js expects an array, but only a string literal is found (here, for example).

Should be an easy fix. I'll look into it.

@improbable-22
Copy link
Author

That I did not think to try, thanks for taking a look.

Is this something Literate.jl ought to change, to conform to standard, or more of a grey area?

@tuxu
Copy link
Owner

tuxu commented May 31, 2018

Looking through the notebook file format docs, the behavior of Literate.jl is totally fine:

If you intend to work with notebook files directly, you must allow multi-line string fields to be either a string or list of strings.

So this should be fixed in nbviewer.js, which is used by nbviewer-app to render the notebooks.

@improbable-22
Copy link
Author

OK, I've opened an issue on nbviewer.js. Thanks again for digging into this (and for the app).

@kokes
Copy link

kokes commented Jun 1, 2018

Thanks for reporting this, I think I've fixed it (and one other related thing), see #28.

@tuxu
Copy link
Owner

tuxu commented Jun 3, 2018

Thanks for fixing this, @kokes. I'll merge an updated version of nbviewer.js when #5 is addressed. I'll file a PR if you don't beat me to it 😉

@tuxu
Copy link
Owner

tuxu commented Jun 10, 2018

Fixed in 43929a7

@tuxu tuxu closed this as completed Jun 10, 2018
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