I have a Happstack program that dynamically converts Markdown documents to HTML using Text.Pandoc
:
import qualified Text.Pandoc as Pandoc
...
return $ toResponse $ Pandoc.writeHtml Pandoc.def contents
I.e. Pandoc is returning a Text.Blaze.Html.Html
value. (This has a ToMessage
instance which means it can be used as a response to a request.)
How do I insert a custom CSS stylesheet into Pandoc's output? What if I want to customise the HTML e.g. by wrapping the <body>
contents with some other elements?
block, since I don't want to modify my markdown files, but still want to add the element properly... using `pandoc -D html > template.html` and then modifying the template to my taste (mainly adding `style="display:none"` to the `title-block-header` element, and compiling with `pandoc -s --template ./template.html --metadata title="$title" "$oldname" -o "$newname"` solved all my drama.
– mazunki Jul 22 '21 at 22:02