diff --git a/gallery.bash b/gallery.bash new file mode 100644 index 0000000..54c17e8 --- /dev/null +++ b/gallery.bash @@ -0,0 +1,40 @@ +#!/bin/bash + +PDFS=false + +while getopts "p" flag +do + case "${flag}" in + p) PDFS=true;; + esac +done + +echo "Generating gallery images" + +set -- ./gallery/example*.typ +cnt="$#" +i=1 +for f +do + f2="${f/typ/png}" + echo "($i/$cnt) $f -> $f2" + typst c --root ./ "$f" "$f2" + i=$((i+1)) +done + +if [ "$PDFS" = true ] +then + echo + echo "Generating gallery PDFs" + + set -- ./gallery/*.typ + cnt="$#" + i=1 + for f + do + f2="${f/typ/pdf}" + echo "($i/$cnt) $f -> $f2" + typst c --root ./ "$f" "$f2" + i=$((i+1)) + done +fi \ No newline at end of file diff --git a/gallery/example1.pdf b/gallery/example1.pdf index eeb4e1e..032a0f7 100644 Binary files a/gallery/example1.pdf and b/gallery/example1.pdf differ diff --git a/gallery/example1.png b/gallery/example1.png index 70bf2ae..17a1e7a 100644 Binary files a/gallery/example1.png and b/gallery/example1.png differ diff --git a/gallery/example2.pdf b/gallery/example2.pdf index a6beb04..953d011 100644 Binary files a/gallery/example2.pdf and b/gallery/example2.pdf differ diff --git a/gallery/example2.png b/gallery/example2.png index 33c0ef3..f5091e4 100644 Binary files a/gallery/example2.png and b/gallery/example2.png differ diff --git a/gallery/example3.pdf b/gallery/example3.pdf new file mode 100644 index 0000000..601bc47 Binary files /dev/null and b/gallery/example3.pdf differ diff --git a/gallery/example3.png b/gallery/example3.png new file mode 100644 index 0000000..e075d7f Binary files /dev/null and b/gallery/example3.png differ diff --git a/gallery/example3.typ b/gallery/example3.typ new file mode 100644 index 0000000..cf04b43 --- /dev/null +++ b/gallery/example3.typ @@ -0,0 +1,23 @@ +#import "../src/lib.typ": schema, config + +#let example = schema.load("/gallery/example1.yaml") +//#schema.render(example) + += Chapter 1 +#lorem(50) + += Chapter 2 +#lorem(50) + +== Section 2.1 + +#lorem(20) + +#figure( + schema.render(example, config: config.config(all-bit-i: false)), + caption: "Test schema" +) + +#lorem(20) + += Chapter 3 \ No newline at end of file diff --git a/gallery/example3.yaml b/gallery/example3.yaml new file mode 100644 index 0000000..1cc11ba --- /dev/null +++ b/gallery/example3.yaml @@ -0,0 +1,12 @@ +structures: + main: + bits: 32 + ranges: + 31-24: + name: op + 23-16: + name: r1 + 15-8: + name: r2 + 7-0: + name: r3 \ No newline at end of file diff --git a/gallery/test.pdf b/gallery/test.pdf index 7a43849..925be2c 100644 Binary files a/gallery/test.pdf and b/gallery/test.pdf differ