typst-drafting icon indicating copy to clipboard operation
typst-drafting copied to clipboard

Add list of notes

Open th1j5 opened this issue 1 year ago • 2 comments

I use typst drafting as the typst equivalent of todonotes. I'd like to maybe make a list of the notes which were added? Something like the \listoftodos in Latex todonotes... This functionality is also present in this typst package: https://typst.app/universe/package/big-todo, but drafting is much nicer to use, due to the margin notes...

If you think this is in scope of the package, I might look for a PR, but I would need to do some research (pretty new to typst).

Thanks for the package!

th1j5 avatar Apr 06 '24 13:04 th1j5

I'd like to support @th1j5. This would be a great feature.

feuermandel avatar Apr 30 '24 18:04 feuermandel

I think this would be a valuable addition. If you are interested in creating a PR, here is some starter code that may help:

#import "@preview/drafting:0.2.0": set-page-properties, margin-note, margin-note-defaults

#place(set-page-properties())

#lorem(10)
#margin-note[Test]

#lorem(15)
#margin-note(stroke: blue)[Another note]

#context {
  for note in query(<margin-note>) {
    note
  }
}

#line(length: 100%)

#context {
  for note in query(<margin-note>) {
    box(stroke: note.stroke.paint, width: 1em, height: 1em)
    h(0.5em)
    note.body
    linebreak()
  }
}

image

It would be worth thinking about:

  • How this behaves with inline par-break: false notes
  • What customization options should exist
  • Whether anything in the implementation should change to expose more useful properties

ntjess avatar May 06 '24 12:05 ntjess