mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-12 10:16:27 +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 remarkPlugins from './plugins/index.mjs'
|
||||
|
||||
const withMDX = MDX({
|
||||
extension: /\.mdx?$/,
|
||||
options: {
|
||||
remarkPlugins,
|
||||
providerImportSource: '@mdx-js/react',
|
||||
},
|
||||
experimental: {
|
||||
|
|
|
@ -4,6 +4,7 @@ import fs from 'fs'
|
|||
import { MDXRemote, MDXRemoteSerializeResult } from 'next-mdx-remote'
|
||||
import path from 'path'
|
||||
import Layout from '../components/layout'
|
||||
import remarkPlugins from '../plugins/index.mjs'
|
||||
|
||||
type PropsPage = {
|
||||
mdx: MDXRemoteSerializeResult
|
||||
|
@ -43,7 +44,12 @@ export const getStaticProps: GetStaticProps<PropsPage, ParsedUrlQuery> = async (
|
|||
slug: args.params.slug,
|
||||
mdx: await serialize(
|
||||
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