markdown-utils
Advanced tools
Comparing version 0.7.3 to 1.0.0
264
index.js
/*! | ||
* markdown-utils <https://github.com/jonschlinkert/markdown-utils> | ||
* | ||
* Copyright (c) 2014 Jon Schlinkert, contributors. | ||
* Copyright (c) 2014-2018, Jon Schlinkert, contributors. | ||
* Licensed under the MIT license. | ||
@@ -10,6 +10,4 @@ */ | ||
var isNumber = require('is-number'); | ||
var slice = require('array-slice'); | ||
var listitem = require('list-item'); | ||
var codeBlock = require('to-gfm-code-block'); | ||
const isNumber = require('is-number'); | ||
const listitem = require('list-item'); | ||
@@ -23,11 +21,7 @@ /** | ||
* ``` | ||
* | ||
* @name blockquote | ||
* @param {String} `str` | ||
* @param {String} `str` | ||
* @api public | ||
*/ | ||
exports.blockquote = function blockquote(str) { | ||
return '> ' + str; | ||
}; | ||
exports.blockquote = str => str ? `> ${str}` : ''; | ||
@@ -38,17 +32,13 @@ /** | ||
* ```js | ||
* utils.code('var foo = bar;'); | ||
* //=> '`var foo = bar;`' | ||
* utils.code('const foo = bar;'); | ||
* //=> '`const foo = bar;`' | ||
* ``` | ||
* | ||
* @name code | ||
* @param {String} `str` | ||
* @param {String} `str` | ||
* @api public | ||
*/ | ||
exports.code = function code(str) { | ||
return '`' + str + '`'; | ||
}; | ||
exports.code = str => str ? `\`${str}\`` : ''; | ||
/** | ||
* Create markdown-formatted `<del></del>`. | ||
* Create markdown-formatted deleted text: `~~text~~`. | ||
* | ||
@@ -59,11 +49,7 @@ * ```js | ||
* ``` | ||
* | ||
* @name del | ||
* @param {String} `str` | ||
* @param {String} `str` | ||
* @api public | ||
*/ | ||
exports.del = function del(str) { | ||
return '~~' + str + '~~'; | ||
}; | ||
exports.del = str => str ? `~~${str}~~` : ''; | ||
@@ -77,11 +63,7 @@ /** | ||
* ``` | ||
* | ||
* @name em | ||
* @param {String} `str` | ||
* @param {String} `str` | ||
* @api public | ||
*/ | ||
exports.em = function em(str) { | ||
return '_' + str + '_'; | ||
}; | ||
exports.em = str => str ? `_${str}_` : ''; | ||
@@ -95,12 +77,8 @@ /** | ||
* ``` | ||
* | ||
* @name h | ||
* @param {String} `str` | ||
* @param {Number} `level` | ||
* @param {String} `str` | ||
* @param {Number} `level` | ||
* @api public | ||
*/ | ||
exports.h = function h(level, str) { | ||
return exports.heading(str, level); | ||
}; | ||
exports.h = (level, str) => str ? exports.heading(str, level) : ''; | ||
@@ -114,11 +92,7 @@ /** | ||
* ``` | ||
* | ||
* @name h1 | ||
* @param {String} `str` | ||
* @param {String} `str` | ||
* @api public | ||
*/ | ||
exports.h1 = function h1(str) { | ||
return '# ' + str; | ||
}; | ||
exports.h1 = str => str ? `# ${str}` : ''; | ||
@@ -132,11 +106,7 @@ /** | ||
* ``` | ||
* | ||
* @name h2 | ||
* @param {String} `str` | ||
* @param {String} `str` | ||
* @api public | ||
*/ | ||
exports.h2 = function h2(str) { | ||
return '## ' + str; | ||
}; | ||
exports.h2 = str => str ? `## ${str}` : ''; | ||
@@ -150,11 +120,7 @@ /** | ||
* ``` | ||
* | ||
* @name h3 | ||
* @param {String} `str` | ||
* @param {String} `str` | ||
* @api public | ||
*/ | ||
exports.h3 = function h3(str) { | ||
return '### ' + str; | ||
}; | ||
exports.h3 = str => str ? `### ${str}` : ''; | ||
@@ -168,11 +134,7 @@ /** | ||
* ``` | ||
* | ||
* @name h4 | ||
* @param {String} `str` | ||
* @param {String} `str` | ||
* @api public | ||
*/ | ||
exports.h4 = function h4(str) { | ||
return '#### ' + str; | ||
}; | ||
exports.h4 = str => str ? `#### ${str}` : ''; | ||
@@ -186,11 +148,7 @@ /** | ||
* ``` | ||
* | ||
* @name h5 | ||
* @param {String} `str` | ||
* @param {String} `str` | ||
* @api public | ||
*/ | ||
exports.h5 = function h5(str) { | ||
return '##### ' + str; | ||
}; | ||
exports.h5 = str => str ? `##### ${str}` : ''; | ||
@@ -204,11 +162,7 @@ /** | ||
* ``` | ||
* | ||
* @name h6 | ||
* @param {String} `str` | ||
* @param {String} `str` | ||
* @api public | ||
*/ | ||
exports.h6 = function h6(str) { | ||
return '###### ' + str; | ||
}; | ||
exports.h6 = str => str ? `###### ${str}` : ''; | ||
@@ -222,12 +176,8 @@ /** | ||
* ``` | ||
* | ||
* @name heading | ||
* @param {String} `str` | ||
* @param {Number} `level` | ||
* @param {String} `str` | ||
* @param {Number} `level` | ||
* @api public | ||
*/ | ||
exports.heading = function heading(str, level) { | ||
return exports['h' + (level || 1)](str); | ||
}; | ||
exports.heading = (str, level) => str ? exports[`h${(level || 1)}`](str) : ''; | ||
@@ -241,11 +191,7 @@ /** | ||
* ``` | ||
* | ||
* @name hr | ||
* @param {String} `str` Alternate string to use. Default is `***` to avoid collision with `---` which is used for front matter. | ||
* @param {String} `str` Alternate string to use. Default is `***` to avoid collision with `---` which is commonly used for front-matter. | ||
* @api public | ||
*/ | ||
exports.hr = function hr(str) { | ||
return str || '***'; | ||
}; | ||
exports.hr = (str = '***') => str; | ||
@@ -259,12 +205,10 @@ /** | ||
* ``` | ||
* | ||
* @name link | ||
* @param {String} `anchor` | ||
* @param {String} `href` | ||
* @param {String} `title` | ||
* @param {String} `anchor` | ||
* @param {String} `href` | ||
* @param {String} `title` | ||
* @api public | ||
*/ | ||
exports.link = function link(anchor, href, title) { | ||
return '[' + anchor + '](' + href + (title ? ' "' + title + '"' : '') + ')'; | ||
exports.link = (anchor, href, title) => { | ||
return `[${anchor}](${href}${title ? ` "${title}"` : ''})`; | ||
}; | ||
@@ -279,18 +223,16 @@ | ||
* ``` | ||
* | ||
* @name anchor | ||
* @param {String} `anchor` | ||
* @param {String} `href` | ||
* @param {String} `title` | ||
* @param {String} `anchor` | ||
* @param {String} `href` | ||
* @param {String} `title` | ||
* @api public | ||
*/ | ||
exports.anchor = function anchor(text, repo, line, branch) { | ||
return '[' + text + '](' + format(repo, branch, line) + ')'; | ||
exports.anchor = (text, repo, line, branch) => { | ||
return `[${text}](${format(repo, branch, line)})`; | ||
}; | ||
function format(str, branch, line) { | ||
var segs = str.split(/[\\\/]/); | ||
var repo = slice(segs, 0, 2).join('/'); | ||
var rest = slice(segs, 2).join('/'); | ||
let segs = str.split(/[\\\/]/); | ||
let repo = segs.slice(0, 2).join('/'); | ||
let rest = segs.slice(2).join('/'); | ||
if (isNumber(branch)) { | ||
@@ -300,5 +242,5 @@ line = branch; | ||
} | ||
var res = 'https://github.com/'; | ||
res += (repo + '/blob/' + branch + '/' + rest); | ||
res += (line ? '#L' + line : ''); | ||
let res = 'https://github.com/'; | ||
res += `${repo}/blob/${branch}/${rest}`; | ||
res += line ? `#L${line}` : ''; | ||
return res; | ||
@@ -314,12 +256,10 @@ } | ||
* ``` | ||
* | ||
* @name reference | ||
* @param {String} `id` | ||
* @param {String} `url` | ||
* @param {String} `title` | ||
* @param {String} `id` | ||
* @param {String} `url` | ||
* @param {String} `title` | ||
* @api public | ||
*/ | ||
exports.reference = function reference(id, url, title) { | ||
return '[' + id + ']: ' + url + (title ? ' "' + title + '"' : ''); | ||
exports.reference = (id, url, title) => { | ||
return `[${id}]: ${url}${title ? ` "${title}"` : ''}`; | ||
}; | ||
@@ -337,13 +277,9 @@ | ||
* ``` | ||
* | ||
* @name image | ||
* @param {String} `alt` | ||
* @param {String} `src` | ||
* @param {String} `title` | ||
* @param {String} `alt` | ||
* @param {String} `src` | ||
* @param {String} `title` | ||
* @api public | ||
*/ | ||
exports.image = function image(alt, src, title) { | ||
return '!' + exports.link(alt, src, title); | ||
}; | ||
exports.image = (alt, src, title) => '!' + exports.link(alt, src, title); | ||
@@ -357,11 +293,9 @@ /** | ||
* ``` | ||
* | ||
* @name badge | ||
* @param {String} `alt` | ||
* @param {String} `img_url` | ||
* @param {String} `url` | ||
* @param {String} `alt` | ||
* @param {String} `img_url` | ||
* @param {String} `url` | ||
* @api public | ||
*/ | ||
exports.badge = function badge(alt, img_url, url, title) { | ||
exports.badge = (alt, img_url, url, title) => { | ||
return exports.link(exports.image(alt, img_url, title), url); | ||
@@ -375,3 +309,3 @@ }; | ||
* ```js | ||
* var li = listitem(options); | ||
* const li = listitem(options); | ||
* | ||
@@ -387,15 +321,11 @@ * li(0, 'Level 0 list item'); | ||
* ``` | ||
* | ||
* @name .li | ||
* @param {String} `options` | ||
* @param {String} `options` | ||
* @option {Boolean} [options] `nobullet` Pass true if you only want the list iten and identation, but no bullets. | ||
* @option {String} [options] `indent` The amount of leading indentation to use. default is ` `. | ||
* @option {String|Array} [options] `chars` If a string is passed, [expand-range] will be used to generate an array of bullets (visit [expand-range] to see all options.) Or directly pass an array of bullets, numbers, letters or other characters to use for each list item. Default `['-', '*', '+', '~']` | ||
* @param {Function} `fn` pass a function [expand-range] to modify the bullet for an item as it's generated. See the [examples]. | ||
* @option {String|Array} [options] `chars` If a string is passed, [fill-range] will be used to generate an array of bullets (visit [fill-range] to see all options.) Or directly pass an array of bullets, numbers, letters or other characters to use for each list item. Default `['-', '*', '+', '~']` | ||
* @param {Function} `fn` pass a function [fill-range] to modify the bullet for an item as it's generated. | ||
* @api public | ||
*/ | ||
exports.li = function li(str, lvl, opts, fn) { | ||
return listitem(opts, fn)(lvl, str); | ||
}; | ||
exports.li = (char, level, options, fn) => listitem(options, fn)(level, char); | ||
@@ -406,3 +336,3 @@ /** | ||
* ```js | ||
* utils.pre('var foo = bar;'); | ||
* utils.pre('const foo = bar;'); | ||
* ``` | ||
@@ -413,26 +343,12 @@ * Results in: | ||
* <pre> | ||
* var foo = bar; | ||
* const foo = bar; | ||
* </pre> | ||
* ``` | ||
* | ||
* @name pre | ||
* @param {String} `str` | ||
* @param {String} `language` | ||
* @param {String} `str` | ||
* @param {String} `language` | ||
* @api public | ||
*/ | ||
exports.pre = function pre(str) { | ||
if (typeof str !== 'string') { | ||
throw new TypeError('markdown-pre expects a string.'); | ||
} | ||
exports.pre = str => str ? `<pre>\n${str}\n</pre>` : ''; | ||
var code = ''; | ||
code += '<pre>' | ||
code += '\n'; | ||
code += str; | ||
code += '\n'; | ||
code += '</pre>'; | ||
return code; | ||
}; | ||
/** | ||
@@ -442,3 +358,3 @@ * Create a markdown-formatted code snippet with or without `lang`. | ||
* ```js | ||
* utils.gfm('var foo = bar;', 'js'); | ||
* utils.gfm('const foo = bar;', 'js'); | ||
* ``` | ||
@@ -449,17 +365,14 @@ * Results in: | ||
* ```js | ||
* var foo = bar; | ||
* const foo = bar; | ||
* ``` | ||
* </pre> | ||
* | ||
* @name pre | ||
* @param {String} `str` | ||
* @param {String} `language` | ||
* @param {String} `str` | ||
* @param {String} `language` | ||
* @api public | ||
*/ | ||
exports.gfm = function gfm(str, lang) { | ||
if (typeof str !== 'string') { | ||
throw new TypeError('markdown-gfm expects a string.'); | ||
} | ||
return codeBlock(str, lang); | ||
exports.gfm = (str, lang = '') => { | ||
let fence = '```'; | ||
return str ? `${fence}${lang}\n${str}\n${fence}` : ''; | ||
}; | ||
@@ -474,11 +387,7 @@ | ||
* ``` | ||
* | ||
* @name strong | ||
* @param {String} `str` | ||
* @param {String} `str` | ||
* @api public | ||
*/ | ||
exports.strong = function strong(str) { | ||
return '**' + str + '**'; | ||
}; | ||
exports.strong = str => str ? `**${str}**` : ''; | ||
@@ -495,11 +404,8 @@ /** | ||
* ``` | ||
* | ||
* @name todo | ||
* @param {String} `str` | ||
* @param {String} `str` | ||
* @api public | ||
*/ | ||
exports.todo = function todo(str, checked) { | ||
return (checked ? '- [x] ' : '- [ ] ') + str; | ||
exports.todo = (str, checked) => { | ||
return str ? ((checked ? '- [x] ' : '- [ ] ') + str) : ''; | ||
}; | ||
{ | ||
"name": "markdown-utils", | ||
"description": "Micro-utils for creating markdown snippets.", | ||
"version": "0.7.3", | ||
"description": "Tiny helpers for creating consistenly-formatted markdown snippets.", | ||
"version": "1.0.0", | ||
"homepage": "https://github.com/jonschlinkert/markdown-utils", | ||
@@ -17,3 +17,3 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)", | ||
"engines": { | ||
"node": ">=0.10.0" | ||
"node": ">=4" | ||
}, | ||
@@ -24,11 +24,8 @@ "scripts": { | ||
"dependencies": { | ||
"array-slice": "^0.2.3", | ||
"is-number": "^2.1.0", | ||
"list-item": "^1.1.1", | ||
"to-gfm-code-block": "^0.1.1" | ||
"is-number": "^7.0.0", | ||
"list-item": "^2.0.0" | ||
}, | ||
"devDependencies": { | ||
"for-own": "^0.1.2", | ||
"gulp-format-md": "^0.1.8", | ||
"mocha": "^2.4.5" | ||
"gulp-format-md": "^1.0.0", | ||
"mocha": "^5.2.0" | ||
}, | ||
@@ -39,11 +36,20 @@ "keywords": [ | ||
"markdown", | ||
"markdown-it", | ||
"md", | ||
"post", | ||
"remark", | ||
"remarkable", | ||
"render", | ||
"renderer", | ||
"util", | ||
"text", | ||
"utils", | ||
"write" | ||
], | ||
"verb": { | ||
"toc": false, | ||
"layout": "default", | ||
"tasks": [ | ||
"readme" | ||
], | ||
"plugins": [ | ||
"gulp-format-md" | ||
], | ||
"related": { | ||
@@ -59,12 +65,5 @@ "list": [ | ||
"bullets", | ||
"verb" | ||
"fill-range", | ||
"remarkable" | ||
], | ||
"toc": false, | ||
"layout": "default", | ||
"tasks": [ | ||
"readme" | ||
], | ||
"plugins": [ | ||
"gulp-format-md" | ||
], | ||
"lint": { | ||
@@ -71,0 +70,0 @@ "reflinks": true |
150
README.md
@@ -1,5 +0,7 @@ | ||
# markdown-utils [![NPM version](https://img.shields.io/npm/v/markdown-utils.svg?style=flat)](https://www.npmjs.com/package/markdown-utils) [![NPM downloads](https://img.shields.io/npm/dm/markdown-utils.svg?style=flat)](https://npmjs.org/package/markdown-utils) [![Build Status](https://img.shields.io/travis/jonschlinkert/markdown-utils.svg?style=flat)](https://travis-ci.org/jonschlinkert/markdown-utils) | ||
# markdown-utils [![NPM version](https://img.shields.io/npm/v/markdown-utils.svg?style=flat)](https://www.npmjs.com/package/markdown-utils) [![NPM monthly downloads](https://img.shields.io/npm/dm/markdown-utils.svg?style=flat)](https://npmjs.org/package/markdown-utils) [![NPM total downloads](https://img.shields.io/npm/dt/markdown-utils.svg?style=flat)](https://npmjs.org/package/markdown-utils) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/markdown-utils.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/markdown-utils) | ||
Micro-utils for creating markdown snippets. | ||
> Tiny helpers for creating consistenly-formatted markdown snippets. | ||
Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. | ||
## Install | ||
@@ -10,3 +12,3 @@ | ||
```sh | ||
$ npm install markdown-utils --save | ||
$ npm install --save markdown-utils | ||
``` | ||
@@ -17,3 +19,3 @@ | ||
```js | ||
var mdu = require('markdown-utils'); | ||
const mdu = require('markdown-utils'); | ||
``` | ||
@@ -23,3 +25,3 @@ | ||
### [.blockquote](index.js#L28) | ||
### [.blockquote](index.js#L24) | ||
@@ -39,3 +41,3 @@ Create a markdown-formatted blockquote. | ||
### [.code](index.js#L45) | ||
### [.code](index.js#L37) | ||
@@ -51,9 +53,9 @@ Create a markdown-formatted `<code></code>` snippet. | ||
```js | ||
utils.code('var foo = bar;'); | ||
//=> '`var foo = bar;`' | ||
utils.code('const foo = bar;'); | ||
//=> '`const foo = bar;`' | ||
``` | ||
### [.del](index.js#L62) | ||
### [.del](index.js#L50) | ||
Create markdown-formatted `<del></del>`. | ||
Create markdown-formatted deleted text: `~~text~~`. | ||
@@ -71,3 +73,3 @@ **Params** | ||
### [.em](index.js#L79) | ||
### [.em](index.js#L63) | ||
@@ -87,3 +89,3 @@ Create a markdown-formatted em. | ||
### [.h](index.js#L97) | ||
### [.h](index.js#L77) | ||
@@ -104,3 +106,3 @@ Create a markdown-formatted heading. | ||
### [.h1](index.js#L114) | ||
### [.h1](index.js#L90) | ||
@@ -120,3 +122,3 @@ Create a markdown-formatted h1 heading. | ||
### [.h2](index.js#L131) | ||
### [.h2](index.js#L103) | ||
@@ -136,3 +138,3 @@ Create a markdown-formatted h2 heading. | ||
### [.h3](index.js#L148) | ||
### [.h3](index.js#L116) | ||
@@ -152,3 +154,3 @@ Create a markdown-formatted h3 heading. | ||
### [.h4](index.js#L165) | ||
### [.h4](index.js#L129) | ||
@@ -168,3 +170,3 @@ Create a markdown-formatted h4 heading. | ||
### [.h5](index.js#L182) | ||
### [.h5](index.js#L142) | ||
@@ -184,3 +186,3 @@ Create a markdown-formatted h5 heading. | ||
### [.h6](index.js#L199) | ||
### [.h6](index.js#L155) | ||
@@ -200,3 +202,3 @@ Create a markdown-formatted h6 heading. | ||
### [.heading](index.js#L217) | ||
### [.heading](index.js#L169) | ||
@@ -217,3 +219,3 @@ Create a markdown-formatted heading. | ||
### [.hr](index.js#L234) | ||
### [.hr](index.js#L182) | ||
@@ -224,3 +226,3 @@ Create a markdown-formatted horizontal rule. | ||
* `str` **{String}**: Alternate string to use. Default is `***` to avoid collision with `---` which is used for front matter. | ||
* `str` **{String}**: Alternate string to use. Default is `***` to avoid collision with `---` which is commonly used for front-matter. | ||
@@ -234,3 +236,3 @@ **Example** | ||
### [.link](index.js#L253) | ||
### [.link](index.js#L197) | ||
@@ -252,3 +254,3 @@ Create a markdown-formatted link from the given values. | ||
### [.anchor](index.js#L272) | ||
### [.anchor](index.js#L214) | ||
@@ -270,3 +272,3 @@ Create a markdown-formatted anchor link from the given values. | ||
### [.reference](index.js#L305) | ||
### [.reference](index.js#L245) | ||
@@ -288,3 +290,3 @@ Create a markdown-formatted reference link from the given values. | ||
### [.image](index.js#L327) | ||
### [.image](index.js#L265) | ||
@@ -309,3 +311,3 @@ Create a markdown-formatted image from the given values. | ||
### [.badge](index.js#L346) | ||
### [.badge](index.js#L280) | ||
@@ -327,3 +329,3 @@ Create a markdown-formatted badge. | ||
### [.li](index.js#L376) | ||
### [.li](index.js#L308) | ||
@@ -334,16 +336,13 @@ Returns a function to generate a plain-text/markdown list-item, allowing options to be cached for subsequent calls. | ||
* | ||
`options` **{String}** | ||
* `options` **{String}** | ||
- `nobullet` **{Boolean}**: Pass true if you only want the list iten and identation, but no bullets. | ||
- `indent` **{String}**: The amount of leading indentation to use. default is ``. | ||
- `chars` **{String|Array}**: If a string is passed, [expand-range] will be used to generate an array of bullets (visit [expand-range] to see all options.) Or directly pass an array of bullets, numbers, letters or other characters to use for each list item. Default `['-', '*', '+', '~']` | ||
- `chars` **{String|Array}**: If a string is passed, [fill-range](https://github.com/jonschlinkert/fill-range) will be used to generate an array of bullets (visit [fill-range](https://github.com/jonschlinkert/fill-range) to see all options.) Or directly pass an array of bullets, numbers, letters or other characters to use for each list item. Default `['-', '*', '+', '~']` | ||
* `fn` **{Function}**: pass a function [fill-range](https://github.com/jonschlinkert/fill-range) to modify the bullet for an item as it's generated. | ||
* | ||
`fn` **{Function}**: pass a function [expand-range] to modify the bullet for an item as it's generated. See the [examples]. | ||
**Example** | ||
```js | ||
var li = listitem(options); | ||
const li = listitem(options); | ||
@@ -360,3 +359,3 @@ li(0, 'Level 0 list item'); | ||
### [.pre](index.js#L400) | ||
### [.pre](index.js#L328) | ||
@@ -375,3 +374,3 @@ Create a markdown-formatted `<pre><code></code></pre>` snippet with or without lang. | ||
```js | ||
utils.pre('var foo = bar;'); | ||
utils.pre('const foo = bar;'); | ||
``` | ||
@@ -381,7 +380,7 @@ | ||
<pre> | ||
var foo = bar; | ||
const foo = bar; | ||
</pre> | ||
``` | ||
### [.pre](index.js#L434) | ||
### [.gfm](index.js#L349) | ||
@@ -402,10 +401,10 @@ Create a markdown-formatted code snippet with or without `lang`. | ||
```js | ||
utils.gfm('var foo = bar;', 'js'); | ||
utils.gfm('const foo = bar;', 'js'); | ||
``` | ||
```js | ||
var foo = bar; | ||
const foo = bar; | ||
``` | ||
### [.strong](index.js#L454) | ||
### [.strong](index.js#L365) | ||
@@ -425,3 +424,3 @@ Create markdown-formatted bold text. | ||
### [.todo](index.js#L474) | ||
### [.todo](index.js#L381) | ||
@@ -444,51 +443,66 @@ Create a markdown-formatted todo item. | ||
## Related projects | ||
## About | ||
You might also be interested in these projects: | ||
<details> | ||
<summary><strong>Contributing</strong></summary> | ||
* [gfm-code-blocks](https://www.npmjs.com/package/gfm-code-blocks): Extract gfm (GitHub Flavored Markdown) fenced code blocks from a string. | [homepage](https://github.com/jonschlinkert/gfm-code-blocks) | ||
* [markdown-link](https://www.npmjs.com/package/markdown-link): Micro util for generating a single markdown link. | [homepage](https://github.com/jonschlinkert/markdown-link) | ||
* [markdown-toc](https://www.npmjs.com/package/markdown-toc): Generate a markdown TOC (table of contents) with Remarkable. | [homepage](https://github.com/jonschlinkert/markdown-toc) | ||
* [remarkable](https://www.npmjs.com/package/remarkable): Markdown parser, done right. 100% Commonmark support, extensions, syntax plugins, high speed - all in… [more](https://www.npmjs.com/package/remarkable) | [homepage](https://github.com/jonschlinkert/remarkable) | ||
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). | ||
## Contributing | ||
</details> | ||
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/markdown-utils/issues/new). | ||
<details> | ||
<summary><strong>Running Tests</strong></summary> | ||
## Building docs | ||
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: | ||
Generate readme and API documentation with [verb](https://github.com/verbose/verb): | ||
```sh | ||
$ npm install verb && npm run docs | ||
$ npm install && npm test | ||
``` | ||
Or, if [verb](https://github.com/verbose/verb) is installed globally: | ||
</details> | ||
```sh | ||
$ verb | ||
``` | ||
<details> | ||
<summary><strong>Building docs</strong></summary> | ||
## Running tests | ||
_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ | ||
Install dev dependencies: | ||
To generate the readme, run the following command: | ||
```sh | ||
$ npm install -d && npm test | ||
$ npm install -g verbose/verb#dev verb-generate-readme && verb | ||
``` | ||
## Author | ||
</details> | ||
### Related projects | ||
You might also be interested in these projects: | ||
* [gfm-code-blocks](https://www.npmjs.com/package/gfm-code-blocks): Extract gfm (GitHub Flavored Markdown) fenced code blocks from a string. | [homepage](https://github.com/jonschlinkert/gfm-code-blocks "Extract gfm (GitHub Flavored Markdown) fenced code blocks from a string.") | ||
* [markdown-link](https://www.npmjs.com/package/markdown-link): Micro util for generating a single markdown link. | [homepage](https://github.com/jonschlinkert/markdown-link "Micro util for generating a single markdown link.") | ||
* [markdown-toc](https://www.npmjs.com/package/markdown-toc): Generate a markdown TOC (table of contents) with Remarkable. | [homepage](https://github.com/jonschlinkert/markdown-toc "Generate a markdown TOC (table of contents) with Remarkable.") | ||
* [remarkable](https://www.npmjs.com/package/remarkable): Markdown parser, done right. 100% Commonmark support, extensions, syntax plugins, high speed - all in… [more](https://github.com/jonschlinkert/remarkable) | [homepage](https://github.com/jonschlinkert/remarkable "Markdown parser, done right. 100% Commonmark support, extensions, syntax plugins, high speed - all in one.") | ||
### Contributors | ||
| **Commits** | **Contributor** | | ||
| --- | --- | | ||
| 49 | [jonschlinkert](https://github.com/jonschlinkert) | | ||
| 12 | [adjohnson916](https://github.com/adjohnson916) | | ||
### Author | ||
**Jon Schlinkert** | ||
* [github/jonschlinkert](https://github.com/jonschlinkert) | ||
* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) | ||
* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) | ||
* [GitHub Profile](https://github.com/jonschlinkert) | ||
* [Twitter Profile](https://twitter.com/jonschlinkert) | ||
## License | ||
### License | ||
Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). | ||
Released under the [MIT license](https://github.com/jonschlinkert/markdown-utils/blob/master/LICENSE). | ||
Copyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert). | ||
Released under the [MIT License](LICENSE). | ||
*** | ||
_This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on April 23, 2016._ | ||
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on July 05, 2018._ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
21061
2
2
0
479
334
+ Addedfill-range@6.0.0(transitive)
+ Addedis-number@7.0.0(transitive)
+ Addedlist-item@2.0.0(transitive)
+ Addedto-regex-range@4.0.3(transitive)
- Removedarray-slice@^0.2.3
- Removedto-gfm-code-block@^0.1.1
- Removedarray-slice@0.2.3(transitive)
- Removedexpand-range@1.8.2(transitive)
- Removedextend-shallow@2.0.1(transitive)
- Removedfill-range@2.2.4(transitive)
- Removedis-buffer@1.1.6(transitive)
- Removedis-extendable@0.1.1(transitive)
- Removedis-number@2.1.04.0.0(transitive)
- Removedisarray@1.0.0(transitive)
- Removedisobject@2.1.0(transitive)
- Removedkind-of@3.2.26.0.3(transitive)
- Removedlist-item@1.1.1(transitive)
- Removedmath-random@1.0.4(transitive)
- Removedrandomatic@3.1.1(transitive)
- Removedrepeat-element@1.1.4(transitive)
- Removedrepeat-string@1.6.1(transitive)
- Removedto-gfm-code-block@0.1.1(transitive)
Updatedis-number@^7.0.0
Updatedlist-item@^2.0.0