Skip to content

Commit

Permalink
Jupytext menu made compatible with jupyter_nbextensions_configurator
Browse files Browse the repository at this point in the history
Fixes #178
  • Loading branch information
mwouts committed Jun 13, 2019
1 parent 9d4057e commit 198e749
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 6 deletions.
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Contributing to Jupytext

Thanks for reading this! Contributions to this project are welcome.
There are many ways you can contribute...
Thanks for reading this. Contributions to this project are welcome.
And there are many ways you can contribute...

## Spread the word

Expand All @@ -12,7 +12,7 @@ By the way, we're also interested to know how you use Jupytext! There may well b

## Improve the documentation

You think the documentation could be improved? You've spotted a typo, or you think you can rephrase a paragraph to make is easier to follow? Please follow the _Edit on Github_ link, edit the document, and submit a pull request!
You think the documentation could be improved? You've spotted a typo, or you think you can rephrase a paragraph to make is easier to follow? Please follow the _Edit on Github_ link, edit the document, and submit a pull request.

## Report an issue

Expand Down Expand Up @@ -53,7 +53,7 @@ pip install dist/jupytext-XXX.tar.gz

## Jupytext's extension for Jupyter Notebook

Our extension for Jupyter Notebook adds a Jupytext entry to Jupyter Notebook. The code is found at `jupytext/nbextension/index.js`. Instructions to develop that extension are found [here](https://github.com/mwouts/jupytext_nbextension).
Our extension for Jupyter Notebook adds a Jupytext entry to Jupyter Notebook Menu. The code is found at `jupytext/nbextension/index.js`. Instructions to develop that extension are at `jupytext/nbextension/README.md`.

## Jupytext's extension for JupyterLab

Expand All @@ -70,4 +70,4 @@ pip install -r doc-requirements.txt
and build the HTML documentation locally with
```
make html
```
```
4 changes: 4 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ Release History
- Added support for Scala notebook, by Tobias Frischholz (#253)
- Markdown and R Markdown representations are now tested on all languages

**BugFixes**

- The Jupytext Menu in Jupyter Notebook is now compatible with ``jupyter_nbextensions_configurator`` (#178)


1.1.6 (2019-06-11)
++++++++++++++++++++++
Expand Down
30 changes: 30 additions & 0 deletions jupytext/nbextension/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# A Jupyter notebook extension for Jupytext

This extension adds a [Jupytext](https://github.com/mwouts/jupytext/blob/master/README.md) menu to Jupyter notebook. Use the menu to select the desired ipynb/text pairing for your notebook.

![Jupytext menu screenshot](jupytext_menu.png)

## Installation

The extension requires [Jupytext](https://github.com/mwouts/jupytext/blob/master/README.md). Please make sure that Jupytext is installed on you system, and that its contents manager is active, i.e. that Markdown files and scripts are displayed with a notebook icon.

Installing Jupytext activates the Jupytext Menu by default. If you want to install and activate it manually, use the following commands:

```bash
jupyter nbextension install --py jupytext
jupyter nbextension enable --py jupytext
```

Add `--user` to these commands if you want to activate the extension only for the current user.

## How to develop this extension

If you wish to develop this extension, install the javascript file locally with:

```bash
cd jupytext/nbextension
jupyter nbextension install index.js --symlink --user
jupyter nbextension enable jupytext --user
```

Then, make the desired changes to `index.js` and reload the extension by simply refreshing the notebook (Ctrl+R). In case your OS does not allow symlinks, edit the copy of `index.js` that is actually used by Jupyter (refer to the output of `jupyter nbextension install --user index.js`).
12 changes: 12 additions & 0 deletions jupytext/nbextension/jupytext.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Type: Jupyter Notebook Extension
Name: Jupytext
Section: notebook
Description: Jupytext Menu
tags:
- version control
- markdown
- script
Link: README.md
Icon: jupytext_menu_zoom.png
Main: index.js
Compatibility: 5.x
Binary file added jupytext/nbextension/jupytext_menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added jupytext/nbextension/jupytext_menu_zoom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@
package_data={'jupytext': ['nbextension/*.*']},
data_files=[('etc/jupyter/nbconfig/notebook.d', ['jupyter-config/nbconfig/notebook.d/jupytext.json']),
('etc/jupyter/jupyter_notebook_config.d', ['jupyter-config/jupyter_notebook_config.d/jupytext.json']),
('share/jupyter/nbextensions/jupytext', ['jupytext/nbextension/index.js']),
('share/jupyter/nbextensions/jupytext', ['jupytext/nbextension/index.js',
'jupytext/nbextension/README.md',
'jupytext/nbextension/jupytext_menu.png',
'jupytext/nbextension/jupytext.yml']),
('share/jupyter/lab/extensions', ['packages/labextension/dist/jupyterlab-jupytext-0.1.0.tgz'])],
entry_points={'console_scripts': ['jupytext = jupytext.cli:jupytext_cli']},
tests_require=['pytest'],
Expand Down

0 comments on commit 198e749

Please sign in to comment.