mirror of https://github.com/explosion/spaCy.git
Support and render Markdown in model meta [ci skip]
This commit is contained in:
parent
944a66c326
commit
3072eb28c2
|
@ -14,7 +14,7 @@ import Icon from '../components/icon'
|
||||||
import Link from '../components/link'
|
import Link from '../components/link'
|
||||||
import Grid from '../components/grid'
|
import Grid from '../components/grid'
|
||||||
import Infobox from '../components/infobox'
|
import Infobox from '../components/infobox'
|
||||||
import { join, arrayToObj, abbrNum } from '../components/util'
|
import { join, arrayToObj, abbrNum, markdownToReact } from '../components/util'
|
||||||
|
|
||||||
const MODEL_META = {
|
const MODEL_META = {
|
||||||
core: 'Vocabulary, syntax, entities, vectors',
|
core: 'Vocabulary, syntax, entities, vectors',
|
||||||
|
@ -43,6 +43,10 @@ const MODEL_META = {
|
||||||
compat: 'Latest compatible model version for your spaCy installation',
|
compat: 'Latest compatible model version for your spaCy installation',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const MARKDOWN_COMPONENTS = {
|
||||||
|
code: InlineCode,
|
||||||
|
}
|
||||||
|
|
||||||
function getModelComponents(name) {
|
function getModelComponents(name) {
|
||||||
const [lang, type, genre, size] = name.split('_')
|
const [lang, type, genre, size] = name.split('_')
|
||||||
return { lang, type, genre, size }
|
return { lang, type, genre, size }
|
||||||
|
@ -192,10 +196,8 @@ const Model = ({ name, langId, langName, baseUrl, repo, compatibility, hasExampl
|
||||||
python -m spacy download {name}
|
python -m spacy download {name}
|
||||||
</CodeBlock>
|
</CodeBlock>
|
||||||
</Aside>
|
</Aside>
|
||||||
{meta.description && <p>{meta.description}</p>}
|
{meta.description && markdownToReact(meta.description, MARKDOWN_COMPONENTS)}
|
||||||
|
|
||||||
{isError && error}
|
{isError && error}
|
||||||
|
|
||||||
<Table>
|
<Table>
|
||||||
<tbody>
|
<tbody>
|
||||||
{rows.map(({ label, tag, help, content }, i) =>
|
{rows.map(({ label, tag, help, content }, i) =>
|
||||||
|
@ -243,7 +245,7 @@ const Model = ({ name, langId, langName, baseUrl, repo, compatibility, hasExampl
|
||||||
)
|
)
|
||||||
)}
|
)}
|
||||||
</Grid>
|
</Grid>
|
||||||
{meta.notes && <p>{meta.notes}</p>}
|
{meta.notes && markdownToReact(meta.notes, MARKDOWN_COMPONENTS)}
|
||||||
{hasInteractiveCode && (
|
{hasInteractiveCode && (
|
||||||
<CodeBlock title="Try out the model" lang="python" executable={true}>
|
<CodeBlock title="Try out the model" lang="python" executable={true}>
|
||||||
{[
|
{[
|
||||||
|
|
Loading…
Reference in New Issue