mirror of
https://github.com/explosion/spaCy.git
synced 2025-08-04 12:20:20 +03:00
Dynamically load Juniper
This commit is contained in:
parent
01b26d74cc
commit
d2b2cd55ad
|
@ -17,10 +17,10 @@ import 'prismjs/components/prism-yaml.min.js'
|
||||||
import { isString } from './util'
|
import { isString } from './util'
|
||||||
import Link, { OptionalLink } from './link'
|
import Link, { OptionalLink } from './link'
|
||||||
import GitHubCode from './github'
|
import GitHubCode from './github'
|
||||||
import Juniper from './juniper'
|
|
||||||
import classes from '../styles/code.module.sass'
|
import classes from '../styles/code.module.sass'
|
||||||
import siteMetadata from '../../meta/site.json'
|
import siteMetadata from '../../meta/site.json'
|
||||||
import { binderBranch } from '../../meta/dynamicMeta.mjs'
|
import { binderBranch } from '../../meta/dynamicMeta.mjs'
|
||||||
|
import dynamic from 'next/dynamic'
|
||||||
|
|
||||||
const CLI_GROUPS = ['init', 'debug', 'project', 'ray', 'huggingface-hub']
|
const CLI_GROUPS = ['init', 'debug', 'project', 'ray', 'huggingface-hub']
|
||||||
|
|
||||||
|
@ -274,6 +274,8 @@ export default class Code extends React.Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const JuniperDynamic = dynamic(() => import('./juniper'))
|
||||||
|
|
||||||
const JuniperWrapper = ({ title, lang, children }) => {
|
const JuniperWrapper = ({ title, lang, children }) => {
|
||||||
const { binderUrl, binderVersion } = siteMetadata
|
const { binderUrl, binderVersion } = siteMetadata
|
||||||
const juniperTitle = title || 'Editable Code'
|
const juniperTitle = title || 'Editable Code'
|
||||||
|
@ -289,7 +291,7 @@ const JuniperWrapper = ({ title, lang, children }) => {
|
||||||
</span>
|
</span>
|
||||||
</h4>
|
</h4>
|
||||||
|
|
||||||
<Juniper
|
<JuniperDynamic
|
||||||
repo={binderUrl}
|
repo={binderUrl}
|
||||||
branch={binderBranch}
|
branch={binderBranch}
|
||||||
lang={lang}
|
lang={lang}
|
||||||
|
@ -301,7 +303,7 @@ const JuniperWrapper = ({ title, lang, children }) => {
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</Juniper>
|
</JuniperDynamic>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user