@nitonodev/aeromd
The lightweight markdown parser for ts
or js
See changes at CHANGELOG.md
This package contains a built-in declaration for TypeScript, therefore you do not need to install types for this package separately. Installation
npm i @nitonodev/aeromd
Usage
To connect this library to you code you may to write next lines of code Connecting
// if you use a commonjs
const { MarkdownParser } = require('@nitonodev/aeromd');
// if you use a esm
import { MarkdownParser } from '@nitonodev/aeromd';
Quick Start
To create a class you may to write next lines of code
// Instead of mp your variable name
// Instead of '# Hello' your markdown code
const mp = new MarkdownParser('# Hello');
If you want to parse markdown data to html code you may to use a parse function Parse markdown data
name of function | return value | params |
---|---|---|
parse | string (html code) | optional m by default is markdown code who declared in class definition |
Example:
const mp = new MarkdownParser('# Hello');
// if you want to use default value from class definition
mp.parse(); // => <div id="html"><div id="body"><h1>Hello</h1></div></div>
// if you want to use custom parsing value
mp.parse('## Hello, World !'); // => <div id="html"><div id="body"><h2>Hello, World !</h2></div></div>
To use styles you may to write this lines Use styles
+ import '@nitonodev/aeromd/lib/styles/md-theme.css'
For future
- Write library for other programming languages
Feedback
You can write me to pyto015@ya.ru or open issue at Github repo
Links