$ npm install @putout/processor-markdown
Markdown, the simple and easy-to-use markup language you can use to format virtually any document.
🐊Putout processor adds ability to get JavaScript, JSX, JSON and TypeScript code from Markdown files.
npm i @putout/processor-markdown -D
{
"processors": ["markdown"]
}
Processor converts markdown to JavaScript, it looks like this.
# hello
Became:
__putout_processor_markdown([
header(1, 'hello'),
]);
Under the hood, @putout/processor-markdown uses a small library called happy-mark to turn your document into nested function calls. A heading becomes a call to heading(...), a paragraph becomes paragraph(...), a link becomes link(...), and so on. For example, this Markdown:
# Hello world
Some *emphasis* and a [link](https://example.com).
turns into this JavaScript:
heading(1, 'Hello world');
paragraph('Some ', italic('emphasis'), ' and a ', link('link', 'https://example.com'), '.');
Checkout markdown-related rules in @putout/plugin-markdown
MIT
© 2010 - cnpmjs.org x YWFE | Home | YWFE