Skip to content

Commit

Permalink
Improve README section on customization
Browse files Browse the repository at this point in the history
  • Loading branch information
oschuett committed Mar 30, 2018
1 parent 6e33cd3 commit 275e006
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
10 changes: 6 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@ RUN pip3 install notebook ipywidgets && \
# install Appmode
COPY . /opt/appmode
WORKDIR /opt/appmode/
RUN pip3 install . && \
RUN pip3 install . && \
jupyter nbextension enable --py --sys-prefix appmode && \
jupyter serverextension enable --py --sys-prefix appmode

# Uncomment following RUN line to hide the "Edit App" button.
# Beware that this does not prevent users from changing the URL manually.
# RUN mkdir -p ~/.jupyter/custom/ && echo "\$('#appmode-leave').hide();" >> ~/.jupyter/custom/custom.js
# Possible Customizations
# RUN mkdir -p ~/.jupyter/custom/ && \
# echo "\$('#appmode-leave').hide();" >> ~/.jupyter/custom/custom.js && \
# echo "\$('#appmode-busy').hide();" >> ~/.jupyter/custom/custom.js && \
# echo "\$('#appmode-loader').append('<h2>Loading...</h2>');" >> ~/.jupyter/custom/custom.js

# Launch Notebook server
EXPOSE 8888
Expand Down
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,6 @@ dependencies:
- appmode
```

## Hidding the edit button

In some cases it might be useful to hide the _Edit App_ button. This can be achieved by adding in the following line to the [custom.js](http://jupyter-notebook.readthedocs.io/en/stable/examples/Notebook/JavaScript%20Notebook%20Extensions.html#custom.js) file:
```
$('#appmode-leave').hide();
```
Beware that users can still leave Appmode by changing the URL manually.

## Description

Appmode consist of a server-side and a notebook extension for Jupyter. Together these two extensions provide the following features:
Expand All @@ -53,6 +45,16 @@ Appmode consist of a server-side and a notebook extension for Jupyter. Together

- To allow for passing information between notebooks via url parameters, the current url is injected into the variable ``jupyter_notebook_url``.

## Customization

The UI elements of Appmode can be customized via the [custom.js](http://jupyter-notebook.readthedocs.io/en/stable/examples/Notebook/JavaScript%20Notebook%20Extensions.html#custom.js) file. Some examples are:
```
$('#appmode-leave').hide(); // Hides the edit app button.
$('#appmode-busy').hide(); // Hides the kernel busy indicator.
$('#appmode-loader').append('<h2>Loading...</h2>'); // Adds a loading message.
```
Beware that hiding the edit button does not prevent users from leaving Appmode by changing the URL manually.

## Development

With the included [Dockerfile](./Dockerfile) a development environment can be quickly created:
Expand Down

0 comments on commit 275e006

Please sign in to comment.