Skip to content

Commit f026b8e

Browse files
πŸ› Replace all instances of 'context' with 'ctx' (#37)
* πŸ“ 3.1.1.1. - Punctuated paramteter descriptions * πŸ“ 3.2.1. - Added further description * πŸ“ Added headings to entry examples * πŸ“ 3.3.1 - Added example usage * πŸ“ 3.2.1. - Removed headings because they look bad * πŸ“ 3.5.1. - Added example usage * πŸ› Changed all uses of 'context' to 'ctx' * 🩹 Make sure that the flake has latest Typst release, and not master * ⬆️ Upgrade flake * πŸ› Fix the docs not rendering * πŸ“Œ Pin the compiler version at 0.11.0 * πŸ› Properly sort the glossary * Update docs.typ --------- Co-authored-by: BattleCh1cken <BattleCh1cken@larkov.de> Co-authored-by: Felix Hass <75806385+BattleCh1cken@users.noreply.github.com>
1 parent 7dd0f8c commit f026b8e

File tree

20 files changed

+115
-178
lines changed

20 files changed

+115
-178
lines changed

β€Ždocs.pdfβ€Ž

9.9 KB
Binary file not shown.

β€Ždocs.typβ€Ž

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -113,29 +113,28 @@ Themes are stored as dictionaries with a set number of fields.
113113
"cover",
114114
[`<function>`],
115115
default: none,
116-
[ A function that returns the cover of the notebook. Must take context as input. ],
116+
[ A function that returns the cover of the notebook. Must take ctx as input. ],
117117
)
118118
#def-arg(
119119
"frontmatter-entry",
120120
[`<function>`],
121121
default: none,
122-
[ A function that returns a frontmatter entry. Must take context and body as
123-
input. ],
122+
[ A function that returns a frontmatter entry. Must take ctx and body as input. ],
124123
)
125124
#def-arg(
126125
"body-entry",
127126
[`<function>`],
128127
default: none,
129-
[ A function that returns a body entry. Must take context and body as input. ],
128+
[ A function that returns a body entry. Must take ctx and body as input. ],
130129
)
131130
#def-arg(
132131
"appendix-entry",
133132
[`<function>`],
134133
default: none,
135-
[ A function that returns a appendix entry. Must take context and body as input. ],
134+
[ A function that returns a appendix entry. Must take ctx and body as input. ],
136135
)
137136

138-
=== Context <context>
137+
=== Context <ctx>
139138

140139
Provides information to a callback about how it's being called.
141140

@@ -440,7 +439,7 @@ content.
440439
Here's a minimal example of what these functions might look like:
441440

442441
```typ
443-
#let frontmatter-entry(context: (:), body) = {
442+
#let frontmatter-entry(ctx: (:), body) = {
444443
show: page.with(
445444
header: [ = Frontmatter header ],
446445
footer: counter(page).display("i")
@@ -451,7 +450,7 @@ Here's a minimal example of what these functions might look like:
451450
```
452451

453452
```typ
454-
#let body-entry(context: (:), body) = {
453+
#let body-entry(ctx: (:), body) = {
455454
show: page.with(
456455
header: [ = Body header ],
457456
footer: counter(page).display("1")
@@ -462,7 +461,7 @@ Here's a minimal example of what these functions might look like:
462461
```
463462

464463
```typ
465-
#let appendix-entry(context: (:), body) = {
464+
#let appendix-entry(ctx: (:), body) = {
466465
show: page.with(
467466
header: [ = Appendix header ],
468467
footer: counter(page).display("i")
@@ -493,7 +492,7 @@ year.
493492
Here's an example cover:
494493

495494
```typ
496-
#let cover(context: (:)) = [
495+
#let cover(ctx: (:)) = [
497496
#set align(center)
498497
*Foo Cover*
499498
]

β€Žentries.typβ€Ž

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#import "./utils.typ"
33
#import "./themes/themes.typ"
44

5-
/// Generic entry creation function.
5+
/// The generic entry creation function. This function has three entry variants - frontmatter, body, and appendix - used to create each page.
66
///
77
/// - section (string): The type of entry. Takes either "frontmatter", "body", or "appendix".
88
/// - title (string): The title of the entry.
@@ -40,7 +40,7 @@
4040

4141
entries.push(
4242
(
43-
context: (title: title, type: type, date: date, author: author, witness: witness),
43+
ctx: (title: title, type: type, date: date, author: author, witness: witness),
4444
body: final-body,
4545
),
4646
)
@@ -54,7 +54,7 @@
5454
/// *Example Usage:*
5555
///
5656
/// ```typ
57-
/// #create-frontmatter-entry(title: "Title")[
57+
/// #create-frontmatter-entry(title: "Frontmatter")[
5858
/// #lorem(50)
5959
/// ]
6060
/// ```
@@ -83,7 +83,7 @@
8383
/// *Example Usage:*
8484
///
8585
/// ```typ
86-
/// #create-appendix-entry(title: "Title")[
86+
/// #create-appendix-entry(title: "Appendix")[
8787
/// #lorem(50)
8888
/// ]
8989
/// ```

β€Žflake.lockβ€Ž

Lines changed: 10 additions & 106 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žflake.nixβ€Ž

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,15 @@
22
inputs = {
33
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
44
utils.url = "github:numtide/flake-utils";
5-
typst.url = "github:typst/typst/main";
65
typstfmt.url = "github:astrale-sharp/typstfmt/0.2.7";
76

8-
typst.inputs.nixpkgs.follows = "nixpkgs";
97
typstfmt.inputs.nixpkgs.follows = "nixpkgs";
108
};
119

1210
outputs =
1311
{ self
1412
, nixpkgs
1513
, utils
16-
, typst
1714
, typstfmt
1815
,
1916
}:
@@ -24,7 +21,7 @@
2421
{
2522
devShell = pkgs.mkShell {
2623
packages = [
27-
typst.packages.${system}.default
24+
pkgs.typst
2825
pkgs.typst-lsp
2926
typstfmt.packages.${system}.default
3027
pkgs.act

β€Žgallery/linear-03.pngβ€Ž

-22.8 KB
Loading

β€Žgallery/linear-04.pngβ€Ž

-22.3 KB
Loading

β€Žgallery/linear-05.pngβ€Ž

-23.6 KB
Loading

β€Žgallery/radial-4.pngβ€Ž

1.42 KB
Loading

β€Žgallery/radial-5.pngβ€Ž

-141 Bytes
Loading

0 commit comments

Comments
Β (0)