Skip to content

Commit

Permalink
help: remove inline help
Browse files Browse the repository at this point in the history
  • Loading branch information
lace-wing committed Jan 13, 2025
1 parent 13a2671 commit 53d65d7
Show file tree
Hide file tree
Showing 15 changed files with 659 additions and 631 deletions.
5 changes: 5 additions & 0 deletions packages/preview/lacy-ubc-math-project/0.1.0/cleanup.nu
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
(ls).name
| where (str ends-with ".pdf")
| each {|el| if $el != "manual.pdf" { rm $el } }

rm template/*.pdf
64 changes: 0 additions & 64 deletions packages/preview/lacy-ubc-math-project/0.1.0/format.typ
Original file line number Diff line number Diff line change
Expand Up @@ -137,67 +137,3 @@
]
}

#let get-orientation(dir) = {
if dir == ltr {
return (
dir: ltr,
cols: (1fr, 1fr),
align: (x, y) => horizon + (right, left).at(calc.rem(x, 2)),
line: grid.vline,
)
} else if dir == ttb {
return (
dir: ttb,
cols: 1,
align: (x, y) => (bottom, top).at(calc.rem(y, 2)),
line: grid.hline,
)
}
}

#let showcode(code, dir: ltr) = {
import "@preview/showman:0.1.2": runner
let prefix-orig = (
"#import \"@preview/lacy-ubc-math-project:0.1.0\": *",
"#let __example-question-counters = range(1, unsafe.__max-qs-level + 1).map(i => counter(\"example-question-\" + str(i)))",
"#for c in __example-question-counters {",
" c.update(1)",
"}",
"#let __example-question-labels = (\"ex:1\", \"a\", \"i\",)",
"#set text(font: (\"DejaVu Serif\", \"New Computer Modern\"))",
"#let question = question.with(counters: __example-question-counters, labels: __example-question-labels)",
"#set math.equation(numbering: \"(1.1)\")",
"#show: equate.with(breakable: true, sub-numbering: true)",
).join("\n")
let suffix-orig = ""
let orientation = get-orientation(dir)
let prefix = prefix-orig
let suffix = suffix-orig
if code.lang == "typc" {
prefix = prefix + "\n#{"
suffix = "}\n" + suffix
}

runner.standalone-example(
code,
eval-prefix: prefix,
eval-suffix: suffix,
direction: orientation.dir,
container: (input, output, direction: ltr) => {
block(
// breakable: false,
width: 100%,
grid(
columns: orientation.cols,
align: orientation.align,
inset: (x: 1em, y: 0.8em),
grid.cell(input),
orientation.at("line")(stroke: 0.5pt),
grid.cell(output),
),
)
},
)
}


3 changes: 2 additions & 1 deletion packages/preview/lacy-ubc-math-project/0.1.0/lib.typ
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
#import "format.typ": author, question, solution, green-solution
#import "shorthand.typ": *
#import "drawing.typ" as drawing
#import "help.typ": help

// #import "help.typ": help

#import "unsafe.typ" as unsafe

Expand Down
Binary file modified packages/preview/lacy-ubc-math-project/0.1.0/manual.pdf
Binary file not shown.
Loading

0 comments on commit 53d65d7

Please sign in to comment.