@voxpelli/remark-preset
v0.1.1
Published
Personal markdown style
Readme
@voxpelli/remark-preset
My personal remark preset – used to lint and format all the markdown files I work on.
Install
npm install --save-dev @voxpelli/remark-presetTo use the npm scripts below, also install remark-cli as a dev dependency:
npm install --save-dev remark-cliUsage
Add a remarkConfig to your package.json:
{
"remarkConfig": {
"plugins": ["@voxpelli/remark-preset"]
}
}Optionally add these scripts to your package.json (requires remark-cli):
{
"scripts": {
"check:md": "remark .",
"fix:md": "remark . -o"
}
}check:md lints all markdown files. fix:md additionally rewrites them in place with normalised formatting.
Or use the preset programmatically:
import { remark } from 'remark';
import voxpelliRemarkPreset from '@voxpelli/remark-preset';
const file = await remark()
.use(voxpelliRemarkPreset)
.process('# Hello\n\nSome _content_ here.\n');
console.log(String(file));Checks
- extends
remark-preset-lint-recommendedandremark-preset-lint-consistent - enforces
-for unordered list item bullets - checks broken local links
- supports GFM (tables, strikethrough, task lists, etc.)
- supports YAML frontmatter
Formatting
When used with --output (e.g. remark . -o), the preset also normalises markdown output:
- list bullets:
* - emphasis:
_, strong:** - horizontal rules:
- - code blocks: fenced with
` - list item indent: one space
API
This package exports no named identifiers. The default export is voxpelliRemarkPreset, a Preset for unified.
Similar modules
remark-preset-lint-consistent– rules that enforce consistency across a documentremark-preset-lint-recommended– rules that prevent mistakes or syntactic ambiguitiesremark-preset-wooorm– personal markdown style by Titus Wormer
See also
remark-cli– CLI to process markdown with remarkremark– markdown processor powered by pluginsunified– interface for processing text with syntax trees
