-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
25 lines (20 loc) · 829 Bytes
/
Makefile
File metadata and controls
25 lines (20 loc) · 829 Bytes
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
.ONESHELL:
LANGS := en fr
dev:
mkdocs serve -a localhost:8008
install:
apt install jq
snap install yq
pip install -r requirements.txt
quickdoc: $(LANGS)
$(LANGS):
# requirements:
# Make json doc for fractale.co help
yq -o json '.' shorts/doc.$@.toml | \
jq 'to_entries[] | {name: .value.name, tasks: [.value.tasks | to_entries[] | {name: .key, header: .value.header, content: .value.content}]}' | \
jq -s > _data/quickdoc.$@.json
# json doc to markdown
# @debug: main level are removed because only one main title "#" per document,
cat _data/quickdoc.$@.json | \
jq -r '.[] | (.tasks | map("## " + .header + "\n\n" + .content + "\n" )) | .[]' > docs/_shorts/help.$@.md
#jq -r '.[] | ["# " + .name + "\n\n"] + (.tasks | map("## " + .header + "\n\n" + .content + "\n" )) | .[]' > docs/_shorts/help.$@.md