@hackage / hakyll-diagrams

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

Latest0.1.0.3

About

Metadata

  • Last updated , by renato_garcia
  • License BSD-3-Clause
  • Categories Web Development
  • Maintained by: fgarcia.renato@gmail.com

  • Lottery factor: 1

Links

Installation

Tested Compilers

  1. 9.12.2
  2. 9.4.8

Readme

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.