Skip to content

Commit acf0555

Browse files
committed
remove orphaned files
1 parent c7b5dcd commit acf0555

69 files changed

Lines changed: 76 additions & 6910 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

ci/examples/examples.sh

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,16 @@ main() {
99

1010
# Create temp directory for extracted files
1111
temp_dir=$(mktemp -d)
12-
trap "rm -rf $temp_dir" EXIT
12+
13+
# Create temp directory for generated SVGs when no args provided
14+
if [ $# -eq 0 ]; then
15+
temp_output_dir=$(mktemp -d)
16+
trap "rm -rf $temp_dir $temp_output_dir" EXIT
17+
output_dir="$temp_output_dir"
18+
else
19+
trap "rm -rf $temp_dir" EXIT
20+
output_dir="./static/img/examples"
21+
fi
1322

1423
# Parse txtar file
1524
current_file=""
@@ -68,12 +77,18 @@ main() {
6877
bigheader "$output_name"
6978

7079
# Generate SVG with appropriate layout
71-
runjob sh_c D2_LAYOUT=$layout d2 --theme=0 -c --pad 10 "$d2_file" "./static/img/examples/$output_name.svg2" &
80+
runjob sh_c D2_LAYOUT=$layout d2 --omit-version --theme=0 -c --pad 10 "$d2_file" "$output_dir/$output_name.svg2" &
7281
done
7382
done
7483

7584
waitjobs
7685

86+
# If no args provided, replace the examples directory with temp directory contents
87+
if [ $# -eq 0 ]; then
88+
rm -rf ./static/img/examples/*
89+
cp "$temp_output_dir"/* ./static/img/examples/
90+
fi
91+
7792
# Generate the examples pages
7893
generate_examples_pages
7994
}

ci/render.sh

Lines changed: 37 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,44 +4,54 @@ set -eu
44
cd -- "$(dirname "$0")/.."
55

66
_normal() {
7-
sh_c d2 --omit-version --dark-theme=200 -c --pad 0 ./static/d2/${ex}.d2 ./static/img/generated/${ex}.svg2
7+
sh_c d2 --omit-version --dark-theme=200 -c --pad 0 ./static/d2/${ex}.d2 ${output_dir}/${ex}.svg2
88
}
99

10+
1011
_bespoke() {
11-
sh_c d2 --omit-version --theme=300 --dark-theme=200 -l elk -c --pad 0 ./static/bespoke-d2/terminal-theme.d2 ./static/img/generated/terminal-theme.svg2
12-
sh_c d2 --omit-version --theme=300 --dark-theme=200 -l elk -c --pad 0 ./static/bespoke-d2/theme-override.d2 ./static/img/generated/theme-override.svg2
13-
sh_c d2 --omit-version --animate-interval=1400 -l elk -c --pad 0 ./static/bespoke-d2/animated.d2 ./static/img/generated/animated.svg2
14-
sh_c d2 --omit-version --animate-interval=1400 -c --pad 0 ./static/bespoke-d2/chicken.d2 ./static/img/generated/chicken.svg2
15-
sh_c d2 --omit-version --pad 50 ./static/bespoke-d2/tiktok.d2 ./static/img/generated/tiktok.pdf
16-
sh_c d2 --omit-version --pad 0 ./static/bespoke-d2/cat.d2 ./static/img/generated/cat.pdf
17-
sh_c d2 --omit-version --pad 50 ./static/bespoke-d2/lotr.d2 ./static/img/generated/lotr.pdf
12+
sh_c d2 --omit-version --theme=300 --dark-theme=200 -l elk -c --pad 0 ./static/bespoke-d2/terminal-theme.d2 ${output_dir}/terminal-theme.svg2
13+
sh_c d2 --omit-version --theme=300 --dark-theme=200 -l elk -c --pad 0 ./static/bespoke-d2/theme-override.d2 ${output_dir}/theme-override.svg2
14+
sh_c d2 --omit-version --animate-interval=1400 -l elk -c --pad 0 ./static/bespoke-d2/animated.d2 ${output_dir}/animated.svg2
15+
sh_c d2 --omit-version --animate-interval=1400 -c --pad 0 ./static/bespoke-d2/chicken.d2 ${output_dir}/chicken.svg2
16+
sh_c d2 --omit-version --pad 50 ./static/bespoke-d2/tiktok.d2 ${output_dir}/tiktok.pdf
17+
sh_c d2 --omit-version --pad 0 ./static/bespoke-d2/cat.d2 ${output_dir}/cat.pdf
18+
sh_c d2 --omit-version --pad 50 ./static/bespoke-d2/lotr.d2 ${output_dir}/lotr.pdf
1819

19-
sh_c d2 --omit-version --pad 50 ./static/bespoke-d2/c4-code.d2 ./static/img/generated/c4.pdf
20+
sh_c d2 --omit-version --pad 50 ./static/bespoke-d2/c4-code.d2 ${output_dir}/c4.pdf
2021

21-
sh_c d2 --omit-version --animate-interval=1600 -c --pad 50 -l elk ./static/bespoke-d2/tax.d2 ./static/img/generated/tax.svg2
22-
sh_c d2 --omit-version --animate-interval=1600 -c --pad 0 -l elk ./static/bespoke-d2/pizza.d2 ./static/img/generated/pizza.svg2
23-
sh_c d2 --omit-version --animate-interval=1600 -c --pad 0 -l elk ./static/bespoke-d2/johnwick.d2 ./static/img/generated/johnwick.svg2
22+
sh_c d2 --omit-version --animate-interval=1600 -c --pad 50 -l elk ./static/bespoke-d2/tax.d2 ${output_dir}/tax.svg2
23+
sh_c d2 --omit-version --animate-interval=1600 -c --pad 0 -l elk ./static/bespoke-d2/pizza.d2 ${output_dir}/pizza.svg2
24+
sh_c d2 --omit-version --animate-interval=1600 -c --pad 0 -l elk ./static/bespoke-d2/johnwick.d2 ${output_dir}/johnwick.svg2
2425

25-
sh_c d2 --omit-version --animate-interval=400 -c --pad 0 ./static/bespoke-d2/grid-row-dominant.d2 ./static/img/generated/grid-row-dominant.svg2
26-
sh_c d2 --omit-version --animate-interval=400 -c --pad 0 ./static/bespoke-d2/grid-column-dominant.d2 ./static/img/generated/grid-column-dominant.svg2
26+
sh_c d2 --omit-version --animate-interval=400 -c --pad 0 ./static/bespoke-d2/grid-row-dominant.d2 ${output_dir}/grid-row-dominant.svg2
27+
sh_c d2 --omit-version --animate-interval=400 -c --pad 0 ./static/bespoke-d2/grid-column-dominant.d2 ${output_dir}/grid-column-dominant.svg2
2728

28-
sh_c d2 --omit-version ./static/bespoke-d2/cult.d2 ./static/img/generated/cult.pptx
29-
sh_c d2 --omit-version ./static/bespoke-d2/wcc.d2 ./static/img/generated/wcc.pptx
29+
sh_c d2 --omit-version ./static/bespoke-d2/cult.d2 ${output_dir}/cult.pptx
30+
sh_c d2 --omit-version ./static/bespoke-d2/wcc.d2 ${output_dir}/wcc.pptx
3031

31-
sh_c d2 --omit-version ./static/bespoke-d2/imports-nested.d2 ./static/img/generated/imports-nested.pdf
32+
sh_c d2 --omit-version ./static/bespoke-d2/imports-nested.d2 ${output_dir}/imports-nested.pdf
3233

33-
sh_c d2 --omit-version ./static/bespoke-d2/triple-glob.d2 ./static/img/generated/triple-glob.pdf
34+
sh_c d2 --omit-version ./static/bespoke-d2/triple-glob.d2 ${output_dir}/triple-glob.pdf
3435

35-
sh_c d2 --omit-version --sketch ./static/bespoke-d2/grid-nested-connections.d2 ./static/img/generated/grid-nested-connections.svg2
36+
sh_c d2 --omit-version --sketch ./static/bespoke-d2/grid-nested-connections.d2 ${output_dir}/grid-nested-connections.svg2
3637

37-
sh_c d2 --omit-version --dark-theme=200 -l elk -c --pad 0 ./static/bespoke-d2/classes-3.d2 ./static/img/generated/classes-3.svg2
38+
sh_c d2 --omit-version --dark-theme=200 -l elk -c --pad 0 ./static/bespoke-d2/classes-3.d2 ${output_dir}/classes-3.svg2
3839

39-
sh_c d2 --omit-version -c --pad 50 ./static/bespoke-d2/styles-animated.d2 ./static/img/generated/styles-animated.svg2
40+
sh_c d2 --omit-version -c --pad 50 ./static/bespoke-d2/styles-animated.d2 ${output_dir}/styles-animated.svg2
4041
}
4142

4243
main() {
4344
job_parseflags "$@"
4445

46+
# Set up output directory - use temp dir if no args, direct output if filtered
47+
if [ $# -eq 0 ]; then
48+
temp_output_dir=$(mktemp -d)
49+
trap "rm -rf $temp_output_dir" EXIT
50+
output_dir="$temp_output_dir"
51+
else
52+
output_dir="./static/img/generated"
53+
fi
54+
4555
for ex in ./static/d2/*.d2; do
4656
ex=${ex#./static/d2/}
4757
ex=${ex%.d2}
@@ -58,6 +68,12 @@ main() {
5868
runjob _bespoke &
5969
fi
6070
waitjobs
71+
72+
# If no args provided, replace the generated directory with temp directory contents
73+
if [ $# -eq 0 ]; then
74+
rm -rf ./static/img/generated/*
75+
cp "$temp_output_dir"/* ./static/img/generated/
76+
fi
6177
}
6278

6379
main "$@"

static/img/examples/example-bank-securities-dagre.svg2

Lines changed: 1 addition & 24 deletions
Large diffs are not rendered by default.

static/img/examples/example-bank-securities-elk.svg2

Lines changed: 1 addition & 24 deletions
Large diffs are not rendered by default.

static/img/examples/example-bank-securities-tala.svg2

Lines changed: 1 addition & 24 deletions
Large diffs are not rendered by default.

static/img/examples/example-basic-dagre.svg2

Lines changed: 0 additions & 97 deletions
This file was deleted.

0 commit comments

Comments
 (0)