Fix website [ci skip]

This commit is contained in:
Ines Montani 2021-01-18 11:37:04 +11:00
parent fed8f48965
commit 09cacbb7ee
8 changed files with 28686 additions and 28658 deletions

View File

@ -1,6 +1,6 @@
{
"resources": [
{
{
"id": "spacy-textblob",
"title": "spaCyTextBlob",
"slogan": "Easy sentiment analysis for spaCy using TextBlob",
@ -30,7 +30,7 @@
},
"category": ["pipeline"],
"tags": ["sentiment", "textblob"]
},
},
{
"id": "spacy-ray",
"title": "spacy-ray",
@ -2139,7 +2139,7 @@
"from negspacy.negation import Negex",
"",
"nlp = spacy.load(\"en_core_web_sm\")",
"negex = Negex(nlp, ent_types=[\"PERSON\",\"ORG\"])",
"negex = Negex(nlp, ent_types=[\"PERSON','ORG\"])",
"nlp.add_pipe(negex, last=True)",
"",
"doc = nlp(\"She does not like Steve Jobs but likes Apple products.\")",
@ -2619,14 +2619,14 @@
"github": "medspacy"
}
},
{
{
"id": "rita-dsl",
"title": "RITA DSL",
"slogan": "Domain Specific Language for creating language rules",
"github": "zaibacu/rita-dsl",
"description": "A Domain Specific Language (DSL) for building language patterns. These can be later compiled into spaCy patterns, pure regex, or any other format",
"pip": "rita-dsl",
"thumb": "https://raw.githubusercontent.com/zaibacu/rita-dsl/master/docs/assets/logo-100px.png",
"thumb": "https://raw.githubusercontent.com/zaibacu/rita-dsl/master/docs/assets/logo-100px.png",
"code_language": "python",
"code_example": [
"import spacy",

57204
website/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -3,7 +3,7 @@
"private": true,
"description": "spaCy website",
"version": "3.0.0",
"author": "Explosion AI <contact@explosion.ai>",
"author": "Explosion <contact@explosion.ai>",
"license": "MIT",
"dependencies": {
"@jupyterlab/outputarea": "^0.19.1",
@ -16,7 +16,7 @@
"autoprefixer": "^9.4.7",
"classnames": "^2.2.6",
"codemirror": "^5.43.0",
"gatsby": "^2.1.18",
"gatsby": "^2.11.1",
"gatsby-image": "^2.0.29",
"gatsby-mdx": "^0.3.6",
"gatsby-plugin-catch-links": "^2.0.11",
@ -24,12 +24,14 @@
"gatsby-plugin-offline": "^2.0.24",
"gatsby-plugin-plausible": "0.0.6",
"gatsby-plugin-react-helmet": "^3.0.6",
"gatsby-plugin-react-svg": "^2.1.2",
"gatsby-plugin-react-svg": "^2.0.0",
"gatsby-plugin-robots-txt": "^1.5.1",
"gatsby-plugin-sass": "^2.0.10",
"gatsby-plugin-sharp": "^2.0.20",
"gatsby-plugin-sitemap": "^2.0.5",
"gatsby-plugin-svgr": "^2.0.1",
"gatsby-remark-copy-linked-files": "^2.0.9",
"gatsby-remark-find-replace": "^0.3.0",
"gatsby-remark-images": "^3.0.4",
"gatsby-remark-prismjs": "^3.2.4",
"gatsby-remark-smartypants": "^2.0.8",
@ -39,9 +41,11 @@
"gatsby-transformer-sharp": "^2.1.13",
"html-to-react": "^1.3.4",
"intersection-observer": "^0.5.1",
"jinja-to-js": "^3.2.3",
"node-sass": "^4.11.0",
"parse-numeric-range": "0.0.2",
"prismjs": "^1.15.0",
"prismjs-bibtex": "^1.1.0",
"prop-types": "^15.7.2",
"react": "^16.8.2",
"react-dom": "^16.8.2",
@ -50,19 +54,22 @@
"remark-react": "^5.0.1"
},
"scripts": {
"build": "gatsby build",
"dev": "gatsby develop",
"build": "npm run python:install && npm run python:setup && gatsby build",
"dev": "npm run python:setup && gatsby develop",
"dev:nightly": "BRANCH=nightly.spacy.io npm run dev",
"lint": "eslint **",
"clear": "rm -rf .cache",
"test": "echo \"Write tests! -> https://gatsby.app/unit-testing\""
"test": "echo \"Write tests! -> https://gatsby.app/unit-testing\"",
"python:install": "pip install -r setup/requirements.txt",
"python:setup": "cd setup && sh setup.sh"
},
"devDependencies": {
"@sindresorhus/slugify": "^0.8.0",
"browser-monads": "^1.0.0",
"md-attr-parser": "^1.2.1",
"prettier": "^1.16.4",
"raw-loader": "^1.0.0",
"unist-util-visit": "^1.4.0",
"@sindresorhus/slugify": "^0.8.0"
"unist-util-visit": "^1.4.0"
},
"repository": {
"type": "git",

View File

@ -6,7 +6,7 @@ import classNames from 'classnames'
import Link from './link'
import Grid from './grid'
import Newsletter from './newsletter'
import ExplosionLogo from '-!svg-react-loader!../images/explosion.svg'
import { ReactComponent as ExplosionLogo } from '../images/explosion.svg'
import classes from '../styles/footer.module.sass'
export default function Footer({ wide = false }) {

View File

@ -1,4 +1,4 @@
import React from 'react'
import React, { Fragment } from 'react'
import PropTypes from 'prop-types'
import classNames from 'classnames'
@ -19,7 +19,13 @@ import NoIcon from '-!svg-react-loader!../images/icons/no.svg'
import NeutralIcon from '-!svg-react-loader!../images/icons/neutral.svg'
import OfflineIcon from '-!svg-react-loader!../images/icons/offline.svg'
import SearchIcon from '-!svg-react-loader!../images/icons/search.svg'
import MoonIcon from '-!svg-react-loader!../images/icons/moon.svg'
import ClipboardIcon from '-!svg-react-loader!../images/icons/clipboard.svg'
import NetworkIcon from '-!svg-react-loader!../images/icons/network.svg'
import DownloadIcon from '-!svg-react-loader!../images/icons/download.svg'
import PackageIcon from '-!svg-react-loader!../images/icons/package.svg'
import { isString } from './util'
import classes from '../styles/icon.module.sass'
const icons = {
@ -41,9 +47,22 @@ const icons = {
neutral: NeutralIcon,
offline: OfflineIcon,
search: SearchIcon,
moon: MoonIcon,
clipboard: ClipboardIcon,
network: NetworkIcon,
download: DownloadIcon,
package: PackageIcon,
}
const Icon = ({ name, width, height, inline, variant, className }) => {
export default function Icon({
name,
width = 20,
height,
inline = false,
variant,
className,
...props
}) {
const IconComponent = icons[name]
const iconClassNames = classNames(classes.root, className, {
[classes.inline]: inline,
@ -57,15 +76,11 @@ const Icon = ({ name, width, height, inline, variant, className }) => {
aria-hidden="true"
width={width}
height={height || width}
{...props}
/>
)
}
Icon.defaultProps = {
width: 20,
inline: false,
}
Icon.propTypes = {
name: PropTypes.oneOf(Object.keys(icons)),
width: PropTypes.number,
@ -75,4 +90,43 @@ Icon.propTypes = {
className: PropTypes.string,
}
export default Icon
export function replaceEmoji(cellChildren) {
const icons = {
'✅': { name: 'yes', variant: 'success', 'aria-label': 'positive' },
'❌': { name: 'no', variant: 'error', 'aria-label': 'negative' },
}
const iconRe = new RegExp(`^(${Object.keys(icons).join('|')})`, 'g')
let children = isString(cellChildren) ? [cellChildren] : cellChildren
let hasIcon = false
if (Array.isArray(children)) {
children = children.map((child, i) => {
if (isString(child)) {
const icon = icons[child.trim()]
if (icon) {
hasIcon = true
return (
<Icon
{...icon}
inline={i < children.length}
aria-hidden={undefined}
key={i}
/>
)
} else if (iconRe.test(child)) {
hasIcon = true
const [, iconName, text] = child.split(iconRe)
return (
<Fragment key={i}>
<Icon {...icons[iconName]} aria-hidden={undefined} inline={true} />
{text.replace(/^\s+/g, '')}
</Fragment>
)
}
// Work around prettier auto-escape
if (child.startsWith('\\')) return child.slice(1)
}
return child
})
}
return { content: children, hasIcon }
}

View File

@ -6,7 +6,7 @@ import Link from './link'
import Icon from './icon'
import Dropdown from './dropdown'
import { github } from './util'
import Logo from '-!svg-react-loader!../images/logo.svg'
import { ReactComponent as Logo } from '../images/logo.svg'
import classes from '../styles/navigation.module.sass'
const NavigationDropdown = ({ items = [], section }) => {

View File

@ -1,31 +0,0 @@
import AirbnbLogo from '-!svg-react-loader!./airbnb.svg'
import UberLogo from '-!svg-react-loader!./uber.svg'
import QuoraLogo from '-!svg-react-loader!./quora.svg'
import RetrieverLogo from '-!svg-react-loader!./retriever.svg'
import StitchfixLogo from '-!svg-react-loader!./stitchfix.svg'
import ChartbeatLogo from '-!svg-react-loader!./chartbeat.svg'
import AllenAILogo from '-!svg-react-loader!./allenai.svg'
import RecodeLogo from '-!svg-react-loader!./recode.svg'
import WapoLogo from '-!svg-react-loader!./wapo.svg'
import BBCLogo from '-!svg-react-loader!./bbc.svg'
import MicrosoftLogo from '-!svg-react-loader!./microsoft.svg'
import VenturebeatLogo from '-!svg-react-loader!./venturebeat.svg'
import ThoughtworksLogo from '-!svg-react-loader!./thoughtworks.svg'
export default {
airbnb: AirbnbLogo,
uber: UberLogo,
quora: QuoraLogo,
retriever: RetrieverLogo,
stitchfix: StitchfixLogo,
chartbeat: ChartbeatLogo,
allenai: AllenAILogo,
recode: RecodeLogo,
wapo: WapoLogo,
bbc: BBCLogo,
microsoft: MicrosoftLogo,
venturebeat: VenturebeatLogo,
thoughtworks: ThoughtworksLogo,
}

View File

@ -4,7 +4,7 @@ import Grid from '../components/grid'
import { Label } from '../components/typography'
import Link from '../components/link'
import Logo from '-!svg-react-loader!../images/logo.svg'
import { ReactComponent as Logo } from '../images/logo.svg'
import patternBlue from '../images/pattern_blue.jpg'
import patternGreen from '../images/pattern_green.jpg'
import patternPurple from '../images/pattern_purple.jpg'