@fsegurai/marked-extended-tables
v12.0.5
Published
Extended tables for Markedjs
Downloads
60
Readme
A library of extended tables for Marked.js.
@fsegurai/marked-extended-tables
is a theme for CodeMirror 6 editor, making it visually engaging and adaptable to different coding styles and user preferences.
Table of contents
Installation
@fsegurai/marked-extended-tables
To add @fsegurai/marked-extended-tables
along with Marked.js to your package.json
use the following commands.
npm install @fsegurai/marked-extended-tables marked@^12.0.2 --save
Using Extended Tables
Import @fsegurai/marked-extended-tables
and apply it to your Marked instance as shown below.
import { marked } from "marked";
import markedExtendedTables from "@fsegurai/marked-extended-tables";
// or UMD script
// <script src="https://cdn.jsdelivr.net/npm/marked/lib/marked.umd.js"></script>
// <script src="https://cdn.jsdelivr.net/npm/@fsegurai/marked-extended-tables/lib/index.umd.js"></script>
marked.use(markedExtendedTables());
marked(`
| H1 | H2 | H3 |
|---------|---------|---------|
| This cell spans 3 columns |||
`);
/**
* <table>
* <thead>
* <tr>
* <th>H1</th>
* <th>H2</th>
* <th>H3</th>
* </tr>
* </thead>
* <tbody>
* <tr>
* <td colspan="3">This cell spans 3 columns</td>
* </tr>
* </tbody>
* </table>
*/
Read the Marked.js documentation for more details about its usage.
Available Extensions
Demo Application
To see all themes in action, check out the demo: https://fsegurai.github.io/marked-extensions.
To set up the demo locally:
git clone https://github.com/fsegurai/marked-extensions.git
npm install
npm start
This will serve the application locally at http://[::1]:8000.
License
Licensed under MIT.