emanote icon indicating copy to clipboard operation
emanote copied to clipboard

Obsidian-style callouts

Open srid opened this issue 2 years ago • 4 comments

Spec: https://help.obsidian.md/Editing+and+formatting/Callouts

Discussion: https://github.com/srid/emanote/discussions/307

Progress

  • [x] Basic callouts #466
  • [ ] [bug] Don't render footnotes inside of callout (they are already rendered in the page)
  • [x] Support the rest of callout types
  • [ ] Nested callouts
  • [ ] Foldable callouts

Tangential

  • [ ] Should we switch to using https://github.com/jgm/commonmark-hs/pull/135 ? cf. https://github.com/srid/emanote/pull/496

srid avatar Dec 04 '23 20:12 srid

One way to implement this (especially as Pandoc AST is not flexible enough) is by having heist-extra generate the same HTML div structure as Obsidian's publish:

https://github.com/srid/heist-extra/blob/54ff970f733dd45b5509d1c4c298927b6241041b/src/Heist/Extra/Splices/Pandoc/Render.hs#L67-L69

image image

And then style it in CSS separately.

srid avatar Dec 04 '23 20:12 srid

Actually we could just implement it as a PandocBlockRenderer (much like how embed wikilinks, queries, etc. are done)

https://github.com/srid/emanote/blob/ea2dca29a92430572048eb5ad5f018b0e66c42bc/emanote/src/Emanote/Pandoc/Renderer/Query.hs#L25-L41

srid avatar Dec 04 '23 20:12 srid