The markup package
This library tries to make things more uniformly controlled when working with markup languages in haskell - namely deployment of markup assets.
Deployment, from this library's perspective, means how something can be rendered to markup, yet still achieve the same "result" to the end user (namely the DOM).
We use monad transformers to infer the deployment mechanism for a context of markup. The three deployment mechanisms provided include inline (content is slapped between markup tags), hosted (entirely external - uses raw text as a url), and local (which uses the urlpath library to realize what kind of link to create).
As an example, here is remotely hosted image:
image' = renderMarkup Image :: Monad m => HostedMarkupT m T.Text (Html ()) image = runHostedMarkupT image' "foo.png" λ> renderText image <img src="foo.png">
Here is the same example, going relative instead:
image' = renderMarkup Image :: (Monad m, Url UrlString AbsoluteUrl) => LocalMarkupT UrlString m (HtmlT AbsoluteUrl ()) λ> (runUrlReader $ renderTextT $ runIdentity $ runLocalMarkupT image' $ "foo.png" <?> ("key","bar") ) "example.com" "<img src=\"example.com/foo.png?key=bar\">"
Right now this library isn't so great, hopefully it will get better soon :)
|Versions||0.0.1, 0.0.2, 0.0.3, 0.0.4, 0.0.5, 0.0.6, 0.0.6.1, 0.0.7, 0.0.8, 1.0.0, 1.1.0, 2.0.0, 2.1.0, 2.1.1, 2.2.0, 3.0.0, 3.1.0, 4.0.0, 4.0.1, 4.0.2, 4.0.3 (info)|
|Dependencies||base (==4.*), blaze-html, blaze-markup, lucid (>=2.5), mtl, text, transformers, urlpath [details]|
|Author||Athan Clark <email@example.com>|
|Maintainer||Athan Clark <firstname.lastname@example.org>|
|Source repo||head: git clone https://github.com/athanclark/markup.git|
|Uploaded||Wed Dec 10 17:45:32 UTC 2014 by athanclark|
|Distributions||LTSHaskell:4.0.3, NixOS:4.0.3, Stackage:4.0.3, openSUSE:4.0.3|
|Downloads||5329 total (132 in the last 30 days)|
|Rating||(no votes yet) [estimated by rule of succession]|
|Status||Docs uploaded by user
Build status unknown [no reports yet]
Hackage Matrix CI
For package maintainers and hackage trustees