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 how to create a new text notebook #1095

Closed
parmentelat opened this issue Jul 3, 2023 · 8 comments · Fixed by #1154
Closed

jupyterlab how to create a new text notebook #1095

parmentelat opened this issue Jul 3, 2023 · 8 comments · Fixed by #1154

Comments

@parmentelat
Copy link
Contributor

in nbclassic we used to have a menu for creating a new text notebook
image

I can't seem to find the equivalent under jlab
was it dropped on purpose or is it just lack of time, i.e. value/devel time ratio deemed too poor ?

it would be very helpful for students, as we're trying to have them use git for everything, and ipynb under git really does not cut it :)

@mwouts
Copy link
Owner

mwouts commented Jul 3, 2023

Hey @parmentelat , yea it's just lack of time / typescript skills. I agree that the "New text notebook" entry was useful. Also I find that accessing the pairing commands through a menu was a bit more user friendly, but I never found the time to map the commands in the menu, although I believe that this should be possible.

@parmentelat
Copy link
Contributor Author

would you agree that as a first step, a palette-accessible command to create a new text notebook would make sense ?
or more likely one command per format, I guess ?

@mwouts
Copy link
Owner

mwouts commented Jul 28, 2023

Hey @parmentelat , yes indeed!

I think it would be useful to have a commands to create at least notebooks in these formats:

  • py:percent (or maybe a percent notebook for the language used in the current notebook)
  • md:MyST

FYI in the notebook extension the menu commands were added here:
https://github.com/mwouts/jupytext/blob/main/jupytext/nbextension/index.js#L376-L383

@parmentelat
Copy link
Contributor Author

parmentelat commented Jul 29, 2023

hi @mwouts

I still think this is a helpful feature, but I had to put this on the backburner

However maybe we can start discussing how the feature could look like
in my opinion the most natural point where to add this would be here, which conveniently is valid for both lab and nb7 (even in the tree view btw)

image

(and at this location we could find a submenu with one entry per text format, like New Py:percent, etc..)

one difference with nb classic though, is that here and esp. in the context of lab, there is no 'current notebook' so the path where the new notebook is created might raise new questions; the simple approach could be to always create it at the server root, and let people move that about using the file explorer; otherwise the feature may need some sort of directory browser.. but I'm not there yet - and far from it ;)

anyways, I have taken a look at the nbextension code that you pointed at; it looks like the crux of it is actually the new_text_notebook function https://github.com/mwouts/jupytext/blob/main/jupytext/nbextension/index.js#L237-L267
but so far I fail to see how that actually works, plus I suspect many changes are going to be needed for jlab.

fyi I'm entering a rather low period for the next few weeks, so as far as I am concerned it's probably not going to happen anytime soon ;-)

@mwouts
Copy link
Owner

mwouts commented Aug 6, 2023

Hey @parmentelat , thank you for discussing this! Yes sure not problem at all, this would be useful indeed but there is no hurry, it will happen when we can make it happen.

Yes it would be great to have one or two entries there (maybe just for MyST Markdown and py:percent?).

Personally I mostly use the 'launcher' to create a new notebook, so maybe there we could have two entries 'New percent notebook' and 'New MyST Markdown notebook', with the list of available kernels below?
launcher

In the case of the percent notebook, the extension would be chosen depending on the kernel indicated by the selected icon in the launcher.

@mahendrapaipuri
Copy link
Contributor

I am moving this discussion here for better trackability.

@parmentelat Did you have any time to work on it? I think this would be a valuable feature for jupytext. I can see multiple points where we can add jupytext commands:

  • Main menu when user wants to create new text notebooks as @parmentelat pointed out
  • Launcher icons (only for JupyterLab) @mwouts pointed out
  • We can add pairing commands to notebook tool bar as well.

lab-toolbar

As you can see there is a lot of space there and we can add all the pairing commands there for better UX.

I can work on these features, maybe implementing them separately for better discussion and review. What do you think?

@parmentelat
Copy link
Contributor Author

Hi @mahendrapaipuri

thank you so much for raising this again;
actually I have not had time to address this at all, so please feel free to go ahead !

as far as I am concerned, I have no preference between all the methods proposed
going from the current situation (no simple way to create a text notebook) to a situation where we would have one - any, really - way to do it simply, would have immense value in the classroom where newbie students are currently at a loss to do this :)

@mahendrapaipuri
Copy link
Contributor

Ok, I will try it out and keep you posted.

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 a pull request may close this issue.

3 participants