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

LoadGlobalJavaScript embeds javascript code which crops notebook #226

Closed
aprooks opened this issue May 27, 2019 · 5 comments
Closed

LoadGlobalJavaScript embeds javascript code which crops notebook #226

aprooks opened this issue May 27, 2019 · 5 comments

Comments

@aprooks
Copy link
Contributor

aprooks commented May 27, 2019

If external js is loaded via LoadGlobalJavaScript whole Javascript get's embedded into a notebook, and then it won't be viewable via GitHub or nbviewer.

See repro in #224

@cgravill
Copy link
Member

It's a choice, you can use that approach which is convenient for self-contained notebooks but you can also insert loads from a CDN.

@aprooks
Copy link
Contributor Author

aprooks commented Jun 12, 2019

I could not make it work as self-contained anyway. Cells had to be re-run again in order for content to be rendered.

@aprooks
Copy link
Contributor Author

aprooks commented Jun 12, 2019

Also for customizations and self-containerization suggested the approach is to save .js files on disk and load from notebook instead of embedding js into the notebook itself. 9k extra Loc only for loading a dependency as in provided repro is not fun to read and diff.

@cgravill
Copy link
Member

cgravill commented Jun 12, 2019

By self-contained I mean a single file so that it can be sent to others without path issues. It's not a context I would diff - personally I prefer wiping output before committing due to the Jupyter security model which is what usually causes me to have to re-run.

LoadGlobalJavaScript is a bit of hack I wrote, but it's doing what I intended it to do. Are you proposing it do something else?

@aprooks
Copy link
Contributor Author

aprooks commented Jun 13, 2019

I'm only suggesting to try to find a workaround for LoadGlobalJavaScript which will not embed the imported library in an output cell. I'm new to Jupiter programming model and could not find a solution by myself.

@cgravill cgravill closed this as completed Oct 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants