1.0.1 • Published 11 months ago
@binz/config-remark v1.0.1
Remark configuration
remark handles linting, formatting and generative content for markdown files (.md).
@binz/config-remark is a shared custom configuration for the remark markdown processor.
- Ensures language flags set on all codeblocks
- Supports frontmatter in markdown files
- Uses
prettierfor formatting
Setup
Add workspace reference to @binz/config-remark and its peer dependencies:
pnpm add -w @binz/config-remark remark remark-cliAdd remark configuration file:
// .remarkrc.mjs
export { default } from '@binz/config-remark';Add remark ignore patterns file:
# .remarkignore
node_modules/
# Next ignore patterns
.next/
.build/
.coverage/
# Custom ignore patterns
...Add remark scripts:
// package.json
...
"scripts": {
...
"remark": "remark",
"remark:fix": "pnpm remark --output --"
...
}Automation
The remark vscode plugin automates linting and formatting markdown files on on save.
Install vs code remark plugin by using Quick Open (Ctrl + P) and running the following command:
ext install unifiedjs.vscode-remarkUsage
Manual usage from command line:
pnpm remark .
pnpm remark:fix .