Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add list of notes #11

Open
th1j5 opened this issue Apr 6, 2024 · 2 comments
Open

Add list of notes #11

th1j5 opened this issue Apr 6, 2024 · 2 comments

Comments

@th1j5
Copy link

th1j5 commented Apr 6, 2024

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!

@feuermandel
Copy link

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

@ntjess
Copy link
Owner

ntjess commented May 6, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants