diff --git a/CHANGELOG.md b/CHANGELOG.md index 70a2e38..18224f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ ## [Unreleased] +### Added +- Added `signal` option for `todo` + ## [0.5.1] - 2026-04-03 ### Fixed diff --git a/src/todo.typ b/src/todo.typ index 2904d1e..92978d2 100644 --- a/src/todo.typ +++ b/src/todo.typ @@ -67,6 +67,12 @@ /// ``` /// -> function todo-box: todo-box, + /// Signal the warning to the context. + /// + /// Set this to `false` to disable triggering global/task warning boxes. + /// + /// -> bool + signal: true, /// Arbitrary content that is passed into the box. /// /// You can only pass _positional_ arguments. @@ -74,7 +80,9 @@ /// -> arguments ..comments, ) = { - counter("sheetstorm-todo").step() - counter("sheetstorm-global-todo").step() + if signal { + counter("sheetstorm-todo").step() + counter("sheetstorm-global-todo").step() + } todo-box(..comments) } diff --git a/tests/todo-signalling/.gitignore b/tests/todo-signalling/.gitignore new file mode 100644 index 0000000..8e21a98 --- /dev/null +++ b/tests/todo-signalling/.gitignore @@ -0,0 +1,4 @@ +# generated by tytanic, do not edit + +/diff/ +/out/ diff --git a/tests/todo-signalling/ref/1.png b/tests/todo-signalling/ref/1.png new file mode 100644 index 0000000..4abf018 Binary files /dev/null and b/tests/todo-signalling/ref/1.png differ diff --git a/tests/todo-signalling/test.typ b/tests/todo-signalling/test.typ new file mode 100644 index 0000000..b566b04 --- /dev/null +++ b/tests/todo-signalling/test.typ @@ -0,0 +1,11 @@ +#import "@local/sheetstorm:0.5.1": assignment, task, todo + +#show: assignment + +#task[ + #todo(signal: false) +] + +#task[ + #todo(signal: true) +]