From 1316071086affff220c99df03ed7fb52ea9f3468 Mon Sep 17 00:00:00 2001 From: Ines Montani Date: Sun, 13 Sep 2020 11:31:50 +0200 Subject: [PATCH] Update docs [ci skip] --- website/docs/usage/facts-figures.md | 6 +----- website/docs/usage/rule-based-matching.md | 2 +- website/gatsby-config.js | 16 ++++++++++++++++ website/src/components/landing.js | 4 ++-- website/src/styles/accordion.module.sass | 7 +++++-- website/src/styles/landing.module.sass | 7 +++++-- website/src/widgets/landing.js | 22 +++++----------------- 7 files changed, 35 insertions(+), 29 deletions(-) diff --git a/website/docs/usage/facts-figures.md b/website/docs/usage/facts-figures.md index 36f86dd51..bff31d0d6 100644 --- a/website/docs/usage/facts-figures.md +++ b/website/docs/usage/facts-figures.md @@ -61,17 +61,13 @@ import Benchmarks from 'usage/\_benchmarks-models.md' - - diff --git a/website/docs/usage/rule-based-matching.md b/website/docs/usage/rule-based-matching.md index 2d6159f3d..7e979b32e 100644 --- a/website/docs/usage/rule-based-matching.md +++ b/website/docs/usage/rule-based-matching.md @@ -1075,7 +1075,7 @@ relations and tokens we want to match: > #### Visualizing the parse > -> The [`displacy` visualizer](/usage/visualizer) lets you render `Doc` objects +> The [`displacy` visualizer](/usage/visualizers) lets you render `Doc` objects > and their dependency parse and part-of-speech tags: > > ```python diff --git a/website/gatsby-config.js b/website/gatsby-config.js index 78fdc336f..5e3b5b537 100644 --- a/website/gatsby-config.js +++ b/website/gatsby-config.js @@ -26,11 +26,27 @@ const replacements = { GITHUB_SPACY: `https://github.com/explosion/spaCy/tree/${branch}`, } +/** + * Compute the overall total counts of models and languages + */ +function getCounts(langs = []) { + return { + langs: langs.length, + modelLangs: langs.filter(({ models }) => models && !!models.length).length, + starterLangs: langs.filter(({ starters }) => starters && !!starters.length).length, + models: langs.map(({ models }) => (models ? models.length : 0)).reduce((a, b) => a + b, 0), + starters: langs + .map(({ starters }) => (starters ? starters.length : 0)) + .reduce((a, b) => a + b, 0), + } +} + module.exports = { siteMetadata: { ...site, sidebars, ...models, + counts: getCounts(models.languages), universe, nightly: isNightly, binderBranch, diff --git a/website/src/components/landing.js b/website/src/components/landing.js index 64764ad2a..96f9640ce 100644 --- a/website/src/components/landing.js +++ b/website/src/components/landing.js @@ -38,8 +38,8 @@ export const LandingSubtitle = ({ children }) => ( ) export const LandingGrid = ({ cols = 3, blocks = false, style, children }) => ( - - + + {children} diff --git a/website/src/styles/accordion.module.sass b/website/src/styles/accordion.module.sass index a0b736838..8e67bfc29 100644 --- a/website/src/styles/accordion.module.sass +++ b/website/src/styles/accordion.module.sass @@ -26,8 +26,11 @@ border-bottom-right-radius: 0 .icon - width: 2rem - height: 2rem + $width: 2rem + + width: $width + height: $width + flex: 0 0 $width background: var(--color-theme) color: var(--color-back) border-radius: 50% diff --git a/website/src/styles/landing.module.sass b/website/src/styles/landing.module.sass index 134016b0d..9629004b4 100644 --- a/website/src/styles/landing.module.sass +++ b/website/src/styles/landing.module.sass @@ -128,14 +128,17 @@ padding-right: 2rem @include breakpoint(max, md) + .banner + padding: 1rem 3rem + .banner-content display: block .banner-text padding-top: 0 - .col - grid-column: 1 / span 2 + .grid + grid-template-columns: 1fr !important .banner-button margin-bottom: var(--spacing-sm) diff --git a/website/src/widgets/landing.js b/website/src/widgets/landing.js index d545fdb96..77fcdfd81 100644 --- a/website/src/widgets/landing.js +++ b/website/src/widgets/landing.js @@ -54,23 +54,8 @@ for entity in doc.ents: print(entity.text, entity.label_) ` -/** - * Compute the overall total counts of models and languages - */ -function getCounts(langs = []) { - return { - langs: langs.length, - modelLangs: langs.filter(({ models }) => models && !!models.length).length, - starterLangs: langs.filter(({ starters }) => starters && !!starters.length).length, - models: langs.map(({ models }) => (models ? models.length : 0)).reduce((a, b) => a + b, 0), - starters: langs - .map(({ starters }) => (starters ? starters.length : 0)) - .reduce((a, b) => a + b, 0), - } -} - const Landing = ({ data }) => { - const counts = getCounts(data.languages) + const { counts } = data return ( <> @@ -345,7 +330,10 @@ const landingQuery = graphql` siteMetadata { nightly repo - languages { + counts { + langs + modelLangs + starterLangs models starters }