From charlesreid1

No edit summary
Line 10: Line 10:


<pre>
<pre>
git clone --recurse-submodules https://github.com/charlesreid1/base16-jupyter
git clone https://github.com/charlesreid1/base16-jupyter
</pre>
</pre>


or, if the repo is already checked out,
Create a Jupyter config directory in the default location and start a notebook server:


<pre>
<pre>
$ cd base16-jupyter
jupyter notebook --generate-config
$ git submodule update --remote
jupyter notebook
</pre>
</pre>


==Installing Base16 IPython==
Create a Jupyter config directory in a custom location and start a notebook server with that configuration:
 
Clone repo here: https://github.com/nsonnad/base16-ipython-notebook
 
List of themes here: https://github.com/nsonnad/base16-ipython-notebook/tree/master/ipython-3/output
 
Start by creating a custom Jupyter config directory:


<pre>
<pre>
$ jupyter notebook --generate-config
JUPYTER_CONFIG_DIR=~/jupyter_custom jupyter notebook --generate-config
Writing default config to: ~/.jupyter/jupyter_notebook_config.py
JUPYTER_CONFIG_DIR=~/jupyter_custom jupyter notebook
</pre>
 
Or skip straight to it:
 
<pre>
mkdir -p ~/.jupyter/custom
</pre>
</pre>


once per profile, then:
Custom CSS should go in <code>custom/custom.css</code>:


<pre>
<pre>
wget -O ~/.jupyter/custom/custom.css \
mkdir $JUPYTER_CONFIG_DIR/custom
https://raw.githubusercontent.com/nsonnad/base16-ipython-notebook/master/ipython-3/output/base16-bespin-dark.css
</pre>
</pre>


===Bringing the toolbar back===
Then copy any of the CSS files into this directory:
 
The themes get rid of the toolbar; to bring it back:


<pre>
<pre>
vim ~/.jupyter/custom/custom.css
cd base16-jupyter/
</pre>
cp colors/base16-bespin-dark.css $JUPYTER_CONFIG_DIR/custom/.
 
and comment out the line:
 
<pre>
div#maintoolbar, div#header {display: none !important;}
</pre>
 
==Using==
 
Start a new notebook using the custom profile:
 
<pre>
jupyter notebook
</pre>
 
Alternatively, could put all the custom config files in their own directory, then run:
 
<pre>
JUPYTER_CONFIG_DIR=~/jupyter_custom jupyter notebook --generate-config
JUPYTER_CONFIG_DIR=~/jupyter_custom jupyter notebook
</pre>
</pre>


It should look like this, once you correct the CSS:
It should look like this:


[[Image:JupyterBase16_after.png|500px]]
[[Image:JupyterBase16_after.png|500px]]

Revision as of 11:37, 2 December 2017

Applying Base16 themes to ipython notebook via https://github.com/nsonnad/base16-ipython-notebook

Before

JupyterBase16 Before.png

Installing Base16 Jupyter

Clone repo, and also clone submodules:

git clone https://github.com/charlesreid1/base16-jupyter

Create a Jupyter config directory in the default location and start a notebook server:

jupyter notebook --generate-config
jupyter notebook

Create a Jupyter config directory in a custom location and start a notebook server with that configuration:

JUPYTER_CONFIG_DIR=~/jupyter_custom jupyter notebook --generate-config
JUPYTER_CONFIG_DIR=~/jupyter_custom jupyter notebook

Custom CSS should go in custom/custom.css:

mkdir $JUPYTER_CONFIG_DIR/custom

Then copy any of the CSS files into this directory:

cd base16-jupyter/
cp colors/base16-bespin-dark.css $JUPYTER_CONFIG_DIR/custom/.

It should look like this:

JupyterBase16 after.png