Brand new microformats 2 parser
I have just released a brand new microformats 2 parser for node.js. You maybe thinking microformats are so 2006, but this is new. Hear me out…
Demo API /> http://microformat2-node.jit.su/
Try the API with: /> http://the-pastry-box-project.net/ /> http://microformats.org/
New life in the semantic web
A lot has changed in the last couple of years; the search engines have started to use semantic mark-up to improve their listings. Google’s rich snippets feature has created a secret army of SEO people who are quietly marking up big parts of the web with semantic data. Not that there are not already billions of microformats on the web.
HTML5 created a third standard of semantic web mark-up to add to the mix of RDFa and microformats. Then the search engines clubbed together and brought us schema.org. After a few catfights between the standards supporter clubs, these events have brought us a small rebirth of the semantic web.
microformats 2
The microformats community has revisited it’s standard and come up with “microformats version 2”. At first, I thought why! I don’t like change unless it gives me something worthwhile. After reviewing the work, I think the wholesale change to a new version of microformats is worthwhile because:
- The authoring patterns have been simplified even more and they are based on real life use cases e.g.:
Glenn Jones
is a valid microformat - microformats 2 addresses one of the biggest problems in maintaining microformats in real sites. The class names are now prefixed i.e. class=”fn” is now class=”p-name”. The prefixes like “h-*” and “p-*” tells you a class is a microformat property and helps make sure classes are not moved or deleted by mistake
- Like microdata, microformats 2 now has a full specification for a JSON API. This is important as it means the parsers should now have the same output and also browsers could implement this API.
/>
/>
New parser and test suite
Most importantly for me I wanted to help move forward microformats, I liked the fact that the API design aligned microformats 2 a little closer to microdata and RDFa. So I have invested a couple of months of my time to building a brand new JavaScript parsing engine and a comprehensive test suite.
microformat-node GitHub https://github.com/glennjones/microformat-node /> Test Suite GitHub https://github.com/microformats/tests
I have just open sourced a new version of microformat-node using this parsing engine. Soon I will create a browser compatible version of the engine and update the microformat-shiv library which powers browser plug-ins etc.
The test suite took a long time to develop, but should provide an excellent starting point for anyone else who wants to develop a new microformats 2 parser. I know Barnaby Walters has already started working with it for his php-mf2 parser.
I hope this work will help microformats and the concept of the semantic web move forward another little step. Enjoy