Skip to content

Commit

Permalink
🔀 Merge branch 'main' into feature/typstyle-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
BattleCh1cken committed Jul 14, 2024
2 parents 342ae23 + aca7b50 commit 7febbe1
Show file tree
Hide file tree
Showing 9 changed files with 175 additions and 25 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,3 @@ jobs:
just package preview
just gallery
just check-format
# TODO: run unit tests here
2 changes: 1 addition & 1 deletion docs/src/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ shell, like git-bash or the shell packaged with Cygwin or GitHub Desktop.
```

```bash
git clone https://github.com/BattleCh1cken/notebookinator
git clone --depth 1 --branch 1.0.1 https://github.com/The-Notebookinator/notebookinator
./notebookinator/scripts/package @local
rm -rf notebookinator
```
Expand Down
5 changes: 5 additions & 0 deletions entries.typ
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
/// - title (string): The title of the entry.
/// - type (string): The type of entry. The possible values for this are decided by the theme.
/// - date (datetime): The date that the entry occured at.
/// - author (str): The author of the entry.
/// - witness (str): The witness of the entry.
/// - participants (array): The people who participated in the entry.
/// - body (content): The content of the entry.
#let create-entry(
section: none,
Expand All @@ -16,6 +19,7 @@
date: none,
author: "",
witness: "",
participants: (),
body,
) = {
let (state, entry-label) = if section == "frontmatter" {
Expand Down Expand Up @@ -44,6 +48,7 @@
date: date,
author: author,
witness: witness,
participants: participants
),
body: final-body,
))
Expand Down
1 change: 0 additions & 1 deletion themes/linear/entries.typ
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@
show: page.with(header: [
#set text(size: 25pt)
#set line(stroke: 1.5pt)

#align(
center + horizon,
grid(
Expand Down
19 changes: 19 additions & 0 deletions themes/radial/Mediamodifier-Design.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions themes/radial/components/label.typ
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
/// - type (string): Any of the radial entry types
/// - size (size): The size of the label
/// -> content
#let label(type, size: 0.7em) = {
#let label(type, size: 0.7em, radius: 1.5pt) = {
let data = entry-type-metadata.at(type)
let colored-image = utils.change-icon-color(raw-icon: data.icon, fill: white)

box(fill: data.color, outset: 3pt, radius: 1.5pt)[
box(fill: data.color, outset: 3pt, radius: radius)[
#set align(center + horizon)
#image.decode(colored-image, height: size)
]
Expand Down
160 changes: 145 additions & 15 deletions themes/radial/entries.typ
Original file line number Diff line number Diff line change
@@ -1,24 +1,137 @@
#import "./colors.typ": *
#import "./icons/icons.typ"
#import "./components/title.typ" as components
#import "./components/components.typ"
#import "./components/title.typ": *
#import "/utils.typ"
#import "./metadata.typ": entry-type-metadata

// TODO: make an actual cover
#let cover(ctx: (:)) = [
#set align(center)
*Radial Cover*
]
#let cover = utils.make-cover(ctx => {
import components: label
let label = label.with(size: 4.7em, radius: 6pt)

#let frontmatter-entry(ctx: (:), body) = {
align(
center + horizon,
text(size: 24pt)[
Radial Theme
],
)

place(dx: 90pt, dy: -340pt, label("identify"))
place(dx: 52pt, dy: -295pt, label("brainstorm"))

place(dx: 520pt, dy: 190pt, label("decide"))
place(dx: 490pt, dy: 240pt, label("build"))
place(dx: 460pt, dy: 290pt, label("test"))

place(
dx: 150pt,
dy: -160pt,
rect(
width: 50%,
height: 300pt,
fill: rgb("#eeeeeeff"),
radius: (right: 20pt, left: 20pt),
),
)

place(dx: 125pt, dy: -180pt, label("management"))
place(dx: 425pt, dy: 105pt, label("management"))

place(
dx: 520pt,
dy: -270pt,
rect(
width: 9%,
height: 55pt,
fill: rgb("#eeeeeeff"),
radius: (right: 5pt, left: 5pt),
),
)
place(
dx: 455pt,
dy: -335pt,
rect(
width: 9%,
height: 55pt,
fill: rgb("#eeeeeeff"),
radius: (right: 5pt, left: 5pt),
),
)
place(dx: 490pt, dy: -300pt, label("program"))

place(
dx: 55pt,
dy: 205pt,
rect(
width: 9%,
height: 55pt,
fill: rgb("#eeeeeeff"),
radius: (right: 5pt, left: 5pt),
),
)
place(
dx: 120pt,
dy: 275pt,
rect(
width: 9%,
height: 55pt,
fill: rgb("#eeeeeeff"),
radius: (right: 5pt, left: 5pt),
),
)
place(dx: 90pt, dy: 240pt, label("notebook"))

place(dx: 165pt, dy: 200pt, line(length: 45%, stroke: 3.5pt + black))

place(dx: 165pt, dy: -215pt, line(length: 45%, stroke: 3.5pt + black))

place(
dx: 250pt,
dy: -280pt,
text(size: 18pt)[
*Radial Theme*
],
)

place(
dx: 225pt,
dy: -250pt,
text(size: 24pt)[
*[Game Season]*
],
)

place(
dx: 235pt,
dy: 165pt,
text(size: 24pt)[
*[Team Name]*
],
)

place(
dx: 0pt,
dy: -370pt,
figure(
image("Mediamodifier-Design.svg", width: 118%),
),
)



})


#let frontmatter-entry = utils.make-frontmatter-entry((ctx, body) => {
show: page.with(
header: components.title(ctx.title),
header: title(ctx.title),
footer: align(right, context counter(page).display("i")),
)
body
}
})

#let body-entry(ctx: (:), body) = {
#let body-entry = utils.make-body-entry((ctx, body) => {
let metadata = entry-type-metadata.at(ctx.type)
show: page.with(
header: components.title(
Expand All @@ -43,13 +156,30 @@
],
)
body
}
})

#let appendix-entry(ctx: (:), body) = {
#let appendix-entry = utils.make-appendix-entry((ctx, body) => {
show: page.with(
header: components.title(ctx.title),
footer: align(right, context counter(page).display()),
header: title(
beginning: image.decode(
utils.change-icon-color(raw-icon: metadata.icon, fill: white),
height: 1em,
),
end: ctx.date.display("[year]/[month]/[day]"),
color: metadata.color,
ctx.title,
),
footer: [
#line(length: 100%)
#align(
left,
[
*Designed by:* #ctx.author #h(2pt) \
*Witnessed by:* #ctx.witness
#h(1fr) #context counter(page).display()
],
)
],
)

body
}
})
5 changes: 1 addition & 4 deletions themes/radial/rules.typ
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
#import "/utils.typ"

#let rules = utils.make-rules(doc => {
set text(
font: "Calibri",
size: 11pt,
)
set text(font: ("Calibri", "Carlito"), size: 11pt)
set page("us-letter")

set footnote.entry(separator: none)
Expand Down
3 changes: 2 additions & 1 deletion utils/theme.typ
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,14 @@ All of the constructors also perform checks to ensure that all of the types are
(
"title",
"type",
"author", // TODO: decide on the standard process for entry attribution
"author",
"witness",
),
str,
)

check-type(ctx, "date", datetime)
check-type(ctx, "participants", array)

if not valid-entry-types.contains(ctx.type) {
panic("Entry type '" + str(ctx.type) + "' is not valid. Valid types include:" + valid-types-printable)
Expand Down

0 comments on commit 7febbe1

Please sign in to comment.