import React from 'react'
import PropTypes from 'prop-types'
import { StaticQuery, graphql } from 'gatsby'
import Card from '../components/card'
import Link from '../components/link'
import Title from '../components/title'
import Grid from '../components/grid'
import Button from '../components/button'
import Icon from '../components/icon'
import CodeBlock, { InlineCode } from '../components/code'
import Aside from '../components/aside'
import Sidebar from '../components/sidebar'
import Section from '../components/section'
import Main from '../components/main'
import Footer from '../components/footer'
import { H3, H5, Label, InlineList } from '../components/typography'
import { YouTube, SoundCloud, Iframe } from '../components/embed'
import { github, markdownToReact } from '../components/util'
function getSlug(data) {
if (data.isCategory) return `/universe/category/${data.id}`
if (data.isProject) return `/universe/project/${data.id}`
return `/universe`
}
function filterResources(resources, data) {
const sorted = resources.sort((a, b) => a.id.localeCompare(b.id))
if (!data || !data.isCategory) return sorted
return sorted.filter(res => (res.category || []).includes(data.id))
}
const UniverseContent = ({ content = [], categories, pageContext, location, mdxComponents }) => {
const { theme, data = {} } = pageContext
const filteredResources = filterResources(content, data)
const activeData = data ? content.find(({ id }) => id === data.id) : null
const markdownComponents = { ...mdxComponents, code: InlineCode }
const slug = getSlug(data)
const isHome = !data.isCategory && !data.isProject
const sidebar = [
{
label: 'Overview',
items: [{ text: 'All Projects', url: '/universe' }],
},
...categories.map(({ label, items }) => ({
label,
items: items.map(({ id, title }) => ({
text: title,
url: `/universe/category/${id}`,
})),
})),
]
return (
<>
If you have a project that you want the spaCy community to make use of, you
can suggest it by submitting a pull request to the spaCy website repository.
The Universe database is open-source and collected in a simple JSON file.
For more details on the formats and available fields, see the documentation.
Looking for inspiration your own spaCy plugin or extension? Check out the
{title}
Submit your project
{[ `release/${data.github}/all.svg?style=flat-square`, `license/${data.github}.svg?style=flat-square`, `stars/${data.github}.svg?style=social&label=Stars`, ].map((url, i) => ( ))}
)})}
)} {data.url && ( )}
{data.category.map(cat => (