import React from 'react'
import { StaticQuery, graphql } from 'gatsby'
import Link from '../components/link'
import { InlineCode } from '../components/code'
import { Table, Tr, Th, Td } from '../components/table'
import { Ul, Li } from '../components/list'
import Infobox from '../components/infobox'
import { github, join } from '../components/util'
const Language = ({ name, code, models }) => (
{name} |
{code}
|
lang/{code}
|
{models && models.length ? (
{models.length} {models.length === 1 ? 'package' : 'packages'}
) : (
none yet
)}
|
)
const Languages = () => (
{
const langs = site.siteMetadata.languages
const withModels = langs
.filter(({ models }) => models && !!models.length)
.sort((a, b) => a.name.localeCompare(b.name))
const withoutModels = langs
.filter(({ models }) => !models || !models.length)
.sort((a, b) => a.name.localeCompare(b.name))
const withDeps = langs.filter(({ dependencies }) => dependencies && dependencies.length)
return (
<>
Language |
Code |
Language Data |
Pipelines |
{withModels.map(model => (
))}
{withoutModels.map(model => (
))}
Some language tokenizers require external dependencies.
{withDeps.map(({ code, name, dependencies }) => (
-
{name}:{' '}
{join(
dependencies.map((dep, i) => (
{dep.name}
))
)}
))}
>
)
}}
/>
)
export default Languages
const query = graphql`
query LanguagesQuery {
site {
siteMetadata {
languages {
code
name
models
dependencies {
name
url
}
}
}
}
}
`