Literate Haskell to Jupyter notebook

Hi!

This is a little example-repo on how to use pandoc to produce html, markdown and Jupyter notebooks from literate haskell files.

I think this could be useful for people writing haskell blog posts and who want to share them as usable haskell file via ghci or ihaskell. Notice that there is nothing fancy going on, actually Hakyll is already capable of converting lhs to html (considering that markdown + lhs has some special syntax edge cases), what I haven’t found on internet is the lhs to jupyter part, which I think is very insteresting if you want to convert your blog into a ihaskell notebook (for example via mybinder)

The repo includes a small pandoc’s filter necessary to convert from Literate Haskell files to Jupyter notebook. The filter is really simple it just changes the CodeBlock class from ["haskell", "literate"] to ["code"], so I wonder If there is a command line option to do this, instead of using a lua-filter.

4 Likes