The microformats2-parser package

[Tags: library, program, public-domain]

[Skip to ReadMe]

Properties

Versions0.1.0, 0.1.1, 1.0.0, 1.0.1, 1.0.1.1, 1.0.1.2, 1.0.1.3, 1.0.1.4, 1.0.1.5
Change logNone available
Dependenciesaeson, aeson-pretty, aeson-qq, attoparsec, base (>=4.7.0.0 && <5), base-compat (>=0.8.0), blaze-html, blaze-markup, bytestring, containers, data-default, either, errors, html-conduit, lens-aeson, microformats2-parser, network, network-uri, options, pcre-heavy, safe, scotty, streaming-commons, tagsoup, text, time, transformers, unordered-containers, vector, wai-extra, warp, xml-lens, xss-sanitize [details]
LicensePublicDomain
Copyright2015 Greg V <[email protected]>
AuthorGreg V
Maintainer[email protected]
CategoryWeb
Home pagehttps://github.com/myfreeweb/microformats2-parser
Source repositoryhead: git clone git://github.com/myfreeweb/microformats2-parser.git
Executablesmicroformats2-parser
UploadedThu Mar 24 18:30:57 UTC 2016 by myfreeweb
DistributionsLTSHaskell:1.0.1.5, NixOS:1.0.1.5, Stackage:1.0.1.5
Downloads380 total (18 in last 30 days)
Votes
1 []
StatusDocs pending
Build status unknown [no reports yet]

Modules

Downloads

Maintainers' corner

For package maintainers and hackage trustees

Readme for microformats2-parser-1.0.1.5

microformats2-parser Hackage Build Status unlicense

Microformats 2 parser for Haskell! #IndieWeb

Originally created for sweetroll.

Also check out http-link-header because you often need to read links from the Link header!

DEMO PAGE

Usage

Look at the API docs on Hackage for more info, here's a quick overview:

{-# LANGUAGE OverloadedStrings #-}

import Data.Microformats2.Parser
import Data.Default
import Network.URI

parseMf2 def $ documentRoot $ parseLBS "<body><p class=h-entry><h1 class=p-name>Yay!</h1></p></body>"

parseMf2 (def { baseUri = parseURI "https://where.i.got/that/page/from/" }) $ documentRoot $ parseLBS "<body><base href=\"base/\"><link rel=micropub href='micropub'><p class=h-entry><h1 class=p-name>Yay!</h1></p></body>"

The def is the default configuration.

The configuration includes:

parseMf2 will return an Aeson Value structured like canonical microformats2 JSON. lens-aeson is a good way to navigate it.

Development

Use stack to build.
Use ghci to run tests quickly with :test (see the .ghci file).

$ stack build

$ stack test

$ stack ghci

Contributing

Please feel free to submit pull requests! Bugfixes and simple non-breaking improvements will be accepted without any questions :-)

By participating in this project you agree to follow the Contributor Code of Conduct.

The list of contributors is available on GitHub.

License

This is free and unencumbered software released into the public domain.
For more information, please refer to the UNLICENSE file or unlicense.org.