mirror of
https://github.com/explosion/spaCy.git
synced 2025-10-29 15:07:54 +03:00
* Extract `CodeBlock` component into own file * Extract `InlineCode` component into own file * Extract `TypeAnnotation` component into own file * Convert named `export` to `default export` * Remove unused `export` * Simplify `TypeAnnotation` to remove dependency for Prism * Load `Code` component dynamically * Extract `MarkdownToReact` component into own file * WIP Code Dynamic * Load `MarkdownToReact` component dynamically * Extract `htmlToReact` to own file * Load `htmlToReact` component dynamically * Dynamically load `Juniper`
40 lines
1.1 KiB
JavaScript
40 lines
1.1 KiB
JavaScript
import React from 'react'
|
|
|
|
import CopyInput from '../components/copy'
|
|
import Infobox from '../components/infobox'
|
|
import Link from '../components/link'
|
|
import { InlineCode } from '../components/inlineCode'
|
|
import { projectsRepo } from '../components/util'
|
|
|
|
const COMMAND = 'python -m spacy project clone'
|
|
|
|
export default function Project({
|
|
title = 'Get started with a project template',
|
|
id,
|
|
repo,
|
|
children,
|
|
}) {
|
|
const repoArg = repo ? ` --repo ${repo}` : ''
|
|
const text = `${COMMAND} ${id}${repoArg}`
|
|
const defaultRepo = `https://github.com/${projectsRepo}`
|
|
const url = `${repo || defaultRepo}/${id}`
|
|
const header = (
|
|
<>
|
|
{title}:{' '}
|
|
<Link to={url}>
|
|
<InlineCode>{id}</InlineCode>
|
|
</Link>
|
|
</>
|
|
)
|
|
return (
|
|
<Infobox title={header} emoji="🪐">
|
|
{children}
|
|
<CopyInput
|
|
text={text}
|
|
prefix="$"
|
|
description="Example bash command to start with an end-to-end template"
|
|
/>
|
|
</Infobox>
|
|
)
|
|
}
|