Skip to content

Commit

Permalink
Merge pull request #27 from ENIB-Community/example-for-groups
Browse files Browse the repository at this point in the history
feat(examples): add example for groups
  • Loading branch information
slashformotion authored Apr 7, 2024
2 parents f3861a0 + 4fc4e9b commit 294da4c
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 16 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ jobs:
id: setup-typst
with:
version: 'latest'
- name: Setup Just
uses: extractions/setup-just@v2
- name: Set up Git repository
uses: actions/checkout@v3
- name: typst version
run: typst --version
- name: Compile
run: make build-examples
run: just build-examples
- name: Upload example PDF
uses: actions/upload-artifact@v3
with:
Expand Down
Binary file modified examples/full-example/main.pdf
Binary file not shown.
Binary file added examples/groups/groups.pdf
Binary file not shown.
52 changes: 52 additions & 0 deletions examples/groups/groups.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#import "../../glossarium.typ": make-glossary, print-glossary, gls, glspl
// Replace the local import with a import to the preview namespace.
// If you don't know what that mean, please go read typst documentation on how to import packages at https://typst.app/docs/packages/.

#show: make-glossary

#set page(numbering: "1", paper: "a5")

//I recommend setting a show rule for the links to that your reader understand that they can click on the references to go to the term in the glossary.
#show link: set text(fill: blue.darken(60%))

= Groups example

Reference to @ntc \
Reference to @bor

#pagebreak()
= Glossary with group enabled
#print-glossary(
(
(
key: "ntc",
short: "NTC",
long: "Linear Transform Coding",
desc: [This is the opposite of @ltc.],
group: "Nonlinear",
),
(
key: "ltc",
short: "LTC",
long: "This is the opposite of @ltc.",
desc: [ Transform Coding constraint to linear transforms.],
group: "Linear",
),
(
key: "bor",
short: "DEF",
long: "Default",
desc: lorem(25),
),
(
key: "bor2",
short: "DEF2",
long: "Default2",
desc: lorem(25),
group: "", // Please note that an empty group has the same effect as no group
),

),
show-all: true,
group-pagebreak: true, // break page for each group
)
Binary file modified examples/import-terms-from-yaml-file/main.pdf
Binary file not shown.
3 changes: 2 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ local:
cp -r * ~/.local/share/typst/packages/local/glossarium/{{version}}

build-examples:
find examples/* -type d -exec bash -c "echo Compiling {} && typst compile --root . {}/main.typ" \;
@find examples/**/*.pdf -delete
@find examples/**/*.typ -type f -exec sh -c "echo --------- Compiling {} && time typst compile --root . {}" \;

# format typst code (use typstfmt)
fmt:
Expand Down
14 changes: 0 additions & 14 deletions makefile

This file was deleted.

0 comments on commit 294da4c

Please sign in to comment.