Skip to content

Commit

Permalink
Updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
dijs committed Apr 18, 2021
1 parent ce57d60 commit 90973cf
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
This was originally written as a companion module for `wikijs`. But it can work great on it's own as well. The main function of this module is parsing wikipedia article's infobox data. The infobox source is in wikitext format and
difficult to parse. This module analyzes it and outputs JSON for you.

#### How to use
### Usage

```js
var parseInfo = require("infobox-parser")
Expand All @@ -26,6 +26,21 @@ parseInfo(`
}
```

#### Support
### Parsing Options

```js
/**
* Parse Wiki Infobox Text
* @param {string} source - Infobox source text
* @param {Object} options - Parsing options
* @param {boolean} [options.simplifyDataValues=true] - Only use primary data values
* @param {boolean} [options.removeSmall=false] - Remove <small>...</small> chunks of source data
* @param {boolean} [options.removeReferences=true] - Remove <ref>...</ref> chunks of source data
* @returns {Object} Structured information from source text
*/
const info = parseInfo(source, options);
```

### Support

It supports many of wikipedia features, but not all yet. If there is a feature you need it to support, but it does not. Please create an issue and I will add the functionality.

0 comments on commit 90973cf

Please sign in to comment.