Neverending Plethora of Modules

    wikitext2markdown

    0.0.1 • Public • Published

    wikitext2markdown

    Converts wikitext into markdown without going through html. I wrote this to get a very lightweight way to get wikitext (mediawiki format) into a modified form of markdown for later display on the command line.

    There are still some issues with this but it works passably well for now.

    Note that I wrote this for my own purposes and I am actually stripping a bunch of content that isn't relevant for me, such as links. If you are looking for a more complete converter, you should get the content from the wiki in html and parse it as markdown instead - or convert the wikitext to html and the html to markdown.

    Install

    npm install wikitext2markdown
    

    Usage

    var wiki2md = require('wikitext2markdown');
    
    wiki2md('== header ==');    // ## header
    wiki2md('{{Tip|foo bar}}'); // **Tip**: *foo*
    

    For more examples, check the tests

    Todo

    • multiline code in the bc template format ({{bc|code}})
    • fix tables with template links in them

    Install

    npm i wikitext2markdown

    DownloadsWeekly Downloads

    2

    Version

    0.0.1

    License

    MIT

    Last publish

    Collaborators

    • gregjs