From 9197c4e1267c9d764719c1ef3976bab6c2ffb39d Mon Sep 17 00:00:00 2001 From: deb06 <66920321+deb06@users.noreply.github.com> Date: Tue, 16 Jan 2024 16:29:03 -0500 Subject: [PATCH 1/9] Update themes.typ --- themes/themes.typ | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/themes.typ b/themes/themes.typ index 2d0c496..ac1aa91 100644 --- a/themes/themes.typ +++ b/themes/themes.typ @@ -1,2 +1,2 @@ #import "./default/default.typ" -#import "./radial/radial.typ" +#import "./radial/radial.typ" \ No newline at end of file From f9c629947c15f43ad268029c3a527679633a8847 Mon Sep 17 00:00:00 2001 From: Deb <66920321+deb06@users.noreply.github.com> Date: Fri, 17 May 2024 19:13:32 -0400 Subject: [PATCH 2/9] create base --- main.typ | 11 +++++++ themes/revision/components/components.typ | 4 +++ .../revision/components/decision-matrix.typ | 0 themes/revision/components/glossary.typ | 0 themes/revision/components/pro-con.typ | 0 themes/revision/components/toc.typ | 0 themes/revision/entries.typ | 31 +++++++++++++++++++ themes/revision/revision.typ | 11 +++++++ themes/revision/rules.typ | 3 ++ 9 files changed, 60 insertions(+) create mode 100644 main.typ create mode 100644 themes/revision/components/components.typ create mode 100644 themes/revision/components/decision-matrix.typ create mode 100644 themes/revision/components/glossary.typ create mode 100644 themes/revision/components/pro-con.typ create mode 100644 themes/revision/components/toc.typ create mode 100644 themes/revision/entries.typ create mode 100644 themes/revision/revision.typ create mode 100644 themes/revision/rules.typ diff --git a/main.typ b/main.typ new file mode 100644 index 0000000..2280530 --- /dev/null +++ b/main.typ @@ -0,0 +1,11 @@ +#import "themes/revision/revision.typ": revision-theme, components +#import "lib.typ": * + +#show: notebook.with( + theme: revision-theme + +) + +#create-frontmatter-entry(title: "About")[ + Here's some info about this amazing notebook! +] \ No newline at end of file diff --git a/themes/revision/components/components.typ b/themes/revision/components/components.typ new file mode 100644 index 0000000..b2851a2 --- /dev/null +++ b/themes/revision/components/components.typ @@ -0,0 +1,4 @@ +#import "./toc.typ": * +#import "./glossary.typ": * +#import "./pro-con.typ": * +#import "./decision-matrix.typ": * \ No newline at end of file diff --git a/themes/revision/components/decision-matrix.typ b/themes/revision/components/decision-matrix.typ new file mode 100644 index 0000000..e69de29 diff --git a/themes/revision/components/glossary.typ b/themes/revision/components/glossary.typ new file mode 100644 index 0000000..e69de29 diff --git a/themes/revision/components/pro-con.typ b/themes/revision/components/pro-con.typ new file mode 100644 index 0000000..e69de29 diff --git a/themes/revision/components/toc.typ b/themes/revision/components/toc.typ new file mode 100644 index 0000000..e69de29 diff --git a/themes/revision/entries.typ b/themes/revision/entries.typ new file mode 100644 index 0000000..79b2c85 --- /dev/null +++ b/themes/revision/entries.typ @@ -0,0 +1,31 @@ +#let frontmatter-entry(ctx: (:), body) = { + show: page.with( + header: [ = #ctx.title], + footer: counter(page).display("i") + ) + + body +} + +#let body-entry(ctx: (:), body) = { + show: page.with( + header: [ = #ctx.title], + footer: counter(page).display("1") + ) + + body +} + +#let appendix-entry(ctx: (:), body) = { + show: page.with( + header: [ = #ctx.title], + footer: counter(page).display("i") + ) + + body +} + +#let cover(ctx: (:)) = [ + #set align(center) + +] \ No newline at end of file diff --git a/themes/revision/revision.typ b/themes/revision/revision.typ new file mode 100644 index 0000000..e458adb --- /dev/null +++ b/themes/revision/revision.typ @@ -0,0 +1,11 @@ +#import "./entries.typ": * +#import "./rules.typ": * +#import "./components/components.typ" + +#let revision-theme = ( + rules: rules, + cover: cover, + frontmatter-entry: frontmatter-entry, + body-entry: body-entry, + appendix-entry: appendix-entry, +) \ No newline at end of file diff --git a/themes/revision/rules.typ b/themes/revision/rules.typ new file mode 100644 index 0000000..5c1992a --- /dev/null +++ b/themes/revision/rules.typ @@ -0,0 +1,3 @@ +#let rules(doc) = { + doc +} \ No newline at end of file From d382784b7c4a2887d81ce49af1ac319981bf1db1 Mon Sep 17 00:00:00 2001 From: Deb <66920321+deb06@users.noreply.github.com> Date: Sat, 18 May 2024 12:29:24 -0400 Subject: [PATCH 3/9] =?UTF-8?q?=F0=9F=9A=A7=20Working=20prototype=3F=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/revision/colors.typ | 17 +++++++++++ themes/revision/entries.typ | 61 +++++++++++++++++++++++++++++++++++-- themes/revision/rules.typ | 11 +++++++ 3 files changed, 86 insertions(+), 3 deletions(-) create mode 100644 themes/revision/colors.typ diff --git a/themes/revision/colors.typ b/themes/revision/colors.typ new file mode 100644 index 0000000..5a33217 --- /dev/null +++ b/themes/revision/colors.typ @@ -0,0 +1,17 @@ +#let red = rgb("#F43545") +#let orange = rgb("#FA8901") +#let yellow = rgb("#FAD717") +#let green = rgb("#00BA71") +#let blue = rgb("#00C2DE") +#let indigo = rgb("#00418D") +#let violet = rgb("#5F2879") + +#let color-map = ( + "identify" : red, + "brainstorm" : orange, + "select" : yellow, + "build" : green, + "test" : blue, + "program" : indigo, + "improve" : violet +) \ No newline at end of file diff --git a/themes/revision/entries.typ b/themes/revision/entries.typ index 79b2c85..2a8a67c 100644 --- a/themes/revision/entries.typ +++ b/themes/revision/entries.typ @@ -1,3 +1,5 @@ +#import "colors.typ": * + #let frontmatter-entry(ctx: (:), body) = { show: page.with( header: [ = #ctx.title], @@ -8,12 +10,62 @@ } #let body-entry(ctx: (:), body) = { + let header-map = ( + "identify" : "IDENTIFY PROBLEM", + "brainstorm" : "BRAINSTORM SOLUTIONS", + "select" : "SELECT AND PLAN", + "build" : "BUILD SOLUTION", + "test" : "TEST SOLUTION", + "program" : "PROGRAM SOLUTION", + "improve" : "IMPROVE SOLUTION" + ) + show: page.with( - header: [ = #ctx.title], - footer: counter(page).display("1") + paper: "us-letter", + margin: (top: 100pt), + header: align(center)[ + #text(size:24pt)[#header-map.at(ctx.type)] \ + #grid( + rows: 10pt, + columns: (auto, auto, auto), + column-gutter: 10pt, + align(horizon)[#line(length: 100%)], + align(top)[#ctx.title], + align(horizon)[#line(length: 100%)] + ) + ], + footer: context counter(page).display() ) - body + context ( if calc.even(counter(page).get().at(0)) { + grid( + rows: auto, + columns: (1fr, 19fr), + column-gutter: 10pt, + box(fill: color-map.at(ctx.type).transparentize(50%), height: 100%, width: 100%)[ + #align(horizon)[ + #rotate(90deg, origin : center, reflow: true)[ + #header-map.at(ctx.type)#v(40%) + ] + ] + ], + body + ) + } else { + grid( + rows: auto, + columns: (19fr, 1fr), + column-gutter: 10pt, + body, + box(fill: color-map.at(ctx.type).transparentize(50%), height: 100%, width: 100%)[ + #align(horizon)[ + #rotate(-90deg, origin : center, reflow: true)[ + #v(40%)#header-map.at(ctx.type) + ] + ] + ] + ) + }) } #let appendix-entry(ctx: (:), body) = { @@ -27,5 +79,8 @@ #let cover(ctx: (:)) = [ #set align(center) + #text(size: 26pt)[ \ \ \ \ + == ENGINEERING NOTEBOOK + ] ] \ No newline at end of file diff --git a/themes/revision/rules.typ b/themes/revision/rules.typ index 5c1992a..054110d 100644 --- a/themes/revision/rules.typ +++ b/themes/revision/rules.typ @@ -1,3 +1,14 @@ #let rules(doc) = { + set text(font: "Roboto", size: 12pt) + set page("us-letter") + + // Enforce the correct font on Excalidraw drawings + show image: it => [ + #align(center)[ + #set text(font: "Virgil 3 YOFF") + #it + ] + ] + doc } \ No newline at end of file From 9015104b06d8e6f91f30e5a7400413d92062af9f Mon Sep 17 00:00:00 2001 From: Deb <66920321+deb06@users.noreply.github.com> Date: Sat, 18 May 2024 23:33:10 -0400 Subject: [PATCH 4/9] =?UTF-8?q?=F0=9F=9A=A7=20almost=20works..=20what=20is?= =?UTF-8?q?=20up=20with=20pages?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/revision/entries.typ | 40 ++++++++++++++++--------------------- 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/themes/revision/entries.typ b/themes/revision/entries.typ index 2a8a67c..a70b57d 100644 --- a/themes/revision/entries.typ +++ b/themes/revision/entries.typ @@ -3,7 +3,7 @@ #let frontmatter-entry(ctx: (:), body) = { show: page.with( header: [ = #ctx.title], - footer: counter(page).display("i") + footer: context counter(page).display("i") ) body @@ -22,56 +22,50 @@ show: page.with( paper: "us-letter", - margin: (top: 100pt), + margin: (top: 90pt), header: align(center)[ #text(size:24pt)[#header-map.at(ctx.type)] \ #grid( rows: 10pt, columns: (auto, auto, auto), column-gutter: 10pt, - align(horizon)[#line(length: 100%)], + align(horizon+right)[#line(length: 100% + 35pt)], align(top)[#ctx.title], - align(horizon)[#line(length: 100%)] + align(horizon+left)[#line(length: 100% + 35pt)] ) ], - footer: context counter(page).display() + footer: context(counter(page).display()) ) - context ( if calc.even(counter(page).get().at(0)) { - grid( - rows: auto, - columns: (1fr, 19fr), - column-gutter: 10pt, - box(fill: color-map.at(ctx.type).transparentize(50%), height: 100%, width: 100%)[ + context(if calc.even(counter(page).get().at(0)){ + place(left + top, dx: -35pt, dy: -25pt)[ + #box(fill: color-map.at(ctx.type).transparentize(50%), height: 100%, width: 5%)[ #align(horizon)[ #rotate(90deg, origin : center, reflow: true)[ #header-map.at(ctx.type)#v(40%) ] ] - ], - body - ) + ] + ] } else { - grid( - rows: auto, - columns: (19fr, 1fr), - column-gutter: 10pt, - body, - box(fill: color-map.at(ctx.type).transparentize(50%), height: 100%, width: 100%)[ + place(right + top, dx: 35pt, dy: -25pt)[ + #box(fill: color-map.at(ctx.type).transparentize(50%), height: 100%, width: 5%)[ #align(horizon)[ - #rotate(-90deg, origin : center, reflow: true)[ + #rotate(90deg, origin : center, reflow: true)[ #v(40%)#header-map.at(ctx.type) ] ] ] - ) + ] }) + context(repr(counter(page).get().at(0))) + //body } #let appendix-entry(ctx: (:), body) = { show: page.with( header: [ = #ctx.title], - footer: counter(page).display("i") + footer: context counter(page).display("i") ) body From 0dc48e84b613cd193f78b79ffe98ca13997098ee Mon Sep 17 00:00:00 2001 From: Deb <66920321+deb06@users.noreply.github.com> Date: Sun, 19 May 2024 12:41:16 -0400 Subject: [PATCH 5/9] =?UTF-8?q?=F0=9F=9A=A7=20finished=20entry=20functions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.typ | 11 ---- themes/revision/components/header.typ | 0 themes/revision/entries.typ | 80 ++++++++++++++++++++------- 3 files changed, 59 insertions(+), 32 deletions(-) delete mode 100644 main.typ create mode 100644 themes/revision/components/header.typ diff --git a/main.typ b/main.typ deleted file mode 100644 index 2280530..0000000 --- a/main.typ +++ /dev/null @@ -1,11 +0,0 @@ -#import "themes/revision/revision.typ": revision-theme, components -#import "lib.typ": * - -#show: notebook.with( - theme: revision-theme - -) - -#create-frontmatter-entry(title: "About")[ - Here's some info about this amazing notebook! -] \ No newline at end of file diff --git a/themes/revision/components/header.typ b/themes/revision/components/header.typ new file mode 100644 index 0000000..e69de29 diff --git a/themes/revision/entries.typ b/themes/revision/entries.typ index a70b57d..2673e18 100644 --- a/themes/revision/entries.typ +++ b/themes/revision/entries.typ @@ -2,10 +2,25 @@ #let frontmatter-entry(ctx: (:), body) = { show: page.with( - header: [ = #ctx.title], - footer: context counter(page).display("i") + paper: "us-letter", + margin: (y: 90pt), + header: align(center)[ + #text(size:24pt)[#upper(ctx.title)] \ + #line(length: 100%) + ], + footer: grid( + rows: (10pt, auto), + columns: (auto, auto, auto), + column-gutter: 10pt, + row-gutter: 10pt, + align(horizon+right)[#line(length: 100%)], + align(top)[#context(counter(page).display("I"))], + align(horizon+left)[#line(length: 100%)], + align(left)[#text(weight: "bold")[Authors:]], + [], + align(right)[#text(weight: "bold")[Date:] #ctx.date.display("[month]/[day]/[year]")] + ) ) - body } @@ -22,34 +37,44 @@ show: page.with( paper: "us-letter", - margin: (top: 90pt), + margin: (y: 90pt), header: align(center)[ #text(size:24pt)[#header-map.at(ctx.type)] \ #grid( rows: 10pt, columns: (auto, auto, auto), column-gutter: 10pt, - align(horizon+right)[#line(length: 100% + 35pt)], + align(horizon+right)[#line(length: 100%)], align(top)[#ctx.title], - align(horizon+left)[#line(length: 100% + 35pt)] + align(horizon+left)[#line(length: 100%)] ) ], - footer: context(counter(page).display()) + footer: grid( + rows: (10pt, auto), + columns: (auto, auto, auto), + column-gutter: 10pt, + row-gutter: 10pt, + align(horizon+right)[#line(length: 100%)], + align(top)[#context(counter(page).display())], + align(horizon+left)[#line(length: 100%)], + align(left)[#text(weight: "bold")[Authors:]], + [], + align(right)[#text(weight: "bold")[Date:] #ctx.date.display("[month]/[day]/[year]")] + ) ) - - context(if calc.even(counter(page).get().at(0)){ - place(left + top, dx: -35pt, dy: -25pt)[ - #box(fill: color-map.at(ctx.type).transparentize(50%), height: 100%, width: 5%)[ + context(if calc.even(here().position().at("page")){ + place(left + top, dx: -35pt, dy: -33.5pt)[ + #box(fill: color-map.at(ctx.type).transparentize(50%), height: 100% + 66pt, width: 5%)[ #align(horizon)[ #rotate(90deg, origin : center, reflow: true)[ #header-map.at(ctx.type)#v(40%) ] ] ] - ] + ] } else { - place(right + top, dx: 35pt, dy: -25pt)[ - #box(fill: color-map.at(ctx.type).transparentize(50%), height: 100%, width: 5%)[ + place(right + top, dx: 35pt, dy: -32.5pt)[ + #box(fill: color-map.at(ctx.type).transparentize(50%), height: 100% + 66pt, width: 5%)[ #align(horizon)[ #rotate(90deg, origin : center, reflow: true)[ #v(40%)#header-map.at(ctx.type) @@ -58,16 +83,30 @@ ] ] }) - context(repr(counter(page).get().at(0))) - //body + body } #let appendix-entry(ctx: (:), body) = { show: page.with( - header: [ = #ctx.title], - footer: context counter(page).display("i") + paper: "us-letter", + margin: (y: 90pt), + header: align(center)[ + #text(size:24pt)[#upper(ctx.title)] \ + #line(length: 100%) + ], + footer: grid( + rows: (10pt, auto), + columns: (auto, auto, auto), + column-gutter: 10pt, + row-gutter: 10pt, + align(horizon+right)[#line(length: 100%)], + align(top)[#context(counter(page).display("I"))], + align(horizon+left)[#line(length: 100%)], + align(left)[#text(weight: "bold")[Authors:]], + [], + align(right)[#text(weight: "bold")[Date:] #ctx.date.display("[month]/[day]/[year]")] + ) ) - body } @@ -75,6 +114,5 @@ #set align(center) #text(size: 26pt)[ \ \ \ \ == ENGINEERING NOTEBOOK - ] - + ] ] \ No newline at end of file From 7097b5a7958bde8bc7c7c0ed79e3ab6546792b0d Mon Sep 17 00:00:00 2001 From: Deb <66920321+deb06@users.noreply.github.com> Date: Sun, 19 May 2024 17:46:53 -0400 Subject: [PATCH 6/9] =?UTF-8?q?=F0=9F=9A=A7=20working=20toc=20(still=20nee?= =?UTF-8?q?ds=20to=20be=20polished)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/revision/colors.typ | 16 +++--- themes/revision/components/components.typ | 3 +- themes/revision/components/header.typ | 9 +++ themes/revision/components/toc.typ | 63 +++++++++++++++++++++ themes/revision/entries.typ | 67 ++++++++++++----------- 5 files changed, 118 insertions(+), 40 deletions(-) diff --git a/themes/revision/colors.typ b/themes/revision/colors.typ index 5a33217..eb1d09b 100644 --- a/themes/revision/colors.typ +++ b/themes/revision/colors.typ @@ -1,10 +1,10 @@ -#let red = rgb("#F43545") -#let orange = rgb("#FA8901") -#let yellow = rgb("#FAD717") -#let green = rgb("#00BA71") -#let blue = rgb("#00C2DE") -#let indigo = rgb("#00418D") -#let violet = rgb("#5F2879") +#let red = rgb("#F43545").lighten(50%) +#let orange = rgb("#FA8901").lighten(50%) +#let yellow = rgb("#FAD717").lighten(50%) +#let green = rgb("#00BA71").lighten(50%) +#let blue = rgb("#00C2DE").lighten(50%) +#let indigo = rgb("#00418D").lighten(50%) +#let violet = rgb("#5F2879").lighten(50%) #let color-map = ( "identify" : red, @@ -13,5 +13,5 @@ "build" : green, "test" : blue, "program" : indigo, - "improve" : violet + "improve" : violet, ) \ No newline at end of file diff --git a/themes/revision/components/components.typ b/themes/revision/components/components.typ index b2851a2..7aef1d6 100644 --- a/themes/revision/components/components.typ +++ b/themes/revision/components/components.typ @@ -1,4 +1,5 @@ #import "./toc.typ": * #import "./glossary.typ": * #import "./pro-con.typ": * -#import "./decision-matrix.typ": * \ No newline at end of file +#import "./decision-matrix.typ": * +#import "./header.typ": * \ No newline at end of file diff --git a/themes/revision/components/header.typ b/themes/revision/components/header.typ index e69de29..38f3878 100644 --- a/themes/revision/components/header.typ +++ b/themes/revision/components/header.typ @@ -0,0 +1,9 @@ +#let header-map = ( + "identify" : "Identify Problem", + "brainstorm" : "Brainstorm Solutions", + "select" : "Select and Plan", + "build" : "Build Solution", + "test" : "Test Solution", + "program" : "Program Solution", + "improve" : "Improve Solution" +) \ No newline at end of file diff --git a/themes/revision/components/toc.typ b/themes/revision/components/toc.typ index e69de29..608f20d 100644 --- a/themes/revision/components/toc.typ +++ b/themes/revision/components/toc.typ @@ -0,0 +1,63 @@ +#import "/utils.typ" +#import "/themes/revision/colors.typ": * +#import "header.typ": header-map + +#let toc() = utils.print-toc((frontmatter, body, appendix) => { + let last-page = 0 + + stack( + spacing: none, + [#heading(level: 1)[ENTRIES] #v(1em)], + [#grid( + rows: 1em, + columns: (1fr, 10fr, 2fr), + align(center)[PAGE], + align(center)[SUBJECT], + align(center)[DATE] + )], + ..for entry in body { + if entry.at("page-number") - last-page > 1 { + for i in range(entry.at("page-number") - last-page - 1) { + ([#table( + stroke: (luma(120) + .5pt), + rows: (auto), + columns: (1fr, 10fr, 2fr), + align(center)[#(last-page + i + 1)], + [#place(dy: -4.7pt, dx: +40pt)[#line(angle:90deg, length: 17.3pt, stroke: (2pt + black))]] + )],) + } + } + ([#table( + stroke: (luma(120) + .7pt), + rows: (auto), + columns: (1fr, 10fr, 2fr), + align(center)[#entry.at("page-number")], + if entry.at("type") != none { + align(left)[#header-map.at(entry.at("type")): #entry.at("title")] + } else { + align(left)[#entry.at("title")] + }, + align(center)[#entry.at("date").display("[month]/[day]/[year]")] + )],) + + last-page = entry.at("page-number") + }, + [#v(2em) #heading(level: 1)[APPENDIX] #v(1em)], + [#grid( + rows: 1em, + columns: (1fr, 10fr, 2fr), + align(center)[PAGE], + align(center)[SUBJECT], + align(center)[DATE] + )], + ..for entry in appendix { + ([#table( + rows: (auto), + columns: (1fr, 10fr, 2fr), + align(center)[#numbering("I", entry.at("page-number"))], + align(left)[#entry.at("title")], + align(center)[#entry.at("date").display("[month]/[day]/[year]")] + )],) + } + ) +}) \ No newline at end of file diff --git a/themes/revision/entries.typ b/themes/revision/entries.typ index 2673e18..2ee9c66 100644 --- a/themes/revision/entries.typ +++ b/themes/revision/entries.typ @@ -1,4 +1,5 @@ #import "colors.typ": * +#import "components/header.typ": header-map #let frontmatter-entry(ctx: (:), body) = { show: page.with( @@ -16,39 +17,41 @@ align(horizon+right)[#line(length: 100%)], align(top)[#context(counter(page).display("I"))], align(horizon+left)[#line(length: 100%)], - align(left)[#text(weight: "bold")[Authors:]], + if (ctx.type != "toc") { + align(left)[#text(weight: "bold")[Authors:]] + } else {[]}, [], - align(right)[#text(weight: "bold")[Date:] #ctx.date.display("[month]/[day]/[year]")] + if (ctx.date != none) { + align(right)[#text(weight: "bold")[Date:] #ctx.date.display("[month]/[day]/[year]")] + } else {[]} ) ) body } #let body-entry(ctx: (:), body) = { - let header-map = ( - "identify" : "IDENTIFY PROBLEM", - "brainstorm" : "BRAINSTORM SOLUTIONS", - "select" : "SELECT AND PLAN", - "build" : "BUILD SOLUTION", - "test" : "TEST SOLUTION", - "program" : "PROGRAM SOLUTION", - "improve" : "IMPROVE SOLUTION" - ) - show: page.with( paper: "us-letter", margin: (y: 90pt), - header: align(center)[ - #text(size:24pt)[#header-map.at(ctx.type)] \ - #grid( - rows: 10pt, - columns: (auto, auto, auto), - column-gutter: 10pt, - align(horizon+right)[#line(length: 100%)], - align(top)[#ctx.title], - align(horizon+left)[#line(length: 100%)] - ) - ], + header: + if ctx.type != none { + align(center)[ + #text(size:24pt)[#upper(header-map.at(ctx.type))] \ + #grid( + rows: 10pt, + columns: (auto, auto, auto), + column-gutter: 10pt, + align(horizon+right)[#line(length: 100%)], + align(top)[#ctx.title], + align(horizon+left)[#line(length: 100%)] + ) + ] + } else { + align(center)[ + #text(size:24pt)[#upper(ctx.title)] \ + #line(length: 100%) + ] + }, footer: grid( rows: (10pt, auto), columns: (auto, auto, auto), @@ -62,22 +65,22 @@ align(right)[#text(weight: "bold")[Date:] #ctx.date.display("[month]/[day]/[year]")] ) ) - context(if calc.even(here().position().at("page")){ + context(if calc.even(here().position().at("page")) and ctx.type != none { place(left + top, dx: -35pt, dy: -33.5pt)[ - #box(fill: color-map.at(ctx.type).transparentize(50%), height: 100% + 66pt, width: 5%)[ + #box(fill: color-map.at(ctx.type), height: 100% + 66pt, width: 5%)[ #align(horizon)[ #rotate(90deg, origin : center, reflow: true)[ - #header-map.at(ctx.type)#v(40%) + #upper(header-map.at(ctx.type))#v(40%) ] ] ] ] - } else { - place(right + top, dx: 35pt, dy: -32.5pt)[ - #box(fill: color-map.at(ctx.type).transparentize(50%), height: 100% + 66pt, width: 5%)[ + } else if ctx.type != none { + place(right + top, dx: 35pt, dy: -33.5pt)[ + #box(fill: color-map.at(ctx.type), height: 100% + 66pt, width: 5%)[ #align(horizon)[ #rotate(90deg, origin : center, reflow: true)[ - #v(40%)#header-map.at(ctx.type) + #v(40%)#upper(header-map.at(ctx.type)) ] ] ] @@ -104,7 +107,9 @@ align(horizon+left)[#line(length: 100%)], align(left)[#text(weight: "bold")[Authors:]], [], - align(right)[#text(weight: "bold")[Date:] #ctx.date.display("[month]/[day]/[year]")] + if (ctx.date != none) { + align(right)[#text(weight: "bold")[Date:] #ctx.date.display("[month]/[day]/[year]")] + } else {[]} ) ) body From 3e8b6b60d80626a9b29150df7422f9d4c4ee33c6 Mon Sep 17 00:00:00 2001 From: Deb <66920321+deb06@users.noreply.github.com> Date: Mon, 20 May 2024 19:36:17 -0400 Subject: [PATCH 7/9] =?UTF-8?q?=F0=9F=9A=A7=20working=20toc=3F=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/revision/components/toc.typ | 30 ++++++++++++++++++++++-------- themes/revision/rules.typ | 2 +- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/themes/revision/components/toc.typ b/themes/revision/components/toc.typ index 608f20d..f6deb00 100644 --- a/themes/revision/components/toc.typ +++ b/themes/revision/components/toc.typ @@ -4,6 +4,7 @@ #let toc() = utils.print-toc((frontmatter, body, appendix) => { let last-page = 0 + let previous-color stack( spacing: none, @@ -17,23 +18,35 @@ )], ..for entry in body { if entry.at("page-number") - last-page > 1 { - for i in range(entry.at("page-number") - last-page - 1) { + for i in range(entry.at("page-number") - last-page - 2) { ([#table( - stroke: (luma(120) + .5pt), - rows: (auto), + stroke: (luma(120) + 0.5pt), + rows: (18pt), columns: (1fr, 10fr, 2fr), align(center)[#(last-page + i + 1)], - [#place(dy: -4.7pt, dx: +40pt)[#line(angle:90deg, length: 17.3pt, stroke: (2pt + black))]] + align(horizon)[#place(dx: 35pt)[#rect(height: 18.5pt, width: 1pt, fill: black, stroke: 0pt)]], + [] )],) } + let i = entry.at("page-number") - last-page -1 + ([#table( + stroke: (luma(120) + 0.5pt), + rows: (18pt), + columns: (1fr, 10fr, 2fr), + align(center)[#(last-page + i + 1)], + align(horizon)[#place(dx: 35pt, dy: -4.25pt)[#rect(height: 10pt, width: 1pt, fill: black, stroke: 0pt)#place(center)[#rotate(180deg)[#polygon.regular(size: 5pt, fill: black)]]]], + [] + )],) } ([#table( - stroke: (luma(120) + .7pt), - rows: (auto), + stroke: (luma(120) + 0.5pt), + rows: (18pt), columns: (1fr, 10fr, 2fr), align(center)[#entry.at("page-number")], if entry.at("type") != none { - align(left)[#header-map.at(entry.at("type")): #entry.at("title")] + previous-color = color-map.at(entry.at("type")) + align(left)[#highlight(fill: previous-color, radius: 2pt, extent: 2pt)[ + #header-map.at(entry.at("type"))] #h(2pt)$->$ #entry.at("title")] } else { align(left)[#entry.at("title")] }, @@ -52,7 +65,8 @@ )], ..for entry in appendix { ([#table( - rows: (auto), + stroke: (luma(120) + 0.5pt), + rows: (18pt), columns: (1fr, 10fr, 2fr), align(center)[#numbering("I", entry.at("page-number"))], align(left)[#entry.at("title")], diff --git a/themes/revision/rules.typ b/themes/revision/rules.typ index 054110d..95d6a39 100644 --- a/themes/revision/rules.typ +++ b/themes/revision/rules.typ @@ -1,5 +1,5 @@ #let rules(doc) = { - set text(font: "Roboto", size: 12pt) + set text(font: "linux libertine", size: 12pt) set page("us-letter") // Enforce the correct font on Excalidraw drawings From 0820ff43700702cf3b1a63ae1f50abbcc53934d6 Mon Sep 17 00:00:00 2001 From: Deb <66920321+deb06@users.noreply.github.com> Date: Mon, 20 May 2024 23:29:59 -0400 Subject: [PATCH 8/9] =?UTF-8?q?=F0=9F=9A=A7=20Implemented=20components?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/revision/components/components.typ | 9 +++-- .../revision/components/decision-matrix.typ | 34 +++++++++++++++++++ themes/revision/components/gantt-chart.typ | 0 themes/revision/components/header.typ | 6 +++- themes/revision/components/pro-con.typ | 21 ++++++++++++ themes/revision/components/result-table.typ | 0 themes/revision/components/tournament.typ | 0 7 files changed, 66 insertions(+), 4 deletions(-) create mode 100644 themes/revision/components/gantt-chart.typ create mode 100644 themes/revision/components/result-table.typ create mode 100644 themes/revision/components/tournament.typ diff --git a/themes/revision/components/components.typ b/themes/revision/components/components.typ index 7aef1d6..a29fa14 100644 --- a/themes/revision/components/components.typ +++ b/themes/revision/components/components.typ @@ -1,5 +1,8 @@ -#import "./toc.typ": * +#import "./decision-matrix.typ": * +#import "./gantt-chart.typ": * #import "./glossary.typ": * +#import "./header.typ": * #import "./pro-con.typ": * -#import "./decision-matrix.typ": * -#import "./header.typ": * \ No newline at end of file +#import "./result-table.typ": * +#import "./toc.typ": * +#import "./tournament.typ": * \ No newline at end of file diff --git a/themes/revision/components/decision-matrix.typ b/themes/revision/components/decision-matrix.typ index e69de29..c15d0d6 100644 --- a/themes/revision/components/decision-matrix.typ +++ b/themes/revision/components/decision-matrix.typ @@ -0,0 +1,34 @@ +#import "/utils.typ" +#import "/packages.typ": tablex +#import "/themes/revision/colors.typ": * +#import tablex: * + +#let decision-matrix(properties: none, ..choices) = { + let data = utils.calc-decision-matrix(properties: properties, ..choices) + rect(inset: 0.5pt)[ + #table( + stroke: (), + inset: 0.75em, + columns: properties.len() + 2, + rows: auto, + [], + ..for property in properties { + (align(center)[#property.name],) + }, + align(center)[Total], + ..for choice in data { + if choice.values.total.highest {( + table.cell(fill: green)[#align(center)[#choice.name]], + ..for value in choice.values {( + table.cell(fill: green)[#align(center)[#value.at(1).value]], + )} + ,)} else {( + align(center)[#choice.name], + ..for value in choice.values {( + align(center)[#value.at(1).value], + )} + ,)} + }, + ) + ] +} \ No newline at end of file diff --git a/themes/revision/components/gantt-chart.typ b/themes/revision/components/gantt-chart.typ new file mode 100644 index 0000000..e69de29 diff --git a/themes/revision/components/header.typ b/themes/revision/components/header.typ index 38f3878..05c912b 100644 --- a/themes/revision/components/header.typ +++ b/themes/revision/components/header.typ @@ -6,4 +6,8 @@ "test" : "Test Solution", "program" : "Program Solution", "improve" : "Improve Solution" -) \ No newline at end of file +) + +#let header(title) = { + rect(height: auto, width: auto)[=== #title] +} \ No newline at end of file diff --git a/themes/revision/components/pro-con.typ b/themes/revision/components/pro-con.typ index e69de29..61d3e44 100644 --- a/themes/revision/components/pro-con.typ +++ b/themes/revision/components/pro-con.typ @@ -0,0 +1,21 @@ +#import "/themes/revision/colors.typ": * + +#let pro-con(pros: [], cons: []) = { + table( + columns: (50%, 50%), + inset: 0.75em, + fill: (col, row) => + if row == 0 { + if col == 0 { + green + } + if col == 1 { + red + } + }, + align(left)[Positives], + align(left)[Negatives], + pros, + cons + ) +} \ No newline at end of file diff --git a/themes/revision/components/result-table.typ b/themes/revision/components/result-table.typ new file mode 100644 index 0000000..e69de29 diff --git a/themes/revision/components/tournament.typ b/themes/revision/components/tournament.typ new file mode 100644 index 0000000..e69de29 From 90eb621d1615c85b9213a054541d5318864d6ad5 Mon Sep 17 00:00:00 2001 From: Deb <66920321+deb06@users.noreply.github.com> Date: Tue, 21 May 2024 19:33:34 -0400 Subject: [PATCH 9/9] =?UTF-8?q?=F0=9F=9A=A7=20It's=20notebookin=20time?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/revision/colors.typ | 4 +- .../revision/components/decision-matrix.typ | 2 +- themes/revision/components/gantt-chart.typ | 93 +++++++++++++++++++ themes/revision/components/glossary.typ | 25 +++++ themes/revision/components/pro-con.typ | 2 +- themes/revision/components/result-table.typ | 7 ++ themes/revision/components/toc.typ | 2 +- themes/revision/revision.typ | 1 + 8 files changed, 131 insertions(+), 5 deletions(-) diff --git a/themes/revision/colors.typ b/themes/revision/colors.typ index eb1d09b..4ea284a 100644 --- a/themes/revision/colors.typ +++ b/themes/revision/colors.typ @@ -11,7 +11,7 @@ "brainstorm" : orange, "select" : yellow, "build" : green, - "test" : blue, - "program" : indigo, + "program" : blue, + "test" : indigo, "improve" : violet, ) \ No newline at end of file diff --git a/themes/revision/components/decision-matrix.typ b/themes/revision/components/decision-matrix.typ index c15d0d6..e53be83 100644 --- a/themes/revision/components/decision-matrix.typ +++ b/themes/revision/components/decision-matrix.typ @@ -1,6 +1,6 @@ #import "/utils.typ" #import "/packages.typ": tablex -#import "/themes/revision/colors.typ": * +#import "../colors.typ": * #import tablex: * #let decision-matrix(properties: none, ..choices) = { diff --git a/themes/revision/components/gantt-chart.typ b/themes/revision/components/gantt-chart.typ index e69de29..4bd8110 100644 --- a/themes/revision/components/gantt-chart.typ +++ b/themes/revision/components/gantt-chart.typ @@ -0,0 +1,93 @@ +#import "/packages.typ": timeliney +#import "../colors.typ": * + +#let gantt-chart( + start: datetime, + end: datetime, + date-interval: 1, + date-format: "[month]/[day]", + tasks: (), + goals: none, +) = { + timeliney.timeline( + spacing: 5pt, + + show-grid: true, + grid-style: (stroke: (dash: none, thickness: .2pt, paint: black)), + + tasks-vline: true, + line-style: (stroke: 0pt), + + milestone-overhang: 3pt, + milestone-layout: "in-place", + box-milestones: true, + milestone-line-style: (stroke: (dash: none, thickness: 1pt, paint: black)), + { + import timeliney: * + + let difference = end - start + let dates-array = () + let months-array = () + let month-len = 0 + let last-month = start.month() + let next + + for value in range(int((difference.days())/date-interval)+1) { + next = start + duration(days: (value*date-interval)) + dates-array.push(group(((next).display(date-format),1))) + if next.month() == last-month { + month-len += 1 + last-month = next.month() + } else { + months-array.push(group(((datetime(year: next.year(), month: last-month, day: 1)).display("[month repr:long]"),month-len))) + month-len = 1 + last-month = next.month() + } + } + months-array.push(group(((datetime(year: next.year(), month: last-month, day: 1)).display("[month repr:long]"),month-len))) + + headerline(..months-array) + headerline(..dates-array) + + let goal-color + + if goals != none { + for goal in goals { + if goal.len() == 2 { + goal-color = none + } else { + goal-color = goal.at(2) + } + milestone( + at: goal.at(1), + style: (stroke: 0pt), + [ + #place(center, dy: -8pt)[#line(angle: 90deg, length: 6pt)] + #box(fill: goal-color, outset: 3pt, radius: 1.5pt)[#goal.at(0)] + ], + ) + } + } + + let colors = (red, orange, yellow, green, blue, violet) + let index = 0 + let size = difference.days()/date-interval + let pos = () + + taskgroup({ + for item in tasks { + pos = (item.at(1).at(0)+0.054, item.at(1).at(1)-0.054) + if item.len() == 2 { + if index == colors.len()-1 { + index = 0 + } + task(item.at(0), pos, style: (stroke: (paint: colors.at(index), thickness: 5pt, cap: "square"))) + index += 1 + } else { + task(item.at(0), pos, style: (stroke: (paint: item.at(2), thickness: 5pt, cap: "square"))) + } + } + }) + } + ) +} diff --git a/themes/revision/components/glossary.typ b/themes/revision/components/glossary.typ index e69de29..b398546 100644 --- a/themes/revision/components/glossary.typ +++ b/themes/revision/components/glossary.typ @@ -0,0 +1,25 @@ +#import "/utils.typ" + +#let glossary() = utils.print-glossary(glossary => { + stack( + spacing: 2em, + dir: ttb, + [#grid( + rows: 1em, + columns: (25%, 75%), + + align(left)[TERM], + align(left)[DEFENITION], + )], + ..for entry in glossary { + ([ + #grid( + columns: (25%, 75%), + rows: auto, + [=== #entry.word], + [#entry.definition] + ) + ],) + } + ) +}) diff --git a/themes/revision/components/pro-con.typ b/themes/revision/components/pro-con.typ index 61d3e44..1ffe69c 100644 --- a/themes/revision/components/pro-con.typ +++ b/themes/revision/components/pro-con.typ @@ -1,4 +1,4 @@ -#import "/themes/revision/colors.typ": * +#import "../colors.typ": * #let pro-con(pros: [], cons: []) = { table( diff --git a/themes/revision/components/result-table.typ b/themes/revision/components/result-table.typ index e69de29..137b72a 100644 --- a/themes/revision/components/result-table.typ +++ b/themes/revision/components/result-table.typ @@ -0,0 +1,7 @@ +#let result-table( + trial-count: 1, + subject: (), + data: () +) = { + table() +} \ No newline at end of file diff --git a/themes/revision/components/toc.typ b/themes/revision/components/toc.typ index f6deb00..1d3c547 100644 --- a/themes/revision/components/toc.typ +++ b/themes/revision/components/toc.typ @@ -8,7 +8,7 @@ stack( spacing: none, - [#heading(level: 1)[ENTRIES] #v(1em)], + [#heading(level: 1)[ENTRIES]#v(1em)], [#grid( rows: 1em, columns: (1fr, 10fr, 2fr), diff --git a/themes/revision/revision.typ b/themes/revision/revision.typ index e458adb..ff6d032 100644 --- a/themes/revision/revision.typ +++ b/themes/revision/revision.typ @@ -1,5 +1,6 @@ #import "./entries.typ": * #import "./rules.typ": * +#import "colors.typ": * #import "./components/components.typ" #let revision-theme = (