diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 17084b6fa..5209a87e5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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 @@ -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 @@ -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 @@ -70,4 +70,4 @@ pip install -r doc-requirements.txt and build the HTML documentation locally with ``` make html -``` \ No newline at end of file +``` diff --git a/HISTORY.rst b/HISTORY.rst index 610122478..4e50b37bc 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -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) ++++++++++++++++++++++ diff --git a/jupytext/nbextension/README.md b/jupytext/nbextension/README.md new file mode 100644 index 000000000..57e59f466 --- /dev/null +++ b/jupytext/nbextension/README.md @@ -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`). diff --git a/jupytext/nbextension/jupytext.yml b/jupytext/nbextension/jupytext.yml new file mode 100644 index 000000000..42128db56 --- /dev/null +++ b/jupytext/nbextension/jupytext.yml @@ -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 diff --git a/jupytext/nbextension/jupytext_menu.png b/jupytext/nbextension/jupytext_menu.png new file mode 100644 index 000000000..f43f6e89d Binary files /dev/null and b/jupytext/nbextension/jupytext_menu.png differ diff --git a/jupytext/nbextension/jupytext_menu_zoom.png b/jupytext/nbextension/jupytext_menu_zoom.png new file mode 100644 index 000000000..c9c2103b8 Binary files /dev/null and b/jupytext/nbextension/jupytext_menu_zoom.png differ diff --git a/setup.py b/setup.py index dc37a62f5..1e3fc1785 100644 --- a/setup.py +++ b/setup.py @@ -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'],