-
Notifications
You must be signed in to change notification settings - Fork 21
Closed
Labels
Description
I'd like to render LaTeX diagrams into images that are then inserted into the output. I have a function of the following form:
-- | Render some LaTeX content to an image whose filename is the
-- hash of the content. Return the path to the image.
renderToFile :: Text -> IO FilePath
renderToFile latex = do
...
pure savePathI think the interface I would like is to interpret code-blocks with some particular infostring (e.g. render-latex) as LaTeX to be rendered into a PNG. If blockRenderM existed, I could just do
renderLatexExt :: Extension
renderLatexExt = blockRenderM $ \case
CodeBlock (Just "render-latex") content
-> (\uri -> Image undefined uri Nothing) <$> renderToFile content
x -> pure xor something.