Skip to content

Commit

Permalink
README: add pointers on modifying jupyter cells metadata for doc buil…
Browse files Browse the repository at this point in the history
…ding
  • Loading branch information
oliche committed Feb 2, 2024
1 parent 14b5f61 commit 32aeb28
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions docs_gh_pages/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,48 @@ The link should be made by adding in the following line `notebooks_external\name

An example implementation can be seen in the `06_examples.rst` file

### Tips to create and edit example notebooks

#### Hide a cell in the documentation
In the cell metadata, add the key `nbsphinx` with the value `hidden` to hide the cell in the documentation.

```json
{
"nbsphinx": "hidden",
"trusted": false
}
```

#### Prevent execution of a cell in the build documentation
Let's say an example is using too large of a dataset. One cell can be disabled by adding the following key to the to cell metadata.

```json
{
"ibl_execute": false,
"trusted": false
}
```


#### Disable logging and tqdm output:
To have a clean output in the documentation, it is recommended to disable the logging and tqdm output in the example by adding a hidden cell at the top of the notebook.
(make sure the cell metadata contains the key `nbsphinx` with the value `hidden` as specified above)

```python
# Turn off logging and disable tqdm this is a hidden cell on docs page
import logging
import os

logger = logging.getLogger('ibllib')
logger.setLevel(logging.CRITICAL)

os.environ["TQDM_DISABLE"] = "1"
```





## Making documentation using github actions
Two github actions workflows have been made available to automate the building and the deployment of the docs. These are located in the int-brain-lab/iblenv repository and can be accessed under the actions tab

Expand Down

0 comments on commit 32aeb28

Please sign in to comment.