remark-usage
Advanced tools
Comparing version 8.0.0 to 9.0.0
'use strict' | ||
var nanoid = require('nanoid') | ||
var nanoid = require('nanoid').nanoid | ||
var resolveFrom = require('resolve-from') | ||
@@ -5,0 +5,0 @@ var relativeModule = require('../util/relative-module') |
@@ -63,9 +63,7 @@ 'use strict' | ||
while (++index < length) { | ||
try { | ||
filePath = resolveFrom(cwd, examples[index]) | ||
} catch (_) { | ||
continue | ||
filePath = resolveFrom.silent(cwd, examples[index]) | ||
if (filePath) { | ||
return next(filePath) | ||
} | ||
return next(filePath) | ||
} | ||
@@ -72,0 +70,0 @@ |
@@ -5,6 +5,7 @@ 'use strict' | ||
var markdown = require('remark-parse') | ||
var clear = require('unist-util-remove-position') | ||
module.exports = generate | ||
var processor = unified().use(markdown, {position: false}) | ||
var processor = unified().use(markdown) | ||
@@ -31,3 +32,4 @@ function generate(ctx) { | ||
function comment(node) { | ||
return processor.parse(node.values.join('')).children | ||
var tree = clear(processor.parse(node.values.join(''))) | ||
return tree.children | ||
} | ||
@@ -34,0 +36,0 @@ |
{ | ||
"name": "remark-usage", | ||
"version": "8.0.0", | ||
"version": "9.0.0", | ||
"description": "remark plugin to add a usage example to your readme", | ||
@@ -35,7 +35,8 @@ "license": "MIT", | ||
"mdast-util-heading-range": "^2.0.0", | ||
"nanoid": "^2.0.0", | ||
"remark-parse": "^7.0.0", | ||
"nanoid": "^3.0.0", | ||
"remark-parse": "^9.0.0", | ||
"resolve-from": "^5.0.0", | ||
"trough": "^1.0.0", | ||
"unified": "^8.0.0" | ||
"unified": "^9.0.0", | ||
"unist-util-remove-position": "^3.0.0" | ||
}, | ||
@@ -47,8 +48,8 @@ "devDependencies": { | ||
"prettier": "^2.0.0", | ||
"remark": "^11.0.0", | ||
"remark-cli": "^7.0.0", | ||
"remark-preset-wooorm": "^6.0.0", | ||
"tape": "^4.0.0", | ||
"remark": "^13.0.0", | ||
"remark-cli": "^9.0.0", | ||
"remark-preset-wooorm": "^8.0.0", | ||
"tape": "^5.0.0", | ||
"to-vfile": "^6.0.0", | ||
"xo": "^0.28.0" | ||
"xo": "^0.33.0" | ||
}, | ||
@@ -58,3 +59,3 @@ "scripts": { | ||
"#": "xo currently crashes on invalid `package.json`s in fixtures: && xo --fix", | ||
"format:js": "prettier --no-config --config ./package.json --write \"**/*.js\"", | ||
"format:js": "prettier . --no-config --config ./package.json --write", | ||
"format": "npm run format:md && npm run format:js", | ||
@@ -83,2 +84,3 @@ "test-api": "node test", | ||
"rules": { | ||
"unicorn/prefer-optional-catch-binding": "off", | ||
"unicorn/string-content": "off" | ||
@@ -92,16 +94,4 @@ }, | ||
"remarkConfig": { | ||
"plugins": [ | ||
"preset-wooorm", | ||
[ | ||
"remark-lint-fenced-code-flag", | ||
false | ||
], | ||
[ | ||
"./", | ||
{ | ||
"heading": "use" | ||
} | ||
] | ||
] | ||
"plugins": [] | ||
} | ||
} |
@@ -13,2 +13,8 @@ # remark-usage | ||
## Note! | ||
This plugin is ready for the new parser in remark | ||
([`remarkjs/remark#536`](https://github.com/remarkjs/remark/pull/536)). | ||
No change is needed: it works exactly the same now as it did before! | ||
## Install | ||
@@ -62,5 +68,3 @@ | ||
var file = await remark() | ||
.use(usage) | ||
.process(file) | ||
var file = await remark().use(usage).process(file) | ||
``` | ||
@@ -187,3 +191,3 @@ | ||
[build-badge]: https://img.shields.io/travis/remarkjs/remark-usage/master.svg | ||
[build-badge]: https://img.shields.io/travis/remarkjs/remark-usage/main.svg | ||
@@ -210,5 +214,5 @@ [build]: https://travis-ci.org/remarkjs/remark-usage | ||
[chat-badge]: https://img.shields.io/badge/chat-spectrum-7b16ff.svg | ||
[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg | ||
[chat]: https://spectrum.chat/unified/remark | ||
[chat]: https://github.com/remarkjs/remark/discussions | ||
@@ -219,7 +223,7 @@ [npm]: https://docs.npmjs.com/cli/install | ||
[contributing]: https://github.com/remarkjs/.github/blob/master/contributing.md | ||
[contributing]: https://github.com/remarkjs/.github/blob/HEAD/contributing.md | ||
[support]: https://github.com/remarkjs/.github/blob/master/support.md | ||
[support]: https://github.com/remarkjs/.github/blob/HEAD/support.md | ||
[coc]: https://github.com/remarkjs/.github/blob/master/code-of-conduct.md | ||
[coc]: https://github.com/remarkjs/.github/blob/HEAD/code-of-conduct.md | ||
@@ -226,0 +230,0 @@ [license]: license |
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
23458
242
8
+ Added@types/mdast@3.0.15(transitive)
+ Addedmdast-util-from-markdown@0.8.5(transitive)
+ Addedmdast-util-to-string@2.0.0(transitive)
+ Addedmicromark@2.11.4(transitive)
+ Addednanoid@3.3.7(transitive)
+ Addedparse-entities@2.0.0(transitive)
+ Addedremark-parse@9.0.0(transitive)
+ Addedunified@9.2.2(transitive)
+ Addedunist-util-is@4.1.0(transitive)
+ Addedunist-util-remove-position@3.0.0(transitive)
+ Addedunist-util-visit@2.0.3(transitive)
+ Addedunist-util-visit-parents@3.1.1(transitive)
- Removedcollapse-white-space@1.0.6(transitive)
- Removedinherits@2.0.4(transitive)
- Removedis-whitespace-character@1.0.4(transitive)
- Removedis-word-character@1.0.4(transitive)
- Removedmarkdown-escapes@1.0.4(transitive)
- Removednanoid@2.1.11(transitive)
- Removedparse-entities@1.2.2(transitive)
- Removedremark-parse@7.0.2(transitive)
- Removedrepeat-string@1.6.1(transitive)
- Removedstate-toggle@1.0.3(transitive)
- Removedtrim@0.0.1(transitive)
- Removedtrim-trailing-lines@1.1.4(transitive)
- Removedunherit@1.1.3(transitive)
- Removedunified@8.4.2(transitive)
- Removedunist-util-is@3.0.0(transitive)
- Removedunist-util-remove-position@1.1.4(transitive)
- Removedunist-util-visit@1.4.1(transitive)
- Removedunist-util-visit-parents@2.1.2(transitive)
- Removedvfile-location@2.0.6(transitive)
- Removedxtend@4.0.2(transitive)
Updatednanoid@^3.0.0
Updatedremark-parse@^9.0.0
Updatedunified@^9.0.0