-
The typical workflow
-
Available make targets
-
Philosophy
-
List all notebooks to be included in the plot.ly user guide in
./makefile
under the variableug-nbs
. -
Fill in
./scripts/inputs/translate.json
where the keys are the paths (relative to./
) to the notebooks to be converted and the values correspond to the user-guide URL tails on plot.ly. Make sure the these URL tails are not already taken by other pages on plot.ly! -
Run
$ make convert
to convert these notebooks to HTML. -
Run
$ make publish
to adapt these HTML notebooks for plot.ly! This make call outputs 1 HTML templatebody.html
and 1config.json
file for each notebook making the user guide. -
Run
$ make-push-to-streambed
to copy the relevant file structure to thestreambed/
repo (assumed to be one level down in your path and one the desired branch).
Once step 1 to 5 are completed and that streambed/
is updated, run
$ make link-nbs-to-plotly
and update the remote repo to link the notebooks
on nbviewer to plot.ly (hence redirecting traffic to plot.ly!).
-
instructions
:- cat this file
-
convert
:- convert notebooks to HTML using
ipython nbconvert
- move those notebooks to
./converted/
- convert notebooks to HTML using
-
publish
:- [scripts/translate_href-html.py] translate inter-NB hyper refs pointing to
nbviewer, the local directory or plotly external (i.e.
https://plot.ly/...) to django internal (/python/..) using
scripts/inputs/{translate.json,domains.json}
. - [scripts/publish.py] strip the HTML body from style tags, remove undesired
cells, print results in
./published/includes/<url-tail>/body.html
where is taken fromscripts/inputs/translate.json
. - [scripts/make_config.py] generate a config.json for each notebook with meta info and etc.
- [scripts/make_urls.py] generate a python file listing all the urls patterns of the published notebooks.
- [scripts/make_sitemaps.py] generate a python file listing all the sitemap items of the published notebooks.
- [scripts/translate_href-html.py] translate inter-NB hyper refs pointing to
nbviewer, the local directory or plotly external (i.e.
https://plot.ly/...) to django internal (/python/..) using
-
push-to-streambed
:- copy published files and subdirectories to
streambed
(assumingstreambed/
in one level down in your path).
- copy published files and subdirectories to
-
link-nbs-to-plotly
:- [scripts/translate_href-ipynb] translate inter-NB hyper-refs pointing to nbviewer or the local directory to plotly external (i.e. https://plot.ly/..) in the (original .ipynb) notebooks.
-
clean-converted
:- clear
./converted/
- clear
-
clean-published
:- clear
./published/*
- clear
-
clean
:clean-converted
thenclean-published
-
The notebooks on nbviewer path MUST be keep intact so that reader do not end up on dead or out-dated links. DO not change the NBs' filename and stay on the master branch.
-
All scripts used for the makefile are in
./scripts/
. -
All (hard-coded) inputs data files are
./scripts/inputs/
, with the exception of theug-nbs
variable in./makefile
. -
./converted/
stores HTML notebooks (an intermediate step ignored by git). -
./published/
storesstreambed/
-ready content.