get-md-desc
get description from markdown article
Install
npm install --save get-md-desc
Usage
import getDesc from 'get-md-desc';
const input = `
# title
* nope
Published yesterday
Or in 21 december 2012
True *description*`;
getDesc(input).text; // Published yesterday
getDesc(input, /december/).text; // Published yesterday
getDesc(input, /Published|december/).text; // True description
getDesc(input, /Published|december/).html; // True <em>description</em>
getDesc(input, /Published|december/).node; // AST node, see commonmark API
getDesc('', /Published|december/); // undefined ¯\_(ツ)_/¯
API
getDesc(input, [exclude])
input
Required
Type: String
Markdown string.
exclude
Type: String
or RegExp
Default: null
Pattern, which paragraph of description should not contain.
Related
- article-data - extract data from your markdown article
- get-md-content - get content from markdown article
- get-md-date - get date from markdown article
- get-md-image - get image from markdown article
- get-md-title - get title from markdown article
License
MIT © Vladimir Starkov