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

Open Rmd files as notebooks in Jupyter Lab #8

Closed
mwouts opened this issue Jun 28, 2018 · 10 comments
Closed

Open Rmd files as notebooks in Jupyter Lab #8

mwouts opened this issue Jun 28, 2018 · 10 comments
Assignees

Comments

@mwouts
Copy link
Owner

mwouts commented Jun 28, 2018

The RmdFileContentsManager is active in Jupyter Lab (and saves the edited notebook to the desired alternative extensions), but .Rmd files still open as text.

Cf. also jupyterlab/jupyterlab#3896

@mwouts
Copy link
Owner Author

mwouts commented Jul 18, 2018

I cannot exclude that the issue is with jupyter lab. I've provided a minimal example with the issue at jupyterlab/jupyterlab#4924

@grst
Copy link
Contributor

grst commented Aug 31, 2018

Fixed in the latest development version of jupyter.
There is now a 'Notebook' entry in the 'Open With' context menu for such notebooks.

@mwouts mwouts closed this as completed Sep 11, 2018
@mwouts
Copy link
Owner Author

mwouts commented Sep 12, 2018

Thanks @grst for your development. Is is correct that the patch will be available starting with Jupyter Lab 0.35?

People are asking on twitter how to install the dev version of JupyterLab: instructions are here, but installation may not be straightforward!

@zuxfoucault
Copy link

@grst So, it's actually on master branch now?
jupyterlab/jupyterlab#5247

@grst
Copy link
Contributor

grst commented Sep 12, 2018

I confirm this is merged into master and will be part of the next milestone release.

@abalter
Copy link

abalter commented Oct 16, 2018

I install Jupyter using conda. Jupytext works as expected using the notebook format. In the lab format jupytext creates synced files as expected, but doesn't render .md or .Rmd files as notebooks. I'm sure you already know that. The version of jupyterlab conda installs for me is 0.35.1. Pip gives me jupytext 0.8.1. Is there a way I could install the master branch with the currently working jupytext without messing up conda? I usually don't like mixing conda and non-conda except for pip.

BTW, jupytext does not seem to have a "version" flag.

(base) balter@spectre:~$ jupytext -v
usage: jupytext [-h]
                [--to {notebook,rmarkdown,markdown,python,R,julia,c++,scheme,ipynb,md,Rmd,R,py,jl,cpp,ss,md:markdown,Rmd:rmarkdown,R:spin,py:light,R:light,jl:light,cpp:light,ss:light,py:percent,R:percent
,jl:percent,cpp:percent,ss:percent,py:sphinx,py:sphinx-rst2md}]
                [--from {notebook,rmarkdown,markdown,python,R,julia,c++,scheme,ipynb,md,Rmd,R,py,jl,cpp,ss,md:markdown,Rmd:rmarkdown,R:spin,py:light,R:light,jl:light,cpp:light,ss:light,py:percent,R:perce
nt,jl:percent,cpp:percent,ss:percent,py:sphinx,py:sphinx-rst2md}]
                [-o OUTPUT] [--update] [--test]
                [notebooks [notebooks ...]]
jupytext: error: unrecognized arguments: -v
(base) balter@spectre:~$ jupytext --version
usage: jupytext [-h]
                [--to {notebook,rmarkdown,markdown,python,R,julia,c++,scheme,ipynb,md,Rmd,R,py,jl,cpp,ss,md:markdown,Rmd:rmarkdown,R:spin,py:light,R:light,jl:light,cpp:light,ss:light,py:percent,R:percent
,jl:percent,cpp:percent,ss:percent,py:sphinx,py:sphinx-rst2md}]
                [--from {notebook,rmarkdown,markdown,python,R,julia,c++,scheme,ipynb,md,Rmd,R,py,jl,cpp,ss,md:markdown,Rmd:rmarkdown,R:spin,py:light,R:light,jl:light,cpp:light,ss:light,py:percent,R:perce
nt,jl:percent,cpp:percent,ss:percent,py:sphinx,py:sphinx-rst2md}]
                [-o OUTPUT] [--update] [--test]
                [notebooks [notebooks ...]]
jupytext: error: unrecognized arguments: --version

@mwouts
Copy link
Owner Author

mwouts commented Oct 16, 2018

@abalter , as you found out this is indeed documented at #78. Opening text notebooks in Jupyter Lab requires Jupyter Lab 0.35 or later (it's good to know that Jupyter Lab 0.35.1 is out, I will update the readme!), and then a right click on the file, thanks to @grst 's contribution to Jupyter Lab:

image

mwouts added a commit that referenced this issue Oct 16, 2018
@abalter
Copy link

abalter commented Oct 17, 2018

Thanks for pointing that out! I did not pick up that that was an official part of current jupytext. The right-click method works for me (most of the time).

My preference would be something less hidden such as one of the following:

  • When opening a *md file you get a dialog asking how you want to open it.
  • A way to toggle back and forth between views with a drop down like changing kernels.

I'll take a loot at @grst's PR and see if I can figure out how to add that code.

@albham
Copy link

albham commented Dec 11, 2019

Hello. Thank you for the wonderful work on JupyText.

There is a configuration option (in configuration file for example) to open .Rmd as notebooks by default?

@mwouts
Copy link
Owner Author

mwouts commented Dec 11, 2019

Hello @albham , sorry we don't know how to do that in Jupyter Lab yet. For now you have to either use Jupyter Notebook, or to use the right-click approach. If you want to get updates on the subject, I suggest that you subscribe to #271 (that one is for .md files, but obviously when we find out how to do .md files, we'll do .Rmd files as well).

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

5 participants