Skip to content

Commit b8b43cb

Browse files
committed
Allow invocation from outside own directory
1 parent c62e921 commit b8b43cb

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

scripts/make_notebooks.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
#!/bin/bash
22

3-
# Note: in order to be recognized as code blocks, they must start with: ```python
3+
# Note: in order to be recognized as code blocks, must start with: ```python
44

5-
for f in ../01*.md ../02*.md ../03*.md ../04*.md ../05*.md ../06*.md ../07*.md ../08*.md ../09*.md ../10*.md ; do
6-
out=../jupyter-notebooks/$(basename $f)
5+
srcdir=$(dirname $(readlink -f "$0"))/..
6+
destdir=$srcdir/jupyter-notebooks
7+
for f in $srcdir/{01,02,03,04,05,06,07,08,09,10}-*.md ; do
8+
out=$destdir/$(basename $f)
79
cat $f | sed 's/```cpp/```python/' | jupytext --from md --to notebook -o ${out%%.md}.ipynb
810
done

0 commit comments

Comments
 (0)