forked from nodejs/nodejs.org
-
Notifications
You must be signed in to change notification settings - Fork 2
/
next.mdx.mjs
34 lines (30 loc) · 1019 Bytes
/
next.mdx.mjs
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
'use strict';
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 rehypeShikiji from './next.mdx.shiki.mjs';
/**
* Provides all our Rehype Plugins that are used within MDX
*
* @type {Array<import('unified').Plugin>}
*/
export const NEXT_REHYPE_PLUGINS = [
// Generates `id` attributes for headings (H1, ...)
rehypeSlug,
// Automatically add anchor links to headings (H1, ...)
[
rehypeAutolinkHeadings,
{ properties: { ariaHidden: true, tabIndex: -1, class: 'anchor' } },
],
// 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
*
* @type {Array<import('unified').Plugin>}
*/
export const NEXT_REMARK_PLUGINS = [remarkGfm, remarkHeadings, readingTime];