This commit is contained in:
Jean-Marie Mineau 2025-06-12 11:51:21 +02:00
parent a1a6d7cff8
commit 1b5d007289
Signed by: histausse
GPG key ID: B66AEEDA9B645AD2
5 changed files with 43 additions and 6 deletions

View file

@ -1,10 +1,22 @@
#let todo-list = state("todo-list",())
#let show-todos = state("show-todos", true)
#let todo(done: false, content) = context {
if (not done) and (show-todos.get()) {
#let todo(color: red, content) = context {
if show-todos.get() {
let todonum = todo-list.get().len() + 1
text(weight: "bold", fill: red, [TODO #todonum #label("todo-"+str(todonum)): #content])
box(
text(font: "DejaVu Sans Mono", white, size: .5em)[
TODO #todonum #label("todo-"+str(todonum))
],
inset: 3pt, fill: color,
)
text(weight: "bold", fill: color)[
#box(text($triangle.filled.r$, size: .8em), baseline: -.8mm)
_ #content _
#box(text($triangle.filled.l$, size: .8em), baseline: -.8mm)
]
todo-list.update(x => x + (("todo-"+str(x.len()+1),x.len()+1, content),))
}
}