hakyll-diagrams

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

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

Stackage Nightly 2026-02-05:0.1.0.2
Latest on Hackage:0.1.0.2

See all snapshots hakyll-diagrams appears in

BSD-3-Clause licensed by Renato Garcia
Maintained by [email protected]
This version can be pinned in stack with:hakyll-diagrams-0.1.0.2@sha256:31b3f9765335023565cab74061b09ac4948ff11a9b04ba928e7b6d7de886d4af,3270

Module documentation for 0.1.0.2

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.