forked from OpenScienceLabs/opensciencelabs.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.makim.yaml
More file actions
43 lines (39 loc) · 1.45 KB
/
.makim.yaml
File metadata and controls
43 lines (39 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
groups:
pages:
tasks:
pre-build:
help: pre-build step
backend: bash
run: |
mkdir -p build
# Directory to search for .ipynb files
export SEARCH_DIR="pages/blog"
# Find all .ipynb files, excluding .ipynb_checkpoints,
# and convert them to Markdown named 'index.md'
find "$SEARCH_DIR" -path "*/.ipynb_checkpoints/*" -prune -o -name \
"*.ipynb" -exec sh -c \
'jupyter nbconvert --to markdown --template=theme/custom-markdown.tpl --output-dir "$(dirname "$0")" --output "index" "$0"' {} \;
# remove console colors from md files
find "$SEARCH_DIR" -name \
"index.md" -exec sh -c \
'cat "$(dirname "$0")/index.md" | python scripts/clean-output.py > "$(dirname "$0")/temp_index.md" && mv "$(dirname "$0")/temp_index.md" "$(dirname "$0")/index.md"' {} \;
build:
help: build the static page
hooks:
pre-run:
- task: pages.pre-build
run: |
rm -rf build/*
mkdocs build --verbose --clean --strict
preview:
help: preview the web page dynamically
args:
run-pre-build:
help: Run pre-build task
type: bool
action: store_true
hooks:
pre-run:
- task: pages.pre-build
if: ${{ args.run_pre_build }}
run: mkdocs serve --watch pages --watch theme