chore: remove preview/ directory

This commit is contained in:
swaits committed 2024-12-10 22:21:15 +00:00
1 parent 78c5b8a000
commit 274e9bad2f
169 files changed

No files matched your search

+50
View File
@@ -0,0 +1,50 @@
// Inspired by academic textbook glossaries
#let theme-academic = (
section: (title, body) => {
set text(font: "New Computer Modern")
heading(level: 1, title)
v(1em)
body
},
group: (name, index, total, body) => {
if name != "" and total > 1 {
v(1.5em)
align(left, text(weight: "bold", size: 1.2em, name))
v(0.75em)
line(length: 100%, stroke: 0.5pt)
v(0.75em)
}
body
},
entry: (entry, index, total) => {
let short-display = text(weight: "bold", entry.short)
let long-display = if entry.long == none {
[]
} else {
[. #entry.long]
}
let description = if entry.description == none {
[]
} else {
[. #entry.description]
}
block(
below: 1em,
text(
size: 0.95em,
{
grid(
columns: (1fr, auto),
gutter: 0.75em,
[#short-display#long-display#description],
text(fill: rgb("#666666"), entry.pages)
)
}
)
)
},
)
+70
View File
@@ -0,0 +1,70 @@
// Theme definition for a basic single-column glossary layout
//
// This theme provides a traditional glossary format with:
// 1. Bold terms
// 2. Indented descriptions
// 3. Simple page references
// 4. Optional group headings
//
#let theme-basic = (
// Renders the main glossary section as a single column
// Parameters:
// title: The glossary section title
// body: Content containing all groups and entries
section: (title, body) => {
heading(level: 1, title)
body
},
// Renders a group of related glossary terms
// Parameters:
// name: Group name (empty string for ungrouped terms)
// index: Zero-based group index
// total: Total number of groups
// body: Content containing the group's entries
group: (name, index, total, body) => {
if name != "" and total > 1 {
heading(level: 2, name)
}
body
},
// Renders a single glossary entry with term, definition, and page references
// Parameters:
// entry: Dictionary containing term data:
// - short: Short form of term
// - long: Long form of term (optional)
// - description: Term description (optional)
// - label: Term's dictionary label
// - pages: Linked page numbers where term appears
// index: Zero-based entry index within group
// total: Total entries in group
entry: (entry, index, total) => {
// Format the term parts
let term = text(weight: "bold", entry.short)
let long-form = if entry.long == none {
[]
} else {
[, #entry.long]
}
// Format the description with proper spacing
let description = if entry.description == none {
[]
} else {
[: #entry.description]
}
// Create the complete entry with hanging indent
block(
spacing: 0.5em,
pad(
left: 1em,
bottom: 0.5em,
block(
[#term#entry.label#long-form#description #h(1em) (pp. #entry.pages)]
)
)
)
},
)
+47
View File
@@ -0,0 +1,47 @@
// Inspired by the Chicago Manual of Style's index format
#let theme-chicago-index = (
section: (title, body) => {
set par(hanging-indent: 1em)
heading(level: 1, smallcaps(title))
body
},
group: (name, index, total, body) => {
if name != "" and total > 1 {
v(1em)
text(weight: "medium", style: "italic", name)
v(0.5em)
}
body
},
entry: (entry, index, total) => {
let short-display = text(weight: "regular", entry.short)
let long-display = if entry.long == none {
[]
} else {
[ — #entry.long] // Using em-dash for Chicago style
}
let description = if entry.description == none {
[]
} else {
text(style: "italic", [: #entry.description])
}
block(
below: 0.65em,
text(
size: 0.9em,
{
grid(
columns: (1fr, auto),
gutter: 1em,
[#short-display#entry.label#long-display#description],
[#entry.pages]
)
}
)
)
},
)
+91
View File
@@ -0,0 +1,91 @@
// Theme definition for a compact glossary layout optimized for space efficiency
//
// This theme provides a dense but readable format with:
// 1. Terms and definitions on same line
// 2. Smaller font size
// 3. Minimal vertical spacing
// 4. Left-aligned groups for quick scanning
// 5. Condensed page references
//
#let theme-compact = (
// Renders the main glossary section with minimal spacing
// Parameters:
// title: The glossary section title
// body: Content containing all groups and entries
section: (title, body) => {
set par(leading: 0.65em)
heading(level: 1, outlined: false, text(weight: "bold", size: 1.1em, title))
body
},
// Renders a group of related glossary terms
// Parameters:
// name: Group name (empty string for ungrouped terms)
// index: Zero-based group index
// total: Total number of groups
// body: Content containing the group's entries
group: (name, index, total, body) => {
if name != "" and total > 1 {
block(
spacing: 0.5em,
pad(
top: 0.5em,
text(weight: "bold", size: 0.9em, name)
)
)
}
body
},
// Renders a single glossary entry with term, definition, and page references
// Parameters:
// entry: Dictionary containing term data:
// - short: Short form of term
// - long: Long form of term (optional)
// - description: Term description (optional)
// - label: Term's dictionary label
// - pages: Linked page numbers where term appears
// index: Zero-based entry index within group
// total: Total entries in group
entry: (entry, index, total) => {
// Format term components with minimal spacing
let term = text(
size: 0.65em,
weight: "medium",
fill: gray.darken(60%),
entry.short
)
let long-form = if entry.long == none {
[]
} else {
text(size: 0.65em, fill: gray.darken(20%), [ (#entry.long)])
}
let description = if entry.description == none {
[]
} else {
text(size: 0.65em, [· #entry.description])
}
// Create the complete entry with tight spacing
block(
spacing: 0.4em,
grid(
columns: (auto, 1fr, auto),
align: left+bottom,
gutter: 0.5em,
// Term and description column
box[#term#entry.label#long-form #description],
// Dots....
repeat(h(0.25em) + text(fill: gray, ".") + h(0.25em)),
// Page references with smaller font
text(
size: 0.6em,
fill: gray.darken(20%),
entry.pages
)
)
)
},
)
+32
View File
@@ -0,0 +1,32 @@
// A tabular theme courtesy of [@Fevol](https://github.com/Fevol)
#let theme-table = (
section: (title, body) => {
heading(level: 1, title)
body
},
group: (name, index, total, body) => {
if name != "" and total > 1 {
heading(level: 2, name)
}
table(columns: 4,
stroke: none,
inset: (x, y) => {
if (x == 0) {
(left: 0pt, rest: 5pt)
} else if (x == 3) {
(right: 0pt, rest: 5pt)
} else {
5pt
}
},
table.header([*Abbreviation*], [*Full Name*], [*Description*], [*Pages*]),
..body
)
},
entry: (entry, index, total) => {
(entry.short, entry.long, entry.description, entry.pages)
}
)
+72
View File
@@ -0,0 +1,72 @@
// Theme definition for a two-column glossary layout with hierarchical sections
//
// This theme provides formatting for three levels of glossary content:
// 1. Section: The overall glossary container
// 2. Groups: Optional categorization of related terms
// 3. Entries: Individual glossary terms and their definitions
//
#let theme-twocol = (
// Renders the main glossary section as a two-column layout
// Parameters:
// title: The glossary section title
// body: Content containing all groups and entries
section: (title, body) => {
set par.line(numbering: none)
heading(level: 1, title)
columns(2, body)
},
// Renders a group of related glossary terms
// Parameters:
// name: Group name (empty string for ungrouped terms)
// index: Zero-based group index
// total: Total number of groups
// body: Content containing the group's entries
group: (name, index, total, body) => {
if name != "" and total > 1 {
heading(level: 2, name)
}
body
},
// Renders a single glossary entry with term, definition, and page references
// Parameters:
// entry: Dictionary containing term data:
// - short: Short form of term
// - long: Long form of term (optional)
// - description: Term description (optional)
// - label: Term's dictionary label
// - pages: Linked page numbers where term appears
// index: Zero-based entry index within group
// total: Total entries in group
entry: (entry, index, total) => {
// Format the short form and optional long form of the term
let short-display = text(weight: "regular", entry.short)
let long-display = if entry.long == none {
[]
} else {
[#h(0.25em) -- #entry.long]
}
// Format the optional description
let description = if entry.description == none {
[]
} else {
[: #entry.description]
}
// Render the complete entry with dotted leader line to page numbers
text(
size: 0.75em,
weight: "light",
grid(
columns: (auto,1fr,1em,auto),
align: (left, center, center, right),
[#short-display#entry.label#long-display#description], // Term with label
[#repeat(h(0.25em) + "." + h(0.25em))], // Dotted leader line
[ . ], // A 1em wide dot so we definitely get some break between term and pages
[#entry.pages] // Page references
)
)
},
)