@@ -15,33 +15,69 @@ You can install using `pip`:
1515pip install ipymidicontrols
1616```
1717
18- Or if you use jupyterlab:
18+ If you are using Jupyter Notebook 5.2 or earlier, you may also need to enable
19+ the nbextension:
20+ ``` bash
21+ jupyter nbextension enable --py [--sys-prefix| --user| --system] ipymidicontrols
22+ ```
23+
24+ ## Development Installation
1925
26+ Create a dev environment:
2027``` bash
21- pip install ipymidicontrols
22- jupyter labextension install @jupyter-widgets/jupyterlab-manager
28+ conda create -n ipymidicontrols-dev -c conda-forge nodejs yarn python jupyterlab
29+ conda activate ipymidicontrols-dev
2330```
2431
25- If you are using Jupyter Notebook 5.2 or earlier, you may also need to enable
26- the nbextension:
32+ Install the python. This will also build the TS package.
2733``` bash
28- jupyter nbextension enable --py [--sys-prefix | --user | --system] ipymidicontrols
34+ pip install -e " .[test, examples] "
2935```
3036
31- ## Usage
37+ When developing your extensions, you need to manually enable your extensions with the
38+ notebook / lab frontend. For lab, this is done by the command:
3239
33- Create a controller widget for a [ Behringer XTouch Mini] ( https://www.musictribe.com/Categories/Behringer/Computer-Audio/Desktop-Controllers/X-TOUCH-MINI/p/P0B3M ) :
40+ ```
41+ jupyter labextension develop --overwrite .
42+ yarn run build
43+ ```
3444
35- ``` python
36- from ipymidicontrols import XTouchMini
37- x = XTouchMini()
45+ For classic notebook, you need to run:
46+
47+ ```
48+ jupyter nbextension install --sys-prefix --symlink --overwrite --py ipymidicontrols
49+ jupyter nbextension enable --sys-prefix --py ipymidicontrols
3850```
3951
40- See a simple widgets-based UI for the controls:
52+ Note that the ` --symlink ` flag doesn't work on Windows, so you will here have to run
53+ the ` install ` command every time that you rebuild your extension. For certain installations
54+ you might also need another flag instead of ` --sys-prefix ` , but we won't cover the meaning
55+ of those flags here.
56+
57+ ### How to see your changes
58+ #### Typescript:
59+ If you use JupyterLab to develop then you can watch the source directory and run JupyterLab at the same time in different
60+ terminals to watch for changes in the extension's source and automatically rebuild the widget.
61+
62+ ``` bash
63+ # Watch the source directory in one terminal, automatically rebuilding when needed
64+ yarn run watch
65+ # Run JupyterLab in another terminal
66+ jupyter lab
67+ ```
4168
42- ``` python
43- from ipymidicontrols import xtouchmini_ui
44- xtouchmini_ui(x)
69+ After a change wait for the build to finish and then refresh your browser and the changes should take effect.
70+
71+ #### Python:
72+ If you make a change to the python code then you will need to restart the notebook kernel to have it take effect.
73+
74+ ## Updating the version
75+
76+ To update the version, install tbump and use it to bump the version.
77+ By default it will also create a tag.
78+
79+ ``` bash
80+ pip install tbump
81+ tbump < new-version>
4582```
4683
47- ![ screenshot] ( https://raw.githubusercontent.com/jupyter-widgets/midicontrols/master/XTouchMini.png )
0 commit comments