BlogLiterately-diagrams: Include images in blog posts with inline diagrams code
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.
Downloads
- BlogLiterately-diagrams-0.3.1.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
Versions [RSS] | 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, 0.2, 0.2.0.1, 0.2.0.2, 0.2.0.3, 0.2.0.4, 0.2.0.5, 0.2.0.6, 0.2.1, 0.3, 0.3.1 |
---|---|
Change log | CHANGES |
Dependencies | base (>=4.3 && <4.18), BlogLiterately (>=0.8.7 && <0.9), BlogLiterately-diagrams, containers, diagrams-builder (>=0.5 && <0.9), diagrams-lib (>=1.3 && <1.5), diagrams-rasterific (>=1.3 && <1.5), directory, filepath, JuicyPixels (>=3.2 && <3.4), pandoc (>=2.19.1 && <3.2), safe (>=0.3 && <0.4), split (>=0.2 && <0.3), text (>=1.2 && <2.1) [details] |
Tested with | ghc ==8.6.5 || ==8.8.4 || ==8.10.7 || ==9.0.2 || ==9.2.7 || ==9.4.5 |
License | BSD-3-Clause |
Copyright | Copyright 2012-2022 Brent Yorgey |
Author | Brent Yorgey |
Maintainer | byorgey@gmail.com |
Category | Web |
Bug tracker | http://github.com/byorgey/BlogLiterately-diagrams/issues |
Source repo | head: git clone git://github.com/byorgey/BlogLiterately-diagrams.git |
Uploaded | by BrentYorgey at 2023-08-22T19:34:01Z |
Distributions | |
Reverse Dependencies | 1 direct, 0 indirect [details] |
Executables | BlogLiteratelyD |
Downloads | 21161 total (97 in the last 30 days) |
Rating | (no votes yet) [estimated by Bayesian average] |
Your Rating | |
Status | Docs available [build log] Last success reported on 2023-08-22 [all 1 reports] |