Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(examples): add example for groups #27

Merged
merged 2 commits into from
Apr 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

Loading