BlogLiterately-diagrams

Include images in blog posts with inline diagrams code

LTS Haskell 9.14:0.2.0.5
Stackage Nightly 2017-07-25:0.2.0.5
Latest on Hackage:0.2.0.5
BSD3 licensed by Brent Yorgey
Maintained by byorgey@gmail.com

Module documentation for 0.2.0.5

A plugin for BlogLiterately (http://hackage.haskell.org/package/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. 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 (http://johnmacfarlane.net/pandoc/demo/example9/pandocs-markdown.html), or BlogLiterately's extended syntax for tagged code blocks (http://byorgey.wordpress.com/blogliterately/)), like so:

    [dia-def]
    -- 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
braces.

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:

In addition to simple diagrams, IO actions producing diagrams may also be used. In that case the IO action will simply be run, and the resulting diagram rendered. This can be useful, for example, when producing a diagram built from some external data or using randomness.

Changes

* 0.2.0.5 (3 December 2016)

- allow `base-4.9`
- allow `pandoc-1.19`

* 0.2.0.4 (28 November 2016)

updates for diagrams-1.4 etc:

- allow `diagrams-lib-1.4`
- allow `diagrams-rasterific-1.4`
- allow `diagrams-builder-0.8`
- allow `pandoc-1.18`

* 0.2.0.3 (22 March 2016)

- Allow pandoc-1.17

* 0.2.0.2 (5 January 2016)

- Require pandoc-1.16

* 0.2.0.1 (11 July 2015)

- Allow pandoc-1.15

* 0.2 (7 May 2015)

- Switch from diagrams-cairo to diagrams-rasterific
- Update to diagrams-1.3
- Allow base-4.8

* 0.1.4.3 (5 June 2014)

- Allow diagrams-lib-1.2
- Allow diagrams-cairo-1.2
- Allow diagrams-builder-0.6

* 0.1.4.2: 9 March 2014

- Allow diagrams-lib-1.1 and diagrams-cairo-1.1

* 0.1.4.1: 6 February 2014

- Require diagrams-lib >= 1.0.1
- Require diagrams-cairo >= 1.0.1

* 0.1.4: 27 January 2014

- Require diagrams-builder-0.5, which really actually adds support
for IO actions producing diagrams.

* 0.1.3.1: 29 November 2013

- Update documentation: doesn't actually support IO actions yet
(that will require some further forthcoming changes to
diagrams-builder).

* 0.1.3: 26 November 2013

- require diagrams-builder-0.4.2, which adds support for IO actions
producing diagrams.
- Allow diagrams-1.0.

* 0.1.2.4: 2 November 2013

- allow BlogLiterately-0.7
- allow base-4.7

* 0.1.2.3: 2 October 2013

- allow pandoc-1.12

* 0.1.2.2: 29 August 2013

- code cleanup, and move repository to github

* 0.1.2.1: 8 August 2013

- allow diagrams-lib-0.7 and diagrams-cairo-0.7

* 0.1.2: 11 March 2013

- update to work with BlogLiterately-0.6

* 0.1.1.2: 4 February 2013

- allow diagrams-builder-0.3

* 0.1.1.1: 24 January 2013

- allow pandoc-1.10

* 0.1.1: 16 December 2012

- create output directory for diagrams if missing (#1)
- update to work with diagrams-cairo-0.6

* 0.1.0.1: 27 August 2012

- bump base upper bound to < 4.7
- include CHANGES in tarball

* 0.1.0.0: 27 August 2012

Initial release
comments powered byDisqus