|
| 1 | +# Contributing to jupyter notebook nbextensions |
| 2 | + |
| 3 | +We are super happy that you intend to contribute to the nbextensions! You can discuss improvements in issues and implement them in pull requests. |
| 4 | + |
| 5 | +## Create an issue |
| 6 | + |
| 7 | +Do not hesitate to open up an issue, you can discuss bugs, improvements or new extensions in them. Creating an issue is a good starting point for code contributions. The community can support you with experience of similar extensions, pros and cons, what to look for etc. |
| 8 | + |
| 9 | +Here is an example issue of how @benelot did it that worked pretty smoothly: [#1193](https://github.com/ipython-contrib/jupyter_contrib_nbextensions/issues/1193) |
| 10 | + |
| 11 | +## Setup development |
| 12 | + |
| 13 | +For small things like fixing typos in documentation, you can [make edits through GitHub](https://help.github.com/articles/editing-files-in-another-user-s-repository/), which will handle forking and making a pull request (PR) for you. For anything bigger or more complex, you'll probably want to set up a development environment, a quick procedure for which is as folows: |
| 14 | + |
| 15 | +1. __Fork and clone__ |
| 16 | + First fork this repo, then clone your fork. In this way you become prepared to make a pull request. |
| 17 | + |
| 18 | + ```shell |
| 19 | + # clone your fork |
| 20 | + git clone https://github.com/<your-github-username>/jupyter_contrib_nbextensions.git |
| 21 | + cd jupyter_contrib_nbextensions |
| 22 | + ``` |
| 23 | + |
| 24 | +2. __Setup__ |
| 25 | + |
| 26 | + If you're using python in combination with some form of virtual environment (e.g. conda, virtualenv), make sure you have the correct environment (the one from which you run `jupyter notebook`) active before running these commands! |
| 27 | + |
| 28 | + ```shell |
| 29 | + # run from the main directory, where setup.py is |
| 30 | + pip install --editable . |
| 31 | + |
| 32 | + # on windows, remove the --symlink flag and re-run the command each time you make changes |
| 33 | + jupyter-contrib-nbextension install --sys-prefix --symlink |
| 34 | + ``` |
| 35 | + |
| 36 | +## Create an extension |
| 37 | + |
| 38 | +Add a folder with the name of your new extension to [jupyter_contrib_nbextensions/nbextensions](https://github.com/ipython-contrib/jupyter_contrib_nbextensions/tree/master/src/jupyter_contrib_nbextensions/nbextensions). Check out the [Jupyter Notebook extension structure link](http://jupyter-contrib-nbextensions.readthedocs.io/en/latest/internals.html) to know what has to be in that folder and what the general conventions are. |
| 39 | + |
| 40 | +## Create a pull request |
| 41 | + |
| 42 | +As you are ready with your code contribution, make a pull-request to the main repo and briefly explain what you have done. |
| 43 | + |
| 44 | +Here is an example pull request of how @benelot did it that worked super well: [#1213](https://github.com/ipython-contrib/jupyter_contrib_nbextensions/pull/1213) |
| 45 | + |
| 46 | +Please also update the [unreleased section](https://github.com/ipython-contrib/jupyter_contrib_nbextensions/blob/master/CHANGELOG.md#unreleased-aka-github-master) of the [CHANGELOG.md](https://github.com/ipython-contrib/jupyter_contrib_nbextensions/blob/master/CHANGELOG.md) to note what you've added or fixed. |
0 commit comments