use drafting module instead of custom todo

This commit is contained in:
Jean-Marie Mineau 2025-07-18 15:35:44 +02:00
parent acd42c4f62
commit 1652652d03
Signed by: histausse
GPG key ID: B66AEEDA9B645AD2
3 changed files with 29 additions and 2 deletions

View file

@ -2,7 +2,7 @@
#import "cover.typ": cover #import "cover.typ": cover
#import "abstracts.typ": abstracts #import "abstracts.typ": abstracts
#import "todos.typ": todos, show-todos #import "todos.typ": todos, show-todos, show-notes
#import "etablissements.typ": * #import "etablissements.typ": *
#let matisse-thesis( #let matisse-thesis(
@ -45,6 +45,7 @@
todos() todos()
} else { } else {
show-todos.update(false) show-todos.update(false)
show-notes.update(false)
} }
// ---------- GENERAL ---------- // ---------- GENERAL ----------

View file

@ -1,5 +1,28 @@
#let todo-list = state("todo-list",()) #import "@preview/drafting:0.2.2": inline-note, note-outline, margin-note
#let show-todos = state("show-todos", true) #let show-todos = state("show-todos", true)
#let show-notes = state("show-notes", true)
#let todo(color: red, content) = context {
if show-todos.get() {
inline-note(par-break: false, stroke: (paint: color, dash: "dashed"))[#text(fill: color)[TODO]: #content]
}
}
#let todos() = context {
if show-todos.get() or show-notes.get() {
note-outline()
}
}
#let note(body, dy: auto, ..kwargs) = context {
if show-notes.get() {
margin-note(body, dy: dy, ..kwargs)
}
}
/*
#let todo-list = state("todo-list",())
#let todo(color: red, content) = context { #let todo(color: red, content) = context {
if show-todos.get() { if show-todos.get() {
@ -43,3 +66,4 @@
} }
} }
} }
*/

View file

@ -63,6 +63,8 @@
#todo[Write an introduction] #todo[Write an introduction]
#note(stroke: aqua + 3pt)[Something to comment about][a note]
#lorem(200) #lorem(200)
#figure( #figure(