-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Expand file tree
/
Copy pathplugins.mjs
More file actions
36 lines (32 loc) · 1.06 KB
/
plugins.mjs
File metadata and controls
36 lines (32 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
'use strict';
import rehypeShikiji from '@node-core/rehype-shiki/plugin';
import remarkHeadings from '@vcarl/remark-headings';
import rehypeAutolinkHeadings from 'rehype-autolink-headings';
import rehypeSlug from 'rehype-slug';
import remarkGfm from 'remark-gfm';
import readingTime from 'remark-reading-time';
import remarkTableTitles from '../util/table';
/**
* Provides all our Rehype Plugins that are used within MDX
*/
export const rehypePlugins = [
// Generates `id` attributes for headings (H1, ...)
rehypeSlug,
// Automatically add anchor links to headings (H1, ...)
[rehypeAutolinkHeadings, { behavior: 'wrap' }],
// Transforms sequential code elements into code tabs and
// adds our syntax highlighter (Shikiji) to Codeboxes
rehypeShikiji,
];
/**
* Provides all our Remark Plugins that are used within MDX
*/
export const remarkPlugins = [
// Support GFM syntax to be used within Markdown
remarkGfm,
// Generates metadata regarding headings
remarkHeadings,
// Calculates the reading time of the content
readingTime,
remarkTableTitles,
];