Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/remarkjs/remark/llms.txt

Use this file to discover all available pages before exploring further.

remark is a tool that transforms markdown with plugins. It parses markdown into an abstract syntax tree (AST), lets plugins inspect and modify that tree, and serializes it back to markdown or another format. With 150+ community plugins, remark is the world’s most popular markdown parser ecosystem.

Introduction

Learn what remark is, when to use it, and how the ecosystem fits together.

Quickstart

Get up and running with your first remark transformation in minutes.

Creating Plugins

Build your own remark plugin to inspect or transform markdown ASTs.

API Reference

Explore the full API for remark, remark-parse, and remark-stringify.

Why remark?

remark treats markdown as structured data — an AST — rather than raw text. This makes it straightforward to write programs (plugins) that reliably inspect, transform, and generate markdown.

CommonMark Compliant

100% compliant with CommonMark. GFM and MDX supported via plugins.

150+ Plugins

A rich ecosystem of plugins for linting, HTML output, TOC generation, and more.

TypeScript Ready

Fully typed with TypeScript. Types for mdast are available via @types/mdast.

Universal

Works in Node.js (16+), Deno, and browsers via esm.sh.

AST-Based

Inspect and change markdown as a structured tree with mdast.

CLI Included

remark-cli lets you lint and format markdown files from the terminal.

Get started in 3 steps

1

Install remark

Install the core package (or remark-cli for the command line):
npm install remark
2

Add plugins and process markdown

Combine remark with plugins using the unified .use() API:
import { remark } from 'remark'
import remarkToc from 'remark-toc'

const file = await remark()
  .use(remarkToc)
  .process('# Hello\n\n## Contents\n\n## World\n')

console.log(String(file))
3

Explore the ecosystem

Browse plugins, read the guides, and check the API reference to build something great.

Packages in this repo

remark is a monorepo containing four packages:
PackageDescription
remarkUnified processor preset with parse + stringify
remark-parsePlugin to parse markdown into an mdast
remark-stringifyPlugin to serialize an mdast to markdown
remark-cliCLI to inspect and format markdown files

Build docs developers (and LLMs) love