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

JupyterLab extension #217

Merged
merged 11 commits into from
Jun 12, 2019
Merged

Conversation

jtpio
Copy link
Member

@jtpio jtpio commented Jun 11, 2019

Fixes #39.

Replaces #40 (keeps Maarten's commit).

Add a JupyterLab extension to render a notebook with voila.

TODO

  • Bootstrap the extension
  • Add a command to the command palette, view menu and notebook toolbar
  • Expose two commands: view in a JupyterLab panel (IFrame) and open in a new browser tab, using the server extension endpoint
  • Show the notebook name in the preview tab
  • Use optional instead of requires for dependencies
  • Use voila icon for the toolbar button and the preview title
  • Prettier git commit hook
  • Render voila preview on save
  • Handle current JupyterLab theme in the voila preview (dark / light)
  • Add dev setup to CONTRIBUTING.md

jupyterlab-extension

@jtpio jtpio changed the title WIP: Jupyterlab extension WIP: JupyterLab extension Jun 11, 2019
@jtpio jtpio mentioned this pull request Jun 11, 2019
@SylvainCorlay
Copy link
Member

Thanks!

Do you think it would make sense to have the package currently in js also in packages?

@jtpio
Copy link
Member Author

jtpio commented Jun 11, 2019

Grouping the two together sounds like a good idea, even though one is for the voila frontend (js) and the other one is for the JLab extension (packages/jupyterlab-voila).

Another option would be to bring the jupyterlab-voila folder one level up next to js.

@SylvainCorlay
Copy link
Member

SylvainCorlay commented Jun 11, 2019

Yep, for the the js package naming (under packages or elsewhere), I don't know if there is a pattern we should use.

@jtpio
Copy link
Member Author

jtpio commented Jun 11, 2019

And the name packages is mostly for lerna projects, so we can rename it to something else.

Follow the same style and workflow as used in the main JupyterLab repo.
@wolfv
Copy link
Member

wolfv commented Jun 12, 2019

just a nitpick but i think a monochrome icon would look better in that icon bar.

@jtpio
Copy link
Member Author

jtpio commented Jun 12, 2019

It would fit with the other existing icons yes.

Another option is to use the full text [voilà] icon in monochrome.

@jtpio
Copy link
Member Author

jtpio commented Jun 12, 2019

Re-rendering the preview on save:

jlab-render-save

I think the main problem with this feature will be the number of kernels being started every time the notebook is saved (could be an opt-in option instead)

@jtpio jtpio changed the title WIP: JupyterLab extension JupyterLab extension Jun 12, 2019
@SylvainCorlay SylvainCorlay merged commit b85e1e3 into voila-dashboards:master Jun 12, 2019
@jtpio
Copy link
Member Author

jtpio commented Jun 12, 2019

We merged this one early so we can iterate on the remaining points in follow-up PRs.

@jtpio jtpio deleted the jupyterlab-extension branch June 12, 2019 13:16
@jtpio
Copy link
Member Author

jtpio commented Jun 12, 2019

Release coming soon!

SylvainCorlay added a commit that referenced this pull request Jun 12, 2019
@wolfv
Copy link
Member

wolfv commented Jun 17, 2019

adding instruction on how to dev-install it in the readme would be nice (for people like me)

@jtpio
Copy link
Member Author

jtpio commented Jun 17, 2019

There are some instructions in the contributing guide: https://github.com/QuantStack/voila/blob/master/CONTRIBUTING.md#jupyterlab-extension

@wolfv
Copy link
Member

wolfv commented Jun 17, 2019

Nice! didn't see it, sorry.

@jtpio
Copy link
Member Author

jtpio commented Jun 17, 2019

No problem!

@Magnus512
Copy link

Magnus512 commented Jul 20, 2019

Hi this is a great great job I have one question... Can we save the formated output in PDF file or something like that, if we are not working with interactive widgets ?, Is this even possible ? It would be really usefull just to print the text and results of the notebook and not the code within, it would be amazing for academical works I think

@jtpio
Copy link
Member Author

jtpio commented Jul 23, 2019

@Magnus512 one way to do it for now could be to use the "Open with Voila in New Browser Tab" command, and then use the web browser to print to PDF?

image

@Magnus512
Copy link

@Magnus512 one way to do it for now could be to use the "Open with Voila in New Browser Tab" command, and then use the web browser to print to PDF?

image

I know this, I was thinking in something more ammm "Beautiful", in order to get a final document for presentation, anyway thanks for your reply :)

@jtpio
Copy link
Member Author

jtpio commented Jul 24, 2019

As a side note, JupyterLab 1.0 added a "Print" entry in the File Menu which can be used to print notebooks in a nice way.

image

Maybe we could add a similar functionality to the voila preview toolbar.

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

Successfully merging this pull request may close these issues.

JupyterLab extension
5 participants