Plugins
Edit on GitHubThe remark and rehype plugins most docs sites need.
import {
remarkGfm,
rehypeSlug,
rehypeAutolinkHeadings,
rehypeCodeTitles,
rehypePrism,
rehypeCodeRaw,
} from "@ariadocs/mdx/plugins";
| Plugin | What it does |
|---|---|
remarkGfm | Tables, task lists and strikethrough |
rehypeSlug | Adds ids to headings, so TOC links work |
rehypeAutolinkHeadings | Makes headings clickable |
rehypeCodeTitles | Shows the title="file.ts" of a code block above it |
rehypePrism | Syntax highlighting |
rehypeCodeRaw | Lets the Pre component copy the original code |
Put rehypeCodeRaw after rehypePrism:
rehypePlugins: [rehypeSlug, rehypeAutolinkHeadings, rehypeCodeTitles, rehypePrism, rehypeCodeRaw];
The color themes for highlighted code are in @ariadocs/components. See syntax themes.