main
 1#import "@preview/bullseye:0.1.0": match-target
 2
 3/// Side notes.
 4///
 5/// - content (content):
 6/// - block (boolean): Whether to render as a block element. Default is `false`.
 7///   - When `block: false`:
 8///     - In HTML output with `block: false`, it just like footnotes in web but no numbering,
 9///     wrapped in a span with class "sidenote".
10///     - In PDF output, it will be a footnotes without numbering.
11///   - When `block: true`:
12///     - In HTML output with `block: true`, it will be wrapped in a div with class "sidenote".
13///     - In PDF output, it will be a normal content wrapped in `#block()`.
14/// -> content
15#let sidenote(content, block: false) = context {
16  match-target(
17    html: {
18      if block {
19        html.div(
20          class: "sidenote",
21          content,
22        )
23      } else {
24        html.span(
25          class: "sidenote",
26          content,
27        )
28      }
29    },
30    paged: {
31      if block { std.block(content) } else {
32        footnote(numbering: (..i) => "", content)
33      }
34    },
35  )
36}
37}