remark-retext
Advanced tools
Comparing version 3.1.0 to 3.1.1
24
index.js
@@ -1,6 +0,6 @@ | ||
'use strict'; | ||
'use strict' | ||
var mdast2nlcst = require('mdast-util-to-nlcst'); | ||
var mdast2nlcst = require('mdast-util-to-nlcst') | ||
module.exports = remark2retext; | ||
module.exports = remark2retext | ||
@@ -13,4 +13,4 @@ /* Attacher. | ||
function remark2retext(destination, options) { | ||
var fn = destination && destination.run ? bridge : mutate; | ||
return fn(destination, options); | ||
var fn = destination && destination.run ? bridge : mutate | ||
return fn(destination, options) | ||
} | ||
@@ -20,5 +20,5 @@ | ||
function mutate(parser, options) { | ||
return transformer; | ||
return transformer | ||
function transformer(node, file) { | ||
return mdast2nlcst(node, file, parser, options); | ||
return mdast2nlcst(node, file, parser, options) | ||
} | ||
@@ -30,11 +30,11 @@ } | ||
function bridge(destination, options) { | ||
return transformer; | ||
return transformer | ||
function transformer(node, file, next) { | ||
var Parser = destination.freeze().Parser; | ||
var tree = mdast2nlcst(node, file, Parser, options); | ||
destination.run(tree, file, done); | ||
var Parser = destination.freeze().Parser | ||
var tree = mdast2nlcst(node, file, Parser, options) | ||
destination.run(tree, file, done) | ||
function done(err) { | ||
next(err); | ||
next(err) | ||
} | ||
} | ||
} |
{ | ||
"name": "remark-retext", | ||
"version": "3.1.0", | ||
"version": "3.1.1", | ||
"description": "retext support for remark", | ||
@@ -12,4 +12,4 @@ "license": "MIT", | ||
], | ||
"repository": "wooorm/remark-retext", | ||
"bugs": "https://github.com/wooorm/remark-retext/issues", | ||
"repository": "remarkjs/remark-retext", | ||
"bugs": "https://github.com/remarkjs/remark-retext/issues", | ||
"author": "Titus Wormer <tituswormer@gmail.com> (http://wooorm.com)", | ||
@@ -26,24 +26,24 @@ "contributors": [ | ||
"devDependencies": { | ||
"browserify": "^14.0.0", | ||
"esmangle": "^1.0.1", | ||
"nyc": "^11.0.0", | ||
"remark-cli": "^4.0.0", | ||
"remark-parse": "^4.0.0", | ||
"remark-preset-wooorm": "^3.0.0", | ||
"remark-stringify": "^4.0.0", | ||
"browserify": "^16.0.0", | ||
"nyc": "^12.0.0", | ||
"prettier": "^1.14.2", | ||
"remark-cli": "^5.0.0", | ||
"remark-parse": "^5.0.0", | ||
"remark-preset-wooorm": "^4.0.0", | ||
"remark-stringify": "^5.0.0", | ||
"retext-english": "^3.0.0", | ||
"retext-stringify": "^2.0.0", | ||
"tape": "^4.0.0", | ||
"unified": "^6.0.0", | ||
"xo": "^0.18.0" | ||
"tinyify": "^2.4.3", | ||
"unified": "^7.0.0", | ||
"xo": "^0.22.0" | ||
}, | ||
"scripts": { | ||
"build-md": "remark . -qfo", | ||
"build-bundle": "browserify index.js --bare -s remarkRetext > remark-retext.js", | ||
"build-mangle": "esmangle remark-retext.js > remark-retext.min.js", | ||
"build": "npm run build-md && npm run build-bundle && npm run build-mangle", | ||
"lint": "xo", | ||
"test-api": "node test.js", | ||
"format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", | ||
"build-bundle": "browserify . -s remarkRetext > remark-retext.js", | ||
"build-mangle": "browserify . -s remarkRetext -p tinyify > remark-retext.min.js", | ||
"build": "npm run build-bundle && npm run build-mangle", | ||
"test-api": "node test", | ||
"test-coverage": "nyc --reporter lcov tape test.js", | ||
"test": "npm run build && npm run lint && npm run test-coverage" | ||
"test": "npm run format && npm run build && npm run test-coverage" | ||
}, | ||
@@ -56,4 +56,12 @@ "nyc": { | ||
}, | ||
"prettier": { | ||
"tabWidth": 2, | ||
"useTabs": false, | ||
"singleQuote": true, | ||
"bracketSpacing": false, | ||
"semi": false, | ||
"trailingComma": "none" | ||
}, | ||
"xo": { | ||
"space": true, | ||
"prettier": true, | ||
"esnext": false, | ||
@@ -60,0 +68,0 @@ "ignores": [ |
@@ -1,2 +0,2 @@ | ||
# remark-retext [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov] | ||
# remark-retext [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov] [![Chat][chat-badge]][chat] | ||
@@ -24,18 +24,23 @@ Bridge / mutate from [**remark**][remark] to [**retext**][retext]. | ||
```javascript | ||
var vfile = require('to-vfile'); | ||
var report = require('vfile-reporter'); | ||
var unified = require('unified'); | ||
var parse = require('remark-parse'); | ||
var stringify = require('remark-stringify'); | ||
var remark2retext = require('remark-retext'); | ||
var english = require('retext-english'); | ||
var equality = require('retext-equality'); | ||
var vfile = require('to-vfile') | ||
var report = require('vfile-reporter') | ||
var unified = require('unified') | ||
var parse = require('remark-parse') | ||
var stringify = require('remark-stringify') | ||
var remark2retext = require('remark-retext') | ||
var english = require('retext-english') | ||
var equality = require('retext-equality') | ||
unified() | ||
.use(parse) | ||
.use(remark2retext, unified().use(english).use(equality)) | ||
.use( | ||
remark2retext, | ||
unified() | ||
.use(english) | ||
.use(equality) | ||
) | ||
.use(stringify) | ||
.process(vfile.readSync('example.md'), function (err, file) { | ||
console.error(report(err || file)); | ||
}); | ||
.process(vfile.readSync('example.md'), function(err, file) { | ||
console.error(report(err || file)) | ||
}) | ||
``` | ||
@@ -78,7 +83,7 @@ | ||
* [`rehype-retext`](https://github.com/wooorm/rehype-retext) | ||
* [`rehype-retext`](https://github.com/rehypejs/rehype-retext) | ||
— Transform HTML to [NLCST][] | ||
* [`remark-rehype`](https://github.com/wooorm/remark-rehype) | ||
* [`remark-rehype`](https://github.com/remarkjs/remark-rehype) | ||
— Transform markdown to HTML | ||
* [`rehype-remark`](https://github.com/wooorm/rehype-remark) | ||
* [`rehype-remark`](https://github.com/rehypejs/rehype-remark) | ||
— Transform HTML to markdown | ||
@@ -88,2 +93,10 @@ * [`mdast-util-to-nlcst`][to-nlcst] | ||
## Contribute | ||
See [`contributing.md` in `remarkjs/remarkj`][contributing] for ways to get | ||
started. | ||
This organisation has a [Code of Conduct][coc]. By interacting with this | ||
repository, organisation, or community you agree to abide by its terms. | ||
## License | ||
@@ -95,10 +108,14 @@ | ||
[travis-badge]: https://img.shields.io/travis/wooorm/remark-retext.svg | ||
[travis-badge]: https://img.shields.io/travis/remarkjs/remark-retext.svg | ||
[travis]: https://travis-ci.org/wooorm/remark-retext | ||
[travis]: https://travis-ci.org/remarkjs/remark-retext | ||
[codecov-badge]: https://img.shields.io/codecov/c/github/wooorm/remark-retext.svg | ||
[codecov-badge]: https://img.shields.io/codecov/c/github/remarkjs/remark-retext.svg | ||
[codecov]: https://codecov.io/github/wooorm/remark-retext | ||
[codecov]: https://codecov.io/github/remarkjs/remark-retext | ||
[chat-badge]: https://img.shields.io/gitter/room/remarkjs/Lobby.svg | ||
[chat]: https://gitter.im/remarkjs/Lobby | ||
[npm]: https://docs.npmjs.com/cli/install | ||
@@ -110,13 +127,13 @@ | ||
[mdast]: https://github.com/wooorm/mdast | ||
[mdast]: https://github.com/syntax-tree/mdast | ||
[remark]: https://github.com/wooorm/remark | ||
[remark]: https://github.com/remarkjs/remark | ||
[retext]: https://github.com/wooorm/retext | ||
[retext]: https://github.com/retextjs/retext | ||
[processor]: https://github.com/wooorm/unified#processor | ||
[processor]: https://github.com/unifiedjs/unified#processor | ||
[bridge]: https://github.com/wooorm/unified#bridge | ||
[bridge]: https://github.com/unifiedjs/unified#processing-between-syntaxes | ||
[nlcst]: https://github.com/wooorm/nlcst | ||
[nlcst]: https://github.com/syntax-tree/nlcst | ||
@@ -130,1 +147,5 @@ [latin]: https://github.com/wooorm/parse-latin | ||
[to-nlcst]: https://github.com/syntax-tree/mdast-util-to-nlcst | ||
[contributing]: https://github.com/remarkjs/remark/blob/master/contributing.md | ||
[coc]: https://github.com/remarkjs/remark/blob/master/code-of-conduct.md |
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 bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
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 bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
7737
146
13