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

Enhance Jupytext for JupyterLab #877

Merged
merged 7 commits into from
Nov 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions binder/labconfig/default_setting_overrides.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"@jupyterlab/docmanager-extension:plugin": {
"defaultViewers": {
"markdown": "Jupytext Notebook",
"jupytext-md": "Jupytext Notebook"
}
}
}
3 changes: 3 additions & 0 deletions binder/postBuild
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ set -e
# just add "jupytext" to your "binder/requirements.txt" instead.
BUILD_JUPYTERLAB_EXTENSION=1 pip install .[myst]

mkdir -p ${HOME}/.jupyter/labconfig
cp binder/labconfig/* ${HOME}/.jupyter/labconfig

# Create the notebook for our jupytext demo
jupytext demo/get_started.md --to ipynb --update-metadata '{"jupytext":null}'

Expand Down
19 changes: 19 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,25 @@ When Jupytext is installed, `.py` and `.md` files have a notebook icon. And you
[![](https://raw.githubusercontent.com/mwouts/jupytext-screenshots/master/JupytextDocumentation/TextNotebooks.png)](https://mybinder.org/v2/gh/mwouts/jupytext/master?filepath=demo)
(click on the image above to try this on [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/mwouts/jupytext/master?filepath=demo))
</details>
<details>
<summary>With a click on the text file in JupyterLab</summary>
To do that, you will need to change the default viewer for text files supported by Jupytext by copy-pasting the following settings in `Document Manager` section:

```json
{
"defaultViewers": {
"markdown": "Jupytext Notebook",
"jupytext-md": "Jupytext Notebook"
}
}
```


Here is a screencast of the steps to follow:

[![](https://raw.githubusercontent.com/mwouts/jupytext/main/docs/jupyterlab_default_viewer.gif)](https://mybinder.org/v2/gh/mwouts/jupytext/master?urlpath=lab/tree/demo/get_started.ipynb)
(click on the image above to try this on [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/mwouts/jupytext/master?urlpath=lab/tree/demo/get_started.ipynb))
</details>
<details>
<summary>With a right click and <i>open with notebook</i> in Jupyter Lab</summary>

Expand Down
Binary file added docs/jupyterlab_default_viewer.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion packages/labextension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,13 @@
"dependencies": {
"@jupyterlab/application": "^3.0.0",
"@jupyterlab/apputils": "^3.0.0",
"@jupyterlab/codeeditor": "^3.0.0",
"@jupyterlab/docregistry": "^3.0.0",
"@jupyterlab/nbformat": "^3.0.0",
"@jupyterlab/notebook": "^3.0.0"
"@jupyterlab/notebook": "^3.0.0",
"@jupyterlab/rendermime": "^3.0.0",
"@jupyterlab/translation": "^3.0.0",
"@jupyterlab/ui-components": "^3.0.0"
},
"devDependencies": {
"@jupyterlab/builder": "^3.0.0",
Expand Down
Loading