microformats2-parser alternatives and similar packages
Based on the "Web" category.
Alternatively, view microformats2-parser alternatives based on common mentions on social networks and blogs.
-
haskell-bitmex-rest
swagger-codegen contains a template-driven engine to generate documentation, API clients and server stubs in different languages by parsing your OpenAPI / Swagger definition. -
swagger-petstore
swagger-codegen contains a template-driven engine to generate documentation, API clients and server stubs in different languages by parsing your OpenAPI / Swagger definition. -
servant
Main repository for the servant libraries — DSL for describing, serving, querying, mocking, documenting web applications and more! -
neuron
Future-proof note-taking and publishing based on Zettelkasten (superseded by Emanote: https://github.com/srid/emanote) -
tagsoup
Haskell library for parsing and extracting information from (possibly malformed) HTML/XML documents -
keera-hails-reactive-htmldom
Keera Hails: Haskell on Rails - Reactive Programming Framework for Interactive Haskell applications -
ghcjs-base
base library for GHCJS for JavaScript interaction and marshalling, used by higher level libraries like JSC -
ghcjs-dom
Make Document Object Model (DOM) apps that run in any browser and natively using WebKitGtk
WorkOS - The modern identity platform for B2B SaaS
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of microformats2-parser or a related project?
README
microformats2-parser
Microformats 2 parser for Haskell! #IndieWeb
Originally created for sweetroll.
- parses
items
,rels
,rel-urls
- resolves relative URLs (with support for the
<base>
tag), including inside ofhtml
fore-*
properties - parses the value-class-pattern, including date and time normalization
- handles malformed HTML (the actual HTML parser is tagstream-conduit)
- also can convert to JF2
- high performance
- extensively tested
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:
htmlMode
, an HTML parsing mode (Unsafe
|Escape
|Sanitize
)baseUri
, theMaybe URI
that represents the address you retrieved the HTML from, used for resolving relative addresses -- you should set it
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!
By participating in this project you agree to follow the Contributor Code of Conduct and to release your contributions under the Unlicense.
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.
*Note that all licence references and agreements mentioned in the microformats2-parser README section above
are relevant to that project's source code only.