Naughty Platypus Memorabilia

    marktable

    0.1.2 • Public • Published

    Marktable

    js-standard-style travis npm downloads

    ALPHA: Dev ongoing - Not usable yet

    Parse markdown table, edit and format them to markdown or html

    Functionalities

    • Parse and objectify gfm
    • Support multiline cell
    • Support colspan
    • Support table headers
    • Support column alignment
    • Support multi table body
    • Format table to markdown

    Todo or ongoing

    • Full unit test
    • Table editing
      • add/remove cell, row, column, tbody
      • merge cell, row, tbody
      • move/copy row
    • Track one or many pseudo-cursor position before and after table transformations
    • Format table to html
    • Escape in-content pipe
    • Stream API
    • Convert CSV to markdown table
    • Convert Google Spreadsheet to markdown table
    • ...

    Installation

    npm install --save marktable

    API

    Basic usage

    See too demo/basic.js for more basic examples

    var marktable = require('marktable')
     
    // Simple gfm table with alignements
    console.log(marktable([
      '|Header 1| Header 2 |',
      '|-:|:-:|',
      '| 42 |',
      '| | o |'
    ].join('\n')))
     
     
    // Yield:
    /*
    | Header 1 | Header 2 |
    |---------:|:--------:|
    |       42 |          |
    |          |     o    |
    */
     

    TODO: Rest of the API

    Credit

    Related

    Some related projects, with different goal and usages, that may match you needs:

    License

    The MIT license (see LICENSE.md)

    js-standard-style

    Install

    npm i marktable

    DownloadsWeekly Downloads

    41

    Version

    0.1.2

    License

    MIT

    Last publish

    Collaborators

    • jponchon