Wikipedia Infobox Parser in NodeJS
Aug 1, 2014
A parser for Wikipedia Inforbox, as described in Wikipedia help page:
An infobox is a fixed-format table designed to be added to the top right-hand corner of articles to consistently present a summary of some unifying aspect that the articles share and sometimes to improve navigation to other interrelated articles.
Fork the repo and do whatever you can to help!
Features
It’s still on development, it needs to support more markup templates.
- Get Wikipedia Infobox by keyword
- Support keyword redirection
- Convert Wikipedia Markup text to JSON text
Installation
npm install wiki-infobox-parser
Usage
1 | var wikiParser = require('wiki-infobox-parser'); |
Result
The parsed result is
1 | { |
How to contribute
Todo
- Support map caption
- Support link & free link
- Support picture
- Support template: fake clarify
- Support template: fake citation needed
- Support template: fake elucidate
- Support template: fake heading
- Support template: fake notes and references
- Support template: dummy ref
- Support template: dummy backlink
- Support template: dummy footnote
- Support template: break
- Support template: break|5
- Support template: clear
- Support template: clear|left
- Support template: clear|right
- Support template: plainlist
- Support template: startflatlist
- Support template: flatlist
- Support template: hlist|first item|second item|third item|…
- Support template: bulleted list |item1 |item2 |…
- Support template: pagelist
- Support template: nowrap
- Support template: italics
- Support template: smallcaps|small caps
- Support template: pad|4.0em
Issue tracker
- Please check this project on PivatalTracker: https://www.pivotaltracker.com/n/projects/1451530
- Github issue: https://github.com/0x333333/wiki-infobox-parser/issues
Don’t hesitate to contact me when you have any issue or idea about this parser, both PivotalTracker and Github issue are welcomed!
Tests
1 | make test |
Before sending a PR please add corresponding tests, thanks!