1.0.0 • Published 10 months ago

@binz/config-remark v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

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 prettier for formatting

Setup

Add workspace reference to @binz/config-remark and its peer dependencies:

pnpm add -w @binz/config-remark remark remark-cli

Add 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-remark

Usage

Manual usage from command line:

pnpm remark .
pnpm remark:fix .