forked from nodejs/nodejs.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.mdx.use.mjs
58 lines (55 loc) · 1.97 KB
/
next.mdx.use.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
'use strict';
import Blockquote from './components/Common/Blockquote';
import Button from './components/Common/Button';
import DownloadButton from './components/Downloads/DownloadButton';
import DownloadLink from './components/Downloads/DownloadLink';
import DownloadReleasesTable from './components/Downloads/DownloadReleasesTable';
import HomeDownloadButton from './components/Home/HomeDownloadButton';
import Link from './components/Link';
import MDXCodeBox from './components/MDX/CodeBox';
import MDXCodeTabs from './components/MDX/CodeTabs';
import WithBadge from './components/withBadge';
import WithBanner from './components/withBanner';
import WithNodeRelease from './components/withNodeRelease';
import { ENABLE_WEBSITE_REDESIGN } from './next.constants.mjs';
/**
* A full list of React Components that we want to pass through to MDX
*
* @type {import('mdx/types').MDXComponents}
*/
export const mdxComponents = {
// Legacy Component
HomeDownloadButton: HomeDownloadButton,
// Legacy Component
DownloadReleasesTable: DownloadReleasesTable,
// HOC for getting Node.js Release Metadata
WithNodeRelease: WithNodeRelease,
// HOC for providing Banner Data
WithBanner: WithBanner,
// HOC for providing Badge Data
WithBadge: WithBadge,
// Renders MDX CodeTabs
CodeTabs: MDXCodeTabs,
// Renders a Download Button
DownloadButton: DownloadButton,
// Renders a Download Link
DownloadLink: DownloadLink,
// Renders a Button Component for `button` tags
Button: Button,
};
/**
* A full list of wired HTML elements into custom React Components
*
* @type {import('mdx/types').MDXComponents}
*/
export const htmlComponents = {
// Renders a Link Component for `a` tags
a: Link,
// @deprecated once the website redesign happens
// switch to only use the Blockquote Component
blockquote: ENABLE_WEBSITE_REDESIGN
? Blockquote
: ({ children }) => <div className="highlight-box">{children}</div>,
// Renders a CodeBox Component for `pre` tags
pre: MDXCodeBox,
};