remark-preset-wooorm
My personal markdown (and prose) style.
Contents
- What is this?
- When should I use this?
- Install
- Use
- API
- Checks
- Types
- Compatibility
- Related
- Contribute
- License
What is this?
This is a preset for remark to check markdown. It’s used on all the readmes I work on.
When should I use this?
Feel free to use this. But you can also create your own personal style preset.
Install
This package is ESM only. In Node.js (version 14.14+, 16.0+), install with npm:
npm install remark-preset-wooorm
In Deno with esm.sh
:
import remarkPresetWooorm from 'https://esm.sh/remark-preset-wooorm@9'
In browsers with esm.sh
:
<script type="module">
import remarkPresetWooorm from 'https://esm.sh/remark-preset-wooorm@9?bundle'
</script>
Use
import {remark} from 'remark'
import remarkPresetWooorm from 'remark-preset-wooorm'
import {reporter} from 'vfile-reporter'
const file = await remark()
.use(remarkPresetWooorm)
.process('This *and* _and_ that.')
console.error(reporter(file))
Yields:
1:1 warning Missing newline character at end of file final-newline remark-lint
1:7-1:16 warning Expected `and` once, not twice and retext-repeated-words
1:12-1:17 warning Emphasis should use `*` as a marker emphasis-marker remark-lint
⚠ 3 warnings
API
This package exports no identifiers.
The default export is remarkPresetWooorm
.
remarkPresetWooorm
Preset to support my personal markdown style.
Checks
Markdown
- extends
remark-preset-lint-recommended
, and adds a strict code-style (seeindex.js
) - checks broken local links
- markdown is compiled with asterisks (
*
) for list-item bullets and emphasis, and fenced code blocks (note: setoutput: true
in your config to benefit from this) - how remark compiles can be configured inline with comments
Contents
headers are kept up to date, with a depth of3
(ifoutput: true
)- GH references, like mentions or issue references, are linked (if
output: true
)
Natural language
See retext-preset-wooorm
for more info.
- English parsing
- two spaces between sentences (but: prefer a line break instead!)
- checks “indefinite articles”: “a” or “an”
- checks quotes and apostrophes (
""
>“”
) - checks accidental repeated words
- checks diacritics
- checks redundant acronyms
- checks incorrectly placed apostrophes in contractions
Types
This package is fully typed with TypeScript. It exports no additional types.
Compatibility
This package is at least compatible with all maintained versions of Node.js. As of now, that is Node.js 14.14+ and 16.0+. It also works in Deno and modern browsers.
Related
retext-preset-wooorm
— personal markdown style
Contribute
Yes please! See How to Contribute to Open Source.