Skip to content

Draft: Literate Haskell Examples

Athan Clark requested to merge literate-haskell-examples-20210801 into master

This MR's primary goal is to add literate haskell (.lhs) versions of the examples, and include their source code to the main website. There are other issues fixed in this MR as well. Listed below are the details:

  • Convert a few examples/ to well documented .lhs versions (currently Counter.lhs, Calculator.lhs, Animation.lhs, and Lens.lhs, also adding HelloWorld.lhs).
  • Add the capability to include a .lhs file as Html, via embedLhs (analogous to Shpadoinkle-template's embedAsciidoc). This uses Pandoc, and a custom version of HXT, to make the embedded Html more consistent with asciidoc's output.
  • Remove automatic html ampersand decoding (i.e. turning &lt; to <) from embedHtml, and add it to applicable backends instead (Shpadoinkle-backend-static does not need it). This also adds a function decodeHtml in core/, which avoids using the package html-entities on GHCjs, as it will cause a stack overflow during linking. This fixes #140 (closed).
  • Adjust ParDiffT to not expose its internal TVar as a MonadReader parameter - this fixes #138 (closed).
  • Adjust Shpadoinkle-backend-pardiff's stage function to be exactly the same as Shpadoinkle-backend-snabbdom - clear <body> before adding content, making behavior more consistent between the two, and fixing #139 (closed).
  • Adjust Shpadoinkle-backend-pardiff and Shpadoinkle-backend-snabbdom to use <body> directly, rather than a needless <div id="stage"> node.
  • Adds the .lhs examples to the website/.
  • Fixes snowman's reference to github.com/athanclark/jsaddle.git
  • Fixes snowman's reference to http://localhost:8080 (instead of https://localhost:8080)
  • Fixes #142 by calling highlight.js-cli on HTML files statically before being imported with embedHtml
Edited by Athan Clark

Merge request reports