hakyll-diagrams

A Hakyll plugin for rendering diagrams figures from embedded Haskell code.

https://github.com/renatoGarcia/hakyll-diagrams

Latest on Hackage:0.1.0.2

This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow stackage.org to host generated Haddocks.

BSD-3-Clause licensed by Renato Garcia
Maintained by [email protected]

Compiles any Haskell diagrams code embedded in input source files (Markdown, reStructuredText, etc.), replacing them with the rendered diagrams figures in the generated HTML output. The diagrams figures can be inlined as SVG code or referenced as external .svg image files using <img> tags.

For example, when processing a Markdown input source file, a code block like this:

``` diagram { svg:width=300 }
let
  target = mconcat
    [ circle 1 # lw 0 # fc red
    , circle 2 # lw 0 # fc white
    , circle 3 # lw 0 # fc red
    ]

  background = roundedRect 8 8 0.1
    # lw 0
    # fc (sRGB24read "#808080")
    # opacity 0.15

in target <> background
```

will be replaced in the resulting HTML page by this figure:

A thoughtful documentation with usage examples and results can be found at the project repository.