From 5461777aeabdcb5e952186aca7e785832cc8df7d Mon Sep 17 00:00:00 2001 From: heyarne Date: Tue, 2 Mar 2021 14:30:28 +0100 Subject: [PATCH] Include sentinel_helpers.py and repository button in jupyter-book --- README.md | 13 ++++++++++--- _config.yml | 10 ++++------ _toc.yml | 2 +- sources/XX sentinel_helpers.rst | 7 +++++++ 4 files changed, 22 insertions(+), 10 deletions(-) create mode 100644 sources/XX sentinel_helpers.rst diff --git a/README.md b/README.md index cabf4cd..87c0026 100644 --- a/README.md +++ b/README.md @@ -46,15 +46,22 @@ Note that working with this kind of data is resource intensive. These notebooks download or create roughly 50GB of data, most of which is occupied by compressed GeoTIFF files. They have been executed and tested on a virtual server with 4 CPU cores with a clock speed of 2.6 GHz each and 32 GB of RAM. -There are notebooks cells with `%%time` or `%%timeit` magic commands. There ouput contains infromation about execution time on the system described above. +There are notebooks cells with `%%time` or `%%timeit` magic commands. +Their ouput contains information about the execution time on the system described above. ## Building the Jupyter Book The `jupyter-book` dependency is included in the `Dockerfile`. -You can build a book from a running container by executing the following command on the Docker host: +You can build a book from a running container by executing the following command when the container above is running: ``` -docker run eratosthenes jupyter-book build . +docker exec eratosthenes jupyter-book build . +``` + +Alternatively you can start a container just to build the book + +``` +docker run -v "$(pwd)":/home/jovyan eratosthenes:latest jupyter-book build . ``` The resulting book can be found in the directory `_build/html/`. diff --git a/_config.yml b/_config.yml index decb2dd..015cf2d 100644 --- a/_config.yml +++ b/_config.yml @@ -12,11 +12,9 @@ logo: great-forty-foot-telescope-wikipedia.png # A path to the book logo execute: execute_notebooks: "off" -sphinx: - config: - nb_custom_formats: - .py: - - jupytext.reads - - fmt: Rmd +repository: + url: https://github.com/heyarne/remote-sensing-for-journalism +html: + use_repository_button: true exclude_patterns: [_build, .cache, .config, .local, .npm, Thumbs.db, .DS_Store, "**.ipynb_checkpoints"] diff --git a/_toc.yml b/_toc.yml index c0d710d..be7a051 100644 --- a/_toc.yml +++ b/_toc.yml @@ -28,4 +28,4 @@ - file: "sources/03c dNBR.ipynb" - part: "Appendix" chapters: - - file: "sources/sentinel_helpers.py" + - file: "sources/XX sentinel_helpers.rst" diff --git a/sources/XX sentinel_helpers.rst b/sources/XX sentinel_helpers.rst new file mode 100644 index 0000000..b88401a --- /dev/null +++ b/sources/XX sentinel_helpers.rst @@ -0,0 +1,7 @@ +Sentinel Helpers +---------------- + +A collection of helper functions that implement repeating tasks. These are reused throughout the different notebooks. + +.. include:: sentinel_helpers.py + :literal: