jez / pandoc-sidenote

Convert Pandoc Markdown-style footnotes into sidenotes
MIT License
136 stars 17 forks source link

Add Text.Pandoc.SideNoteHTML #26

Closed slotThe closed 2 months ago

slotThe commented 1 year ago

A new module, which renders sidenotes directly as HTML, allowing the embedding of arbitrary blocks inside them. I think this is the best overall solution, as it's 100% backwards compatible, yet still exposes this functionality to the user somehow.

The writer issues mentioned by you here are dealt with by not exposing this as a standalone executable, but only as a library (to be used by e.g. Hakyll), and requiring the user to specify their WriterOptions upfront. I've also put the (massive) pandoc dependency behind a flag, so only people wanting to use this functionality have to pay that price.

Related: https://github.com/jez/pandoc-sidenote/issues/4

NOTE: I've only tested with with GHC 9.2.5 (stackage lts-20.0)

Commit Summary

Add Text.Pandoc.SideNoteHTML

A new module that works much like Text.Pandoc.SideNote, but immediately converts the notes into HTML. This allows us to embed arbitrary blocks into the side and marginnotes (not being restricted to spans anymore), but requires that the user specifies their WriterOptions upfront. As such, the module may only be used as a library.

cabal: Add html-sidenotes flag

The dependency on pandoc greatly increases the footprint of the library, which may be unwanted by many users. As such, keep the new Text.Pandoc.SideNoteHTML module behind an aptly name flag, such that this is somewhat contained.