Skip to content

Commit 05d3e77

Browse files
committed
Refactor prose
1 parent 7ccaf99 commit 05d3e77

12 files changed

Lines changed: 59 additions & 79 deletions

File tree

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.DS_Store
22
.nyc_output
33
*.log
4-
node_modules
5-
coverage
4+
node_modules/
5+
coverage/
66
/remark.js
77
/remark.min.js
88
yarn.lock

.mailmap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Masahiro Miyashiro <[email protected]>
1111
Tom MacWright <[email protected]> Tom MacWright <[email protected]>
1212
1313
Nick Baugh <[email protected]>
14+
Alex Leon <[email protected]>
1415

1516
# User names only.
1617
anonymous (Niggler) <[email protected]>

doc/getting-started.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ It’s built on [unified][], make sure to read it and its [website][] too.
1111
## Contents
1212

1313
* [Intro](#intro)
14-
* [Command-line](#command-line)
14+
* [Command line](#command-line)
1515
* [Using remark in a project](#using-remark-in-a-project)
1616
* [Programmatic usage](#programmatic-usage)
1717

@@ -104,9 +104,9 @@ The `--save-dev` option stores the dependencies in our `package.json`:
104104
"name": "my-package",
105105
"version": "1.0.0",
106106
+ "devDependencies": {
107-
+ "remark-cli": "^8.0.0",
108-
+ "remark-html": "^12.0.0",
109-
+ "remark-preset-lint-markdown-style-guide": "^3.0.0"
107+
+ "remark-cli": "^9.0.0",
108+
+ "remark-html": "^13.0.0",
109+
+ "remark-preset-lint-markdown-style-guide": "^4.0.0"
110110
+ },
111111
"scripts": {
112112
"test": "node test.js"
@@ -122,9 +122,9 @@ configuration:
122122
"name": "my-package",
123123
"version": "1.0.0",
124124
"devDependencies": {
125-
"remark-cli": "^8.0.0",
126-
"remark-html": "^12.0.0",
127-
"remark-preset-lint-markdown-style-guide": "^3.0.0"
125+
"remark-cli": "^9.0.0",
126+
"remark-html": "^13.0.0",
127+
"remark-preset-lint-markdown-style-guide": "^4.0.0"
128128
},
129129
"scripts": {
130130
- "test": "node test.js"
@@ -172,7 +172,7 @@ var report = require('vfile-reporter')
172172
remark()
173173
.use(styleGuide)
174174
.use(html)
175-
.process('_Hello_.', function(err, file) {
175+
.process('_Hello_.', function (err, file) {
176176
console.error(report(err || file))
177177
console.log(String(file))
178178
})

doc/plugins.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ See [Creating plugins][create] below.
5252
* [`remark-code-import`](https://github.com/kevin940726/remark-code-import)
5353
— populate code blocks from files
5454
* [`remark-code-screenshot`](https://github.com/Swizec/remark-code-screenshot)
55-
– turn code blocks into carbon.now.sh screenshots
55+
– turn code blocks into carbon.now\.sh screenshots
5656
* [`remark-codesandbox`](https://github.com/kevin940726/remark-codesandbox)
5757
– create CodeSandbox from code blocks
5858
* [`remark-collapse`](https://github.com/Rokt33r/remark-collapse)

log.txt

Whitespace-only changes.

package.json

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@
2424
"tape": "^5.0.0",
2525
"tinyify": "^3.0.0",
2626
"typescript": "^4.0.0",
27-
"unified": "^9.1.0",
27+
"unified": "^9.0.0",
2828
"unist-util-remove-position": "^3.0.0",
2929
"xo": "^0.33.0"
3030
},
3131
"scripts": {
3232
"postinstall": "lerna bootstrap --no-ci",
33-
"format": "prettier . -w --loglevel warn && xo --fix",
33+
"format": "./packages/remark-cli/cli.js . -qfo && prettier . -w --loglevel warn && xo --fix",
3434
"build-bundle": "browserify packages/remark -s remark > remark.js",
3535
"build-mangle": "browserify packages/remark -s remark -p tinyify > remark.min.js",
3636
"build": "npm run build-bundle && npm run build-mangle",
@@ -56,39 +56,15 @@
5656
"xo": {
5757
"prettier": true,
5858
"esnext": false,
59-
"rules": {
60-
"unicorn/no-fn-reference-in-iterator": "off",
61-
"unicorn/prefer-includes": "off",
62-
"unicorn/prefer-number-properties": "off",
63-
"unicorn/prefer-type-error": "off",
64-
"unicorn/prefer-reflect-apply": "off",
65-
"unicorn/string-content": "off",
66-
"complexity": "off",
67-
"eqeqeq": [
68-
"error",
69-
"always",
70-
{
71-
"null": "ignore"
72-
}
73-
],
74-
"guard-for-in": "off",
75-
"max-depth": "off",
76-
"no-eq-null": "off"
77-
},
59+
"rules": {},
7860
"ignores": [
7961
"**/types",
8062
"remark.js"
8163
]
8264
},
8365
"remarkConfig": {
8466
"plugins": [
85-
"preset-wooorm",
86-
[
87-
"toc",
88-
{
89-
"heading": "contents"
90-
}
91-
]
67+
"preset-wooorm"
9268
]
9369
}
9470
}

packages/remark-cli/readme.md

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -44,32 +44,35 @@ info on all available options.
4444
```txt
4545
Usage: remark [options] [path | glob ...]
4646
47-
CLI to process Markdown with remark using plugins
47+
CLI to process Markdown with remark
4848
4949
Options:
5050
51-
-h --help output usage information
52-
-v --version output version number
53-
-o --output [path] specify output location
54-
-r --rc-path <path> specify configuration file
55-
-i --ignore-path <path> specify ignore file
56-
-s --setting <settings> specify settings
57-
-e --ext <extensions> specify extensions
58-
-u --use <plugins> use plugins
59-
-w --watch watch for changes and reprocess
60-
-q --quiet output only warnings and errors
61-
-S --silent output only errors
62-
-f --frail exit with 1 on warnings
63-
-t --tree specify input and output as syntax tree
64-
--report <reporter> specify reporter
65-
--file-path <path> specify path to process as
66-
--tree-in specify input as syntax tree
67-
--tree-out output syntax tree
68-
--inspect output formatted syntax tree
69-
--[no-]stdout specify writing to stdout (on by default)
70-
--[no-]color specify color in report (on by default)
71-
--[no-]config search for configuration files (on by default)
72-
--[no-]ignore search for ignore files (on by default)
51+
-h --help output usage information
52+
-v --version output version number
53+
-o --output [path] specify output location
54+
-r --rc-path <path> specify configuration file
55+
-i --ignore-path <path> specify ignore file
56+
-s --setting <settings> specify settings
57+
-e --ext <extensions> specify extensions
58+
-u --use <plugins> use plugins
59+
-w --watch watch for changes and reprocess
60+
-q --quiet output only warnings and errors
61+
-S --silent output only errors
62+
-f --frail exit with 1 on warnings
63+
-t --tree specify input and output as syntax tree
64+
--report <reporter> specify reporter
65+
--file-path <path> specify path to process as
66+
--ignore-path-resolve-from dir|cwd resolve patterns in `ignore-path` from its directory or cwd
67+
--ignore-pattern <globs> specify ignore patterns
68+
--silently-ignore do not fail when given ignored files
69+
--tree-in specify input as syntax tree
70+
--tree-out output syntax tree
71+
--inspect output formatted syntax tree
72+
--[no-]stdout specify writing to stdout (on by default)
73+
--[no-]color specify color in report (on by default)
74+
--[no-]config search for configuration files (on by default)
75+
--[no-]ignore search for ignore files (on by default)
7376
7477
Examples:
7578

packages/remark-parse/readme.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010

1111
[Parser][] for [**unified**][unified].
1212
Parses Markdown to [**mdast**][mdast] syntax trees.
13-
Built on [micromark][].
13+
Built on [`micromark`][micromark] and
14+
[`mdast-util-from-markdown`][from-markdown].
1415
Used in the [**remark** processor][remark] but can be used on its own as well.
1516
Can be [extended][extend] to change how Markdown is parsed.
1617

@@ -31,10 +32,7 @@ var markdown = require('remark-parse')
3132
var remark2rehype = require('remark-rehype')
3233
var html = require('rehype-stringify')
3334

34-
var processor = unified()
35-
.use(markdown)
36-
.use(remark2rehype)
37-
.use(html)
35+
var processor = unified().use(markdown).use(remark2rehype).use(html)
3836

3937
process.stdin.pipe(createStream(processor)).pipe(process.stdout)
4038
```

packages/remark-stringify/readme.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ are supported and will be passed through.
6262
## Extending the compiler
6363

6464
See [`mdast-util-to-markdown`][to-markdown].
65-
Then create a wrapper plugin such as `remark-gfm`.
65+
Then create a wrapper plugin such as [`remark-gfm`][remark-gfm].
6666

6767
## Security
6868

@@ -206,3 +206,5 @@ Support this effort and give back by sponsoring on [OpenCollective][collective]!
206206
[to-markdown-options]: https://github.com/syntax-tree/mdast-util-to-markdown#formatting-options
207207

208208
[extend]: #extending-the-compiler
209+
210+
[remark-gfm]: https://github.com/remarkjs/remark-gfm

packages/remark-stringify/test.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -314,11 +314,7 @@ test('remark().stringify(ast, file)', function (t) {
314314
['capitalized image references - shortcut', '![Bravo]']
315315
]
316316

317-
tests.forEach(each)
318-
319-
st.end()
320-
321-
function each(test) {
317+
tests.forEach(function (test) {
322318
st.equal(
323319
unified()
324320
.use(parse)
@@ -328,7 +324,9 @@ test('remark().stringify(ast, file)', function (t) {
328324
test[1] + '\n\n[bravo]: #\n',
329325
test[0]
330326
)
331-
}
327+
})
328+
329+
st.end()
332330
})
333331

334332
t.test('should process associations without label', function (st) {

0 commit comments

Comments
 (0)