BlogLiterately-diagrams
Version 0.2.0.6 revision 0 uploaded by BrentYorgey.
Package meta
- Synopsis
- Include images in blog posts with inline diagrams code
- Description
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 ofBlogLiterately
extended with support for inline diagrams code. For most users it should suffice to simply useBlogLiteratelyD
in place ofBlogLiterately
.To use it, include code blocks with the
dia
ordia-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 theIO
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.- Author
- Brent Yorgey
- Bug reports
- http://github.com/byorgey/BlogLiterately-diagrams/issues
- Category
- Web
- Copyright
- Copyright 2012-2015 Brent Yorgey
- Homepage
- n/a
- Maintainer
- byorgey@gmail.com
- Package URL
- n/a
- Stability
- n/a