The BlogLiterately-diagrams package
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 (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 (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:
|Versions||0.1.0.0, 0.1.0.1, 0.1.1, 0.1.1.1, 0.1.1.2, 0.1.2, 0.1.2.1, 0.1.2.2, 0.1.2.3, 0.1.2.4, 0.1.3, 0.1.3.1, 0.1.4, 0.1.4.1, 0.1.4.2, 0.1.4.3|
|Dependencies||base (>=4.3 && <4.7), BlogLiterately (>=0.5.2 && <0.6), BlogLiterately-diagrams, containers, diagrams-builder (>=0.2 && <0.4), diagrams-cairo (==0.6.*), diagrams-lib (==0.6.*), directory, filepath, pandoc (>=1.9 && <1.11), safe (==0.3.*)|
|Copyright||Copyright 2012 Brent Yorgey|
|Source repository||head: darcs get http://hub.darcs.net/byorgey/BlogLiterately-diagrams|
|Upload date||Mon Feb 4 15:58:53 UTC 2013|
|Downloads||1571 total (184 in last 30 days)|
- BlogLiterately-diagrams-0.1.1.2.tar.gz [browse] (Cabal source package)
- Package description (included in the package)
For package maintainers and hackage trustees