simple-wikitext-parser

1.0.1 • Public • Published

simple-wikitext-parser

This is a module that parses the wiki syntax and provides output meant to be displayed.

It's only meant for my own use, and I cannot guarantee that it'll work well for wikis that's heavy with tables, figures and all that fun stuff. If you do need more advanced modules for your wiki clients, then wtf_wikipedia is probably more suited.

Example:

> WikiParser = require('simple-wikitext-parser');
> WikiParser.parse("Article Title", wikitext);
ParsedArticle {
  title: 'Article Title',
  content:
   [ Section {
       header: 'Article Title',
       level: 1,
       paragraphs: [Object],
       links: [Object] },
     Section {
       header: 'First Subsection Header'
       level: 2
       paragraphs: [Object],
       links: [Object] } ],
   templates:
    { MyInfoBox:
       { Name: "Stuff",
         Stuff: "Things",
         Age: "55",
         sectionTitle: null } },
   categories:
     [ "Category:Stuff",
       "Category:Things" ] }

Supports

  • Sections
  • Templates
  • Categories

Semi-Supported

  • Links (Separated from link-text)
  • [[Links]] (Separated from link-text)

Not Supported

  • Tables (Removed)
  • Lists (* is preserved)

Readme

Keywords

Package Sidebar

Install

npm i simple-wikitext-parser

Weekly Downloads

8

Version

1.0.1

License

ISC

Last publish

Collaborators

  • gisle