BlogLiterately-diagrams: Include images in blog posts with inline diagrams code

[ bsd3, library, program, web ] [ Propose Tags ]

A plugin for BlogLiterately ( which turns inline diagrams code into images. This library also provides an executable, BlogLiteratelyD, providing a standard instance of BlogLiterately extended with support for inline diagrams code (and also including a pass to center block-level images). For most users it should suffice to simply use BlogLiteratelyD in place of BlogLiterately.

To use it, include code blocks with the dia or dia-def class (using pandoc's special extended Markdown syntax (, or BlogLiterately's extended syntax for tagged code blocks (, like so:

    -- This block produces no output but its
    -- declarations will be in scope in all the
    -- rest of the diagram blocks.

    gSq = square 1 # fc green

NOTE: Square brackets below should be replaced
by curly braces.  Haddock chokes on curly

Here is a green square:

```[.dia width='200']
dia = gSq

Green squares like `gSq`[.dia height='16']
and blue circles like `circle 1 # fc blue`[.dia height='16']
are extremely important.

Note that attributes like width and height can also be specified, but be sure to put the numbers in quotes or else they will not parse properly.

Running this through BlogLiteratelyD (after replacing square brackets with curly braces) should result in HTML that looks something like this:

Versions,, 0.1.1,,, 0.1.2,,,,, 0.1.3,, 0.1.4,,,, 0.2,,,,,,
Dependencies base (>=4.3 && <4.6), BlogLiterately (>=0.5.2 && <0.6), BlogLiterately-diagrams, containers, diagrams-builder (==0.2.*), diagrams-cairo (==0.5.*), diagrams-lib (==0.5.*), filepath, pandoc (==1.9.*), safe (==0.3.*) [details]
License BSD-3-Clause
Copyright Copyright 2012 Brent Yorgey
Author Brent Yorgey
Category Web
Source repo head: darcs get
Uploaded by BrentYorgey at Mon Aug 27 12:56:57 UTC 2012
Distributions NixOS:
Executables BlogLiteratelyD
Downloads 9665 total (39 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]
Hackage Matrix CI




Maintainer's Corner

For package maintainers and hackage trustees