diff --git a/.gitignore b/.gitignore index 53501997c..aa4ac9c84 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,8 @@ .DS_Store .nyc_output *.log -node_modules -coverage +node_modules/ +coverage/ /remark.js /remark.min.js yarn.lock diff --git a/.mailmap b/.mailmap index e131c21c1..25a32da2f 100644 --- a/.mailmap +++ b/.mailmap @@ -11,6 +11,7 @@ Masahiro Miyashiro <3846masahiro+git@gmail.com> Tom MacWright Tom MacWright Min RK MinRK Nick Baugh +Alex Leon # User names only. anonymous (Niggler) diff --git a/doc/getting-started.md b/doc/getting-started.md index aa4601d1c..6e80d2997 100644 --- a/doc/getting-started.md +++ b/doc/getting-started.md @@ -11,7 +11,7 @@ It’s built on [unified][], make sure to read it and its [website][] too. ## Contents * [Intro](#intro) -* [Command-line](#command-line) +* [Command line](#command-line) * [Using remark in a project](#using-remark-in-a-project) * [Programmatic usage](#programmatic-usage) @@ -104,9 +104,9 @@ The `--save-dev` option stores the dependencies in our `package.json`: "name": "my-package", "version": "1.0.0", + "devDependencies": { -+ "remark-cli": "^8.0.0", -+ "remark-html": "^12.0.0", -+ "remark-preset-lint-markdown-style-guide": "^3.0.0" ++ "remark-cli": "^9.0.0", ++ "remark-html": "^13.0.0", ++ "remark-preset-lint-markdown-style-guide": "^4.0.0" + }, "scripts": { "test": "node test.js" @@ -122,9 +122,9 @@ configuration: "name": "my-package", "version": "1.0.0", "devDependencies": { - "remark-cli": "^8.0.0", - "remark-html": "^12.0.0", - "remark-preset-lint-markdown-style-guide": "^3.0.0" + "remark-cli": "^9.0.0", + "remark-html": "^13.0.0", + "remark-preset-lint-markdown-style-guide": "^4.0.0" }, "scripts": { - "test": "node test.js" @@ -172,7 +172,7 @@ var report = require('vfile-reporter') remark() .use(styleGuide) .use(html) - .process('_Hello_.', function(err, file) { + .process('_Hello_.', function (err, file) { console.error(report(err || file)) console.log(String(file)) }) diff --git a/doc/plugins.md b/doc/plugins.md index f8fa18769..13ff124a2 100644 --- a/doc/plugins.md +++ b/doc/plugins.md @@ -52,7 +52,7 @@ See [Creating plugins][create] below. * [`remark-code-import`](https://github.com/kevin940726/remark-code-import) — populate code blocks from files * [`remark-code-screenshot`](https://github.com/Swizec/remark-code-screenshot) - – turn code blocks into carbon.now.sh screenshots + – turn code blocks into carbon.now\.sh screenshots * [`remark-codesandbox`](https://github.com/kevin940726/remark-codesandbox) – create CodeSandbox from code blocks * [`remark-collapse`](https://github.com/Rokt33r/remark-collapse) diff --git a/log.txt b/log.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/package.json b/package.json index 081e18c45..b5742599c 100644 --- a/package.json +++ b/package.json @@ -24,13 +24,13 @@ "tape": "^5.0.0", "tinyify": "^3.0.0", "typescript": "^4.0.0", - "unified": "^9.1.0", + "unified": "^9.0.0", "unist-util-remove-position": "^3.0.0", "xo": "^0.33.0" }, "scripts": { "postinstall": "lerna bootstrap --no-ci", - "format": "prettier . -w --loglevel warn && xo --fix", + "format": "./packages/remark-cli/cli.js . -qfo && prettier . -w --loglevel warn && xo --fix", "build-bundle": "browserify packages/remark -s remark > remark.js", "build-mangle": "browserify packages/remark -s remark -p tinyify > remark.min.js", "build": "npm run build-bundle && npm run build-mangle", @@ -56,25 +56,7 @@ "xo": { "prettier": true, "esnext": false, - "rules": { - "unicorn/no-fn-reference-in-iterator": "off", - "unicorn/prefer-includes": "off", - "unicorn/prefer-number-properties": "off", - "unicorn/prefer-type-error": "off", - "unicorn/prefer-reflect-apply": "off", - "unicorn/string-content": "off", - "complexity": "off", - "eqeqeq": [ - "error", - "always", - { - "null": "ignore" - } - ], - "guard-for-in": "off", - "max-depth": "off", - "no-eq-null": "off" - }, + "rules": {}, "ignores": [ "**/types", "remark.js" @@ -82,13 +64,7 @@ }, "remarkConfig": { "plugins": [ - "preset-wooorm", - [ - "toc", - { - "heading": "contents" - } - ] + "preset-wooorm" ] } } diff --git a/packages/remark-cli/readme.md b/packages/remark-cli/readme.md index b1f4e5a93..25546ea6c 100644 --- a/packages/remark-cli/readme.md +++ b/packages/remark-cli/readme.md @@ -44,32 +44,35 @@ info on all available options. ```txt Usage: remark [options] [path | glob ...] - CLI to process Markdown with remark using plugins + CLI to process Markdown with remark Options: - -h --help output usage information - -v --version output version number - -o --output [path] specify output location - -r --rc-path specify configuration file - -i --ignore-path specify ignore file - -s --setting specify settings - -e --ext specify extensions - -u --use use plugins - -w --watch watch for changes and reprocess - -q --quiet output only warnings and errors - -S --silent output only errors - -f --frail exit with 1 on warnings - -t --tree specify input and output as syntax tree - --report specify reporter - --file-path specify path to process as - --tree-in specify input as syntax tree - --tree-out output syntax tree - --inspect output formatted syntax tree - --[no-]stdout specify writing to stdout (on by default) - --[no-]color specify color in report (on by default) - --[no-]config search for configuration files (on by default) - --[no-]ignore search for ignore files (on by default) + -h --help output usage information + -v --version output version number + -o --output [path] specify output location + -r --rc-path specify configuration file + -i --ignore-path specify ignore file + -s --setting specify settings + -e --ext specify extensions + -u --use use plugins + -w --watch watch for changes and reprocess + -q --quiet output only warnings and errors + -S --silent output only errors + -f --frail exit with 1 on warnings + -t --tree specify input and output as syntax tree + --report specify reporter + --file-path specify path to process as + --ignore-path-resolve-from dir|cwd resolve patterns in `ignore-path` from its directory or cwd + --ignore-pattern specify ignore patterns + --silently-ignore do not fail when given ignored files + --tree-in specify input as syntax tree + --tree-out output syntax tree + --inspect output formatted syntax tree + --[no-]stdout specify writing to stdout (on by default) + --[no-]color specify color in report (on by default) + --[no-]config search for configuration files (on by default) + --[no-]ignore search for ignore files (on by default) Examples: diff --git a/packages/remark-parse/readme.md b/packages/remark-parse/readme.md index 8e2789ebd..5b4faefb7 100644 --- a/packages/remark-parse/readme.md +++ b/packages/remark-parse/readme.md @@ -10,7 +10,8 @@ [Parser][] for [**unified**][unified]. Parses Markdown to [**mdast**][mdast] syntax trees. -Built on [micromark][]. +Built on [`micromark`][micromark] and +[`mdast-util-from-markdown`][from-markdown]. Used in the [**remark** processor][remark] but can be used on its own as well. Can be [extended][extend] to change how Markdown is parsed. @@ -31,10 +32,7 @@ var markdown = require('remark-parse') var remark2rehype = require('remark-rehype') var html = require('rehype-stringify') -var processor = unified() - .use(markdown) - .use(remark2rehype) - .use(html) +var processor = unified().use(markdown).use(remark2rehype).use(html) process.stdin.pipe(createStream(processor)).pipe(process.stdout) ``` diff --git a/packages/remark-stringify/readme.md b/packages/remark-stringify/readme.md index 81396c644..18312cc0b 100644 --- a/packages/remark-stringify/readme.md +++ b/packages/remark-stringify/readme.md @@ -62,7 +62,7 @@ are supported and will be passed through. ## Extending the compiler See [`mdast-util-to-markdown`][to-markdown]. -Then create a wrapper plugin such as `remark-gfm`. +Then create a wrapper plugin such as [`remark-gfm`][remark-gfm]. ## Security @@ -206,3 +206,5 @@ Support this effort and give back by sponsoring on [OpenCollective][collective]! [to-markdown-options]: https://github.com/syntax-tree/mdast-util-to-markdown#formatting-options [extend]: #extending-the-compiler + +[remark-gfm]: https://github.com/remarkjs/remark-gfm diff --git a/packages/remark-stringify/test.js b/packages/remark-stringify/test.js index 148f5fd56..205031c32 100644 --- a/packages/remark-stringify/test.js +++ b/packages/remark-stringify/test.js @@ -314,11 +314,7 @@ test('remark().stringify(ast, file)', function (t) { ['capitalized image references - shortcut', '![Bravo]'] ] - tests.forEach(each) - - st.end() - - function each(test) { + tests.forEach(function (test) { st.equal( unified() .use(parse) @@ -328,7 +324,9 @@ test('remark().stringify(ast, file)', function (t) { test[1] + '\n\n[bravo]: #\n', test[0] ) - } + }) + + st.end() }) t.test('should process associations without label', function (st) { diff --git a/packages/remark/readme.md b/packages/remark/readme.md index afa3a4842..ef7eb76c2 100644 --- a/packages/remark/readme.md +++ b/packages/remark/readme.md @@ -68,8 +68,8 @@ Yields: ###### Settings through data -This example prettifies Markdown and configures [`remark-parse`][parse] and -[`remark-stringify`][stringify] through [data][]. +This example prettifies Markdown and configures [`remark-stringify`][stringify] +through [data][]. ```js var remark = require('remark') diff --git a/readme.md b/readme.md index 1eaa06a0c..e6983c9f3 100644 --- a/readme.md +++ b/readme.md @@ -8,8 +8,8 @@ [![Backers][backers-badge]][collective] [![Chat][chat-badge]][chat] -**remark** is a Markdown processor powered by [plugins][] part of the -[unified][] collective. +**remark** is a Markdown processor built on [micromark][] powered by +[plugins][] part of the [unified][] collective. ## Intro @@ -25,7 +25,7 @@ contents (`remark-toc`)][remark-toc], or [compiling to man pages Internally, remark now uses [**`micromark`**][micromark], a new, fast, and tiny CommonMark compliant Markdown tokenizer. -It can be GFM compliant with `remark-gfm`. +It can be GFM compliant with [`remark-gfm`][remark-gfm]. Finally, remark is part of the [unified][website] [collective][governance]. Learn more about us: @@ -203,3 +203,5 @@ Support this effort and give back by sponsoring on [OpenCollective][collective]! [sanitize]: https://github.com/rehypejs/rehype-sanitize [micromark]: https://github.com/micromark/micromark + +[remark-gfm]: https://github.com/remarkjs/remark-gfm