numbered todos and todo-list
parent
f80a8573d3
commit
d4b11cd25c
23
lib.typ
23
lib.typ
|
|
@ -1,5 +1,23 @@
|
|||
#import "@preview/gviz:0.1.0": *
|
||||
|
||||
#let todo-list = state("todo-list",())
|
||||
|
||||
#let todo(content) = context {
|
||||
let todonum = todo-list.get().len() + 1
|
||||
text(weight: "bold", fill: red, [TODO n°#todonum #label("todo-"+str(todonum)): #content])
|
||||
todo-list.update(x => x + (("todo-"+str(x.len()+1),x.len()+1, content),))
|
||||
}
|
||||
|
||||
#let todos() = context {
|
||||
pagebreak(weak: true)
|
||||
[= TO-DOs]
|
||||
for t in todo-list.final() {
|
||||
let l = label(t.first())
|
||||
list.item(link(l)[TODO n°#t.at(1) p.#locate(l).page() : #t.last()])
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#let notes-template(doc) = [
|
||||
#show raw.where(lang: "dot-render"): it => render-image(it.text)
|
||||
#show raw.where(lang: "digraphLR"): it => render-image("digraph mygraph { rankdir=\"LR\";" + it.text + "}")
|
||||
|
|
@ -7,8 +25,5 @@
|
|||
#show raw.where(lang: "graphLR"): it => render-image("graph mygraph { rankdir=\"TB\";" + it.text + "}")
|
||||
#show raw.where(lang: "graphTB"): it => render-image("graph mygraph { rankdir=\"TB\";" + it.text + "}")
|
||||
#doc
|
||||
#todos
|
||||
]
|
||||
|
||||
#let todo(content) = {
|
||||
text(weight: "bold", fill: red, [{TODO : #content}])
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue