mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-12 18:26:30 +03:00
Add ability to load plugins
This commit is contained in:
parent
790e03f900
commit
aea5496788
|
@ -1,8 +1,11 @@
|
||||||
import MDX from '@next/mdx'
|
import MDX from '@next/mdx'
|
||||||
|
|
||||||
|
import remarkPlugins from './plugins/index.mjs'
|
||||||
|
|
||||||
const withMDX = MDX({
|
const withMDX = MDX({
|
||||||
extension: /\.mdx?$/,
|
extension: /\.mdx?$/,
|
||||||
options: {
|
options: {
|
||||||
|
remarkPlugins,
|
||||||
providerImportSource: '@mdx-js/react',
|
providerImportSource: '@mdx-js/react',
|
||||||
},
|
},
|
||||||
experimental: {
|
experimental: {
|
||||||
|
|
|
@ -4,6 +4,7 @@ import fs from 'fs'
|
||||||
import { MDXRemote, MDXRemoteSerializeResult } from 'next-mdx-remote'
|
import { MDXRemote, MDXRemoteSerializeResult } from 'next-mdx-remote'
|
||||||
import path from 'path'
|
import path from 'path'
|
||||||
import Layout from '../components/layout'
|
import Layout from '../components/layout'
|
||||||
|
import remarkPlugins from '../plugins/index.mjs'
|
||||||
|
|
||||||
type PropsPage = {
|
type PropsPage = {
|
||||||
mdx: MDXRemoteSerializeResult
|
mdx: MDXRemoteSerializeResult
|
||||||
|
@ -43,7 +44,12 @@ export const getStaticProps: GetStaticProps<PropsPage, ParsedUrlQuery> = async (
|
||||||
slug: args.params.slug,
|
slug: args.params.slug,
|
||||||
mdx: await serialize(
|
mdx: await serialize(
|
||||||
fs.readFileSync(path.join('docs', args.params.slug + '.mdx'), 'utf-8'),
|
fs.readFileSync(path.join('docs', args.params.slug + '.mdx'), 'utf-8'),
|
||||||
{ parseFrontmatter: true }
|
{
|
||||||
|
parseFrontmatter: true,
|
||||||
|
mdxOptions: {
|
||||||
|
remarkPlugins,
|
||||||
|
},
|
||||||
|
}
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
3
website/plugins/index.mjs
Normal file
3
website/plugins/index.mjs
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
const remarkPlugins = []
|
||||||
|
|
||||||
|
export default remarkPlugins
|
Loading…
Reference in New Issue
Block a user