This information is for people creating or modifying the content of this repo -- i.e. adding or modifying examples.
Please see the file README.md, in this directory, if you are looking for instructions on running and using the examples.
To add a new example, follow these instructions
-
Put the notebook in an existing directory, or create a new one, under
src
. Use underscores in filenames instead of spaces or dashes, e.g. "my_new_notebook.ipynb" and NOT "my-new-notebook.ipynb" or "My New Notebook.ipynb". -
If your notebook will be using tagged cells, please add (before the .ipynb extension) these suffixes:
- for notebooks with "testing" cells, add "_testing"
- for notebooks with "exercise" / "solution" (and potentially testing) cells, use "_solution_testing"
-
Update the
build.yml
file, make sure your notebook will be found under one of the notebook directories. Take note of the corresponding output directory indocs
-
Add a corresponding entries in the
" is the output directory fromdocs/<dir>/index.rst
, where "build.yml
. If this is a new directory, add the directory to the table of contents in thedocs/index.rst
top-level index, and add some text there to describe the contents of the directory. -
Test your new notebook by running
python build.py -cd
(see Build Script below) and seeing that it gets run and converted. The first run may take a while, as it needs to execute the notebooks to create their output. After that, only modified notebooks will be re-run. -
Open the HTML documentation generated under
docs/_build/html
in yur browser and make sure the notebook is there and linked properly. You can also run the test suite withpytest
, though this should usually be unaffected. -
If you have any Python scripts included, write tests for them and put that under the
tests
directory. -
Add the notebook, supporting scripts, tests, and images in
src
, and theindex.rst
files that you added/changed indocs
, to Git. Commit and push your result into a pull request to this repo. Make sure tests pass on CircleCI.
The documentation is built by running the build.py
script in this directory.
This script uses the build.yml
file as its configuration file. You can specify an
alternate configuration file for testing, etc.
Run python build.py --help
to see basic help information and python build.py --usage
to see a more detailed explanation of usage.
If you add new directories with Jupyter notebooks, you will need to let the
script know about them by adding the directories (and the desired target directory
for the rendered documentation) to the build.yml
file in this directory.
The comments in that file should explain how to add the new information.
You can run the build.py
script in testing mode (see -h
option for details) in order
to test the notebooks.
A more limited set of notebooks to examine is configured in the
build-ci.yml
file, which you can pass to the --config
option of the build
script. This will emulate how the code is tested on CircleCI during a pull request.