markup: Abstraction for markup languages

[ bsd3, data, library, web ] [ Propose Tags ]

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 = deploy Image "foo.png" :: HostedMarkupM (Html ())

λ> renderMarkup image

<img src="foo.png">

Here is the same example, going relative instead:

image :: LocalMarkupM (HtmlT AbsoluteUrl ())
image = deploy Image $ "foo.png" <?> ("some","getparam")

λ> (runUrlReader $ renderTextT $ renderMarkup image $
   ) "example.com"

"<img src=\"example.com/foo.png?some=getparam\">"
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, 4.0.4, 4.1.0, 4.2.0 (info)
Dependencies base (==4.*), blaze-html, blaze-markup, lucid (>=2.5), mtl, text, transformers, urlpath (>=0.2) [details]
License MIT
Author Athan Clark <athan.clark@gmail.com>
Maintainer Athan Clark <athan.clark@gmail.com>
Revised Revision 1 made by athanclark at Wed May 13 00:16:13 UTC 2015
Category Web, Data
Source repo head: git clone https://github.com/athanclark/markup.git
Uploaded by athanclark at Sun May 3 17:46:17 UTC 2015
Distributions NixOS:4.2.0
Downloads 5974 total (57 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]
Hackage Matrix CI

Modules

[Index]

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

For package maintainers and hackage trustees