Mentions légales du service

Skip to content
Snippets Groups Projects
Commit aea8453b authored by ROUVREAU Vincent's avatar ROUVREAU Vincent
Browse files

Merge branch 'try_notebook_stripout' into 'master'

give a try to notebook stripout

See merge request formations/cpp/gettingstartedwithmoderncpp!70
parents 9f026ff2 e87c540a
No related branches found
No related tags found
No related merge requests found
repos:
- repo: https://github.com/kynan/nbstripout
rev: 0.7.1
hooks:
- id: nbstripout
......@@ -7,13 +7,12 @@ All contributions are welcome, but please read this first.
If you intend to contribute, please install first the pre-commit hook:
```shell
cp Scripts/pre-commit .git/hooks/pre-commit
conda install -c conda-forge pre-commit # or pip install pre-commit
pre-commit install
```
This hook clears executed cells when committing a notebook.
You need [nbconvert](https://nbconvert.readthedocs.io/en/latest/) to be installed for this pre-commit hook to work properly; it is done automatically if you're using the provided miniconda environment.
## Workflow
......
#!/bin/bash
# This file is expected to be use as pre-commit git hook; copy it in .git/hooks/
file_list=`git diff --cached --diff-filter=ACM --name-only`
for file in ${file_list}
do
if [ "${file##*.}" = "ipynb" ]; then
echo "Clear cells from ${file}"
jupyter nbconvert --clear-output --inplace ${file}
git add ${file}
fi
done
......@@ -4,4 +4,3 @@ channels:
dependencies:
- jupyterlab
- xeus-cling
- nbconvert
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment