markdown-it-synapse-table

tag for markdown-it markdown parser.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
markdown-it-synapse-table
301.0.68 years ago8 years agoMinified + gzip package size for markdown-it-synapse-table in KB

Readme

markdown-it-synapse-table
Build Status NPM version Coverage Status
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.

License

MIT