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.
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
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.
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.
Licensed under MIT.