Skip to content

Commit c8243df

Browse files
committed
First draft of typed rendering
1 parent d791e76 commit c8243df

File tree

4 files changed

+574
-0
lines changed

4 files changed

+574
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
/build/
22
/out/
3+
/venv

scripts/build.sh

+33
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,27 @@ generate_index() {
3434
tac "$build/index.rev.md" >> "$build/index.md"
3535
}
3636

37+
build_docs_single() {
38+
local release_date="$1"
39+
local input_package_json="$2"
40+
local output_html="$3"
41+
42+
local build_single
43+
build_single="$build/single-$(date +%FT%T)"
44+
mkdir -p "$build_single"
45+
mkdir -p "$(dirname "$output_html")"
46+
local rendered_md="$build_single/rendered.md"
47+
48+
"$scripts/md_formatter.py" "$input_package_json" "$rendered_md"
49+
50+
local pandoc_page_opts=(
51+
-V "date=$release_date"
52+
"$rendered_md"
53+
-o "$output_html"
54+
)
55+
pandoc "${pandoc_opts[@]}" "${pandoc_page_opts[@]}"
56+
}
57+
3758
build_docs_all() {
3859
mkdir -p "$build"
3960
mkdir -p "$out"
@@ -85,6 +106,8 @@ usage() {
85106
Usage:
86107
all - build docs for all tags
87108
clean - remove all build artifacts
109+
single <release date> <input package.json path> <output html path>
110+
- build a single package.json
88111
EOF
89112
}
90113

@@ -102,6 +125,16 @@ if [[ $# -eq 1 ]]; then
102125
usage
103126
exit 1;;
104127
esac
128+
elif [[ $# -eq 4 ]]; then
129+
case $1 in
130+
single)
131+
shift
132+
build_docs_single "$@"
133+
exit 0;;
134+
*)
135+
usage
136+
exit 1;;
137+
esac
105138
fi
106139

107140
usage

0 commit comments

Comments
 (0)