markdown-it-synapse-table
v1.0.8
Published
markdown-it-plugin for table formatting in Synapse.org
Downloads
623
Readme
markdown-it-synapse-table
Synapse markdown table plugin for markdown-it markdown parser that supports Synapse md table syntax. Table headers are optional, and it supports a syntax to specify table css class names.
v1.+ requires markdown-it
v5.+, see changelog.
Header 1 | Header 2 | Header 3
--- | --- | ---
Row 1 Content Cell 1 | Row 1 Content Cell 2 | Row 1 Content Cell 3
Row 2 Content Cell 1 | Row 2 Content Cell 2 | Row 2 Content Cell 3
=>
<table>
<thead>
<tr>
<th>Header 1</th>
<th>Header 2</th>
<th>Header 3</th>
</tr>
</thead>
<tbody>
<tr>
<td>Row 1 Content Cell 1</td>
<td>Row 1 Content Cell 2</td>
<td>Row 1 Content Cell 3</td>
</tr>
<tr>
<td>Row 2 Content Cell 1</td>
<td>Row 2 Content Cell 2</td>
<td>Row 2 Content Cell 3</td>
</tr>
</tbody>
</table>
{| class="border text-align-center"
Row 1 Content Cell 1 | Row 1 Content Cell 2 | Row 1 Content Cell 3
Row 2 Content Cell 1 | Row 2 Content Cell 2 | Row 2 Content Cell 3
|}
=>
<table class=" border text-align-center">
<tbody>
<tr>
<td>Row 1 Content Cell 1</td>
<td>Row 1 Content Cell 2</td>
<td>Row 1 Content Cell 3</td>
</tr>
<tr>
<td>Row 2 Content Cell 1</td>
<td>Row 2 Content Cell 2</td>
<td>Row 2 Content Cell 3</td>
</tr>
</tbody>
</table>
Install
node.js, browser:
npm install markdown-it-synapse-table --save
bower install markdown-it-synapse-table --save
Use
var md = require('markdown-it')().use(require('markdown-it-synapse-table'))
md.render('table markdown')
Differences in browser. If you load script directly into the page, without
package system, module will add itself globally as window.markdownitSynapseTable
.