Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
93a7794c2e
|
||
|
|
40cc652aeb
|
||
|
|
05a66f4956
|
No files matched your search
+4
-1
@@ -253,7 +253,7 @@ Customize glossary appearance by defining a theme with three functions:
|
|||||||
// Individual glossary entry
|
// Individual glossary entry
|
||||||
entry: (entry, index, total) => {
|
entry: (entry, index, total) => {
|
||||||
// index = entry index, total = total entries in group
|
// index = entry index, total = total entries in group
|
||||||
let output = [#entry.short]
|
let output = [#entry.short#entry.label] // **NOTE:** Label here!
|
||||||
if entry.long != none {
|
if entry.long != none {
|
||||||
output = [#output -- #entry.long]
|
output = [#output -- #entry.long]
|
||||||
}
|
}
|
||||||
@@ -280,6 +280,9 @@ Entry fields available to themes:
|
|||||||
- `label`: Term's dictionary label
|
- `label`: Term's dictionary label
|
||||||
- `pages`: Linked page numbers where term appears
|
- `pages`: Linked page numbers where term appears
|
||||||
|
|
||||||
|
**NOTE:** If the theme does not emit `entry.label`, linking form terms to their
|
||||||
|
glossary entry will not work.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
This project is licensed under the MIT License.
|
This project is licensed under the MIT License.
|
||||||
Executable
+6
@@ -0,0 +1,6 @@
|
|||||||
|
watchexec \
|
||||||
|
--watch . \
|
||||||
|
--clear \
|
||||||
|
--ignore 'tests/**/diff/**' \
|
||||||
|
--ignore 'tests/**/out/**' \
|
||||||
|
"typst-test r"
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
grid(
|
grid(
|
||||||
columns: (1fr, auto),
|
columns: (1fr, auto),
|
||||||
gutter: 0.75em,
|
gutter: 0.75em,
|
||||||
[#short-display#long-display#description],
|
[#short-display#long-display#description#entry.label],
|
||||||
text(fill: rgb("#666666"), entry.pages)
|
text(fill: rgb("#666666"), entry.pages)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
grid(
|
grid(
|
||||||
columns: (1fr, auto),
|
columns: (1fr, auto),
|
||||||
gutter: 1em,
|
gutter: 1em,
|
||||||
[#short-display#entry.label#long-display#description],
|
[#short-display#entry.label#long-display#description#entry.label],
|
||||||
[#entry.pages]
|
[#entry.pages]
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,6 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
entry: (entry, index, total) => {
|
entry: (entry, index, total) => {
|
||||||
(entry.short, entry.long, entry.description, entry.pages)
|
(entry.short + entry.label, entry.long, entry.description, entry.pages)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 99 KiB |
@@ -0,0 +1,45 @@
|
|||||||
|
#import "/lib.typ": *
|
||||||
|
#import "@preview/glossarium:0.5.1": *
|
||||||
|
|
||||||
|
#set page(height: auto, width: 4.5in)
|
||||||
|
#show link: set text(fill: red)
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
= `glossy`:
|
||||||
|
|
||||||
|
#box(
|
||||||
|
stroke: 1pt,
|
||||||
|
inset: 1em,
|
||||||
|
[
|
||||||
|
#show: init-glossary.with((WWW: "World Wide Web"))
|
||||||
|
|
||||||
|
This should be a link: @WWW
|
||||||
|
|
||||||
|
This should be a link, too: @WWW
|
||||||
|
|
||||||
|
#glossary()
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
= `glossarium`:
|
||||||
|
|
||||||
|
#box(
|
||||||
|
stroke: 1pt,
|
||||||
|
inset: 1em,
|
||||||
|
[
|
||||||
|
#show: make-glossary
|
||||||
|
#let entry-list = (
|
||||||
|
(key: "ML", short: "ML", long: "Machine Learning"),
|
||||||
|
)
|
||||||
|
#register-glossary(entry-list)
|
||||||
|
|
||||||
|
This should be a link: @ML
|
||||||
|
|
||||||
|
This should be a link, too: @ML
|
||||||
|
|
||||||
|
#print-glossary(entry-list)
|
||||||
|
]
|
||||||
|
)
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
#set text(lang: "cs", region: "CZ")
|
#set text(lang: "cs", region: "CZ")
|
||||||
|
|
||||||
#show: init-glossary.with(yaml("glossary.yml"))
|
#show: init-glossary.with(yaml("glossary.yml"))
|
||||||
#glossary(ignore-case: true)
|
#glossary(ignore-case: true, theme: theme-twocol)
|
||||||
|
|
||||||
#line(length: 20em)
|
#line(length: 20em)
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user