diff --git a/.gitattributes b/.gitattributes index 4174132c5203e2d7bb5894604745bc4ffda49ba3..485b7c41a7cb9bde0e5229ee7c12d8a333bc703e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1235,3 +1235,12 @@ western_ai/usa/spacy/website/public/images/spacy-streamlit.png filter=lfs diff=l western_ai/usa/spacy/website/public/images/thinc_mypy.jpg filter=lfs diff=lfs merge=lfs -text western_ai/usa/spacy/website/public/images/wandb1.jpg filter=lfs diff=lfs merge=lfs -text western_ai/usa/spacy/website/public/images/wandb2.jpg filter=lfs diff=lfs merge=lfs -text +western_ai/usa/spacy/website/src/images/social_api.jpg filter=lfs diff=lfs merge=lfs -text +western_ai/usa/spacy/website/src/images/social_default.jpg filter=lfs diff=lfs merge=lfs -text +western_ai/usa/spacy/website/src/images/social_legacy.jpg filter=lfs diff=lfs merge=lfs -text +western_ai/usa/spacy/website/src/images/social_nightly.jpg filter=lfs diff=lfs merge=lfs -text +western_ai/usa/spacy/website/src/images/social_universe.jpg filter=lfs diff=lfs merge=lfs -text +western_ai/usa/stable-diffusion-webui/modules/Roboto-Regular.ttf filter=lfs diff=lfs merge=lfs -text +western_ai/usa/stable-diffusion-webui/modules/textual_inversion/test_embedding.png filter=lfs diff=lfs merge=lfs -text +western_ai/usa/stable-diffusion-webui/screenshot.png filter=lfs diff=lfs merge=lfs -text +western_ai/usa/tensorflow/tensorflow/c/testdata/tf_record filter=lfs diff=lfs merge=lfs -text diff --git a/western_ai/usa/spacy/website/UNIVERSE.md b/western_ai/usa/spacy/website/UNIVERSE.md new file mode 100644 index 0000000000000000000000000000000000000000..ba7ea49a934b1812dd09f0fa0b1bd703dcf47544 --- /dev/null +++ b/western_ai/usa/spacy/website/UNIVERSE.md @@ -0,0 +1,104 @@ + + +# spaCy Universe + +The [spaCy Universe](https://spacy.io/universe) collects the many great +resources developed with or for spaCy. It includes standalone packages, plugins, +extensions, educational materials, operational utilities and bindings for other +languages. + +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 this repository. The Universe +database is open-source and collected in a simple JSON file. + +Looking for inspiration for your own spaCy plugin or extension? Check out the +[`project ideas`](https://github.com/explosion/spaCy/discussions?discussions_q=category%3A%22New+Features+%26+Project+Ideas%22) +discussion forum. + +## Checklist + +### Projects + +✅ Libraries and packages should be **open-source** (with a user-friendly +license) and at least somewhat **documented** (e.g. a simple `README` with usage +instructions). + +✅ We're happy to include work in progress and prereleases, but we'd like to +keep the emphasis on projects that should be useful to the community **right +away**. + +✅ Demos and visualizers should be available via a **public URL**. + +### Educational Materials + +✅ Books should be **available for purchase or download** (not just pre-order). +Ebooks and self-published books are fine, too, if they include enough +substantial content. + +✅ The `"url"` of book entries should either point to the publisher's website or +a reseller of your choice (ideally one that ships worldwide or as close as +possible). + +✅ If an online course is only available behind a paywall, it should at least +have a **free excerpt** or chapter available, so users know what to expect. + +## JSON format + +To add a project, fork this repository, edit the +[`universe.json`](meta/universe.json) and add an object of the following format +to the list of `"resources"`. Before you submit your pull request, make sure to +use a linter to verify that your markup is correct. + +```json +{ + "id": "unique-project-id", + "title": "Project title", + "slogan": "A short summary", + "description": "A longer description – *Markdown allowed!*", + "github": "user/repo", + "pip": "package-name", + "code_example": [ + "import spacy", + "import package_name", + "", + "nlp = spacy.load('en')", + "nlp.add_pipe(package_name)" + ], + "code_language": "python", + "url": "https://example.com", + "thumb": "https://example.com/thumb.jpg", + "image": "https://example.com/image.jpg", + "author": "Your Name", + "author_links": { + "twitter": "username", + "github": "username", + "website": "https://example.com" + }, + "category": ["pipeline", "standalone"], + "tags": ["some-tag", "etc"] +} +``` + +| Field | Type | Description | +| --------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | string | Unique ID of the project. | +| `title` | string | Project title. If not set, the `id` will be used as the display title. | +| `slogan` | string | A short description of the project. Displayed in the overview and under the title. | +| `description` | string | A longer description of the project. Markdown is allowed, but should be limited to basic formatting like bold, italics, code or links. | +| `github` | string | Associated GitHub repo in the format `user/repo`. Will be displayed as a link and used for release, license and star badges. | +| `pip` | string | Package name on pip. If available, the installation command will be displayed. | +| `cran` | string | For R packages: package name on CRAN. If available, the installation command will be displayed. | +| `code_example` | array | Short example that shows how to use the project. Formatted as an array with one string per line. | +| `code_language` | string | Defaults to `'python'`. Optional code language used for syntax highlighting with [Prism](http://prismjs.com/). | +| `url` | string | Optional project link to display as button. | +| `thumb` | string | Optional URL to project thumbnail to display in overview and project header. Recommended size is 100x100px. | +| `image` | string | Optional URL to project image to display with description. | +| `author` | string | Name(s) of project author(s). | +| `author_links` | object | Usernames and links to display as icons to author info. Currently supports `twitter` and `github` usernames, as well as `website` link. | +| `category` | list | One or more categories to assign to project. Must be one of the available options. | +| `tags` | list | Still experimental and not used for filtering: one or more tags to assign to project. | + +To separate them from the projects, educational materials also specify +`"type": "education`. Books can also set a `"cover"` field containing a URL to a +cover image. If available, it's used in the overview and displayed on the +individual book page. diff --git a/western_ai/usa/spacy/website/src/images/pattern_landing_legacy.png b/western_ai/usa/spacy/website/src/images/pattern_landing_legacy.png new file mode 100644 index 0000000000000000000000000000000000000000..d4895e269e08d211ba479ec576251b7869da931d Binary files /dev/null and b/western_ai/usa/spacy/website/src/images/pattern_landing_legacy.png differ diff --git a/western_ai/usa/spacy/website/src/images/pattern_landing_nightly.png b/western_ai/usa/spacy/website/src/images/pattern_landing_nightly.png new file mode 100644 index 0000000000000000000000000000000000000000..904cb3562cf7efea96475ffb4e3f90066593f96b Binary files /dev/null and b/western_ai/usa/spacy/website/src/images/pattern_landing_nightly.png differ diff --git a/western_ai/usa/spacy/website/src/images/pattern_legacy.png b/western_ai/usa/spacy/website/src/images/pattern_legacy.png new file mode 100644 index 0000000000000000000000000000000000000000..90ea3c53ed90303d2e6e6e377820f0010bb17b51 Binary files /dev/null and b/western_ai/usa/spacy/website/src/images/pattern_legacy.png differ diff --git a/western_ai/usa/spacy/website/src/images/pattern_nightly.png b/western_ai/usa/spacy/website/src/images/pattern_nightly.png new file mode 100644 index 0000000000000000000000000000000000000000..202fdc0d2a25cba46ef262c6d00883eed6b7322d Binary files /dev/null and b/western_ai/usa/spacy/website/src/images/pattern_nightly.png differ diff --git a/western_ai/usa/spacy/website/src/images/pattern_purple.png b/western_ai/usa/spacy/website/src/images/pattern_purple.png new file mode 100644 index 0000000000000000000000000000000000000000..641b40c48cfe8674e217cfb81f504f6e4ee527c1 Binary files /dev/null and b/western_ai/usa/spacy/website/src/images/pattern_purple.png differ diff --git a/western_ai/usa/spacy/website/src/images/social_api.jpg b/western_ai/usa/spacy/website/src/images/social_api.jpg new file mode 100644 index 0000000000000000000000000000000000000000..0a808b6b69aa9cff95320614b6d53d45cba22b05 --- /dev/null +++ b/western_ai/usa/spacy/website/src/images/social_api.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de182e818994240bc8cc1afc9cc117f816b375141a686e3608d6a381be44bc8e +size 146955 diff --git a/western_ai/usa/spacy/website/src/images/social_default.jpg b/western_ai/usa/spacy/website/src/images/social_default.jpg new file mode 100644 index 0000000000000000000000000000000000000000..bcde52ab75639051993b8cbf4ff88bc83037987b --- /dev/null +++ b/western_ai/usa/spacy/website/src/images/social_default.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0fd1f3097fbb26014d3b5c83be8fbe9ffa7f90151344fcf68684c553761425f3 +size 372379 diff --git a/western_ai/usa/spacy/website/src/images/social_legacy.jpg b/western_ai/usa/spacy/website/src/images/social_legacy.jpg new file mode 100644 index 0000000000000000000000000000000000000000..3615a6a0ab3ae32a57934b0f1294a8441a59243b --- /dev/null +++ b/western_ai/usa/spacy/website/src/images/social_legacy.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:537c720bc041de99e41defb8131985ac083c8f283a5cec90449f8d91262512d5 +size 203440 diff --git a/western_ai/usa/spacy/website/src/images/social_nightly.jpg b/western_ai/usa/spacy/website/src/images/social_nightly.jpg new file mode 100644 index 0000000000000000000000000000000000000000..5d4421621f4f6d3bcae3694bcfc4f3b195237ed2 --- /dev/null +++ b/western_ai/usa/spacy/website/src/images/social_nightly.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:50c317141dc9709a3fbd0cbdb4f93df8b1eb6ffcd02711ad8eebdd562079e7ce +size 362139 diff --git a/western_ai/usa/spacy/website/src/images/social_universe.jpg b/western_ai/usa/spacy/website/src/images/social_universe.jpg new file mode 100644 index 0000000000000000000000000000000000000000..58650672eb454a18c56561ca5397ad85b5399ca0 --- /dev/null +++ b/western_ai/usa/spacy/website/src/images/social_universe.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5e6919c0b2a877965e29a784ad6cc10fe3e1429a1bc6aa89bcb13c03595190a1 +size 120804 diff --git a/western_ai/usa/spacy/website/src/images/spacy-irl.jpg b/western_ai/usa/spacy/website/src/images/spacy-irl.jpg new file mode 100644 index 0000000000000000000000000000000000000000..ee8f4bdc9028d6ed8fa11104fada1dfdcf6b0768 Binary files /dev/null and b/western_ai/usa/spacy/website/src/images/spacy-irl.jpg differ diff --git a/western_ai/usa/spacy/website/src/remark.js b/western_ai/usa/spacy/website/src/remark.js new file mode 100644 index 0000000000000000000000000000000000000000..a13ca8489039455881cdd5cbfc170490c7c30ad4 --- /dev/null +++ b/western_ai/usa/spacy/website/src/remark.js @@ -0,0 +1,118 @@ +import Link from './components/link' +import Section, { Hr } from './components/section' +import { Table, Tr, Th, Tx, Td } from './components/table' +import Code from './components/codeDynamic' +import { TypeAnnotation } from './components/typeAnnotation' +import { InlineCode } from './components/inlineCode' +import CodeBlock, { Pre } from './components/codeBlock' +import { Ol, Ul, Li } from './components/list' +import { H2, H3, H4, H5, P, Abbr, Help, Label } from './components/typography' +import Accordion from './components/accordion' +import Infobox from './components/infobox' +import Aside from './components/aside' +import Button from './components/button' +import Tag from './components/tag' +import Grid from './components/grid' +import { YouTube, SoundCloud, Iframe, Image, ImageScrollable, GoogleSheet, Standalone } from './components/embed' +import Project from './widgets/project' +import { Integration, IntegrationLogo } from './widgets/integration.js' +import { Logos, Colors, Patterns } from './widgets/styleguide' +import Changelog from './widgets/changelog.js' +import Features from './widgets/features.js' +import Languages from './widgets/languages.js' +import QuickstartInstall from './widgets/quickstart-install.js' +import QuickstartTraining from './widgets/quickstart-training.js' +import QuickstartModels from './widgets/quickstart-models.js' + +import Benchmarks from '../docs/usage/_benchmarks-models.mdx' +import Architecture101 from '../docs/usage/101/_architecture.mdx' +import LanguageData101 from '../docs/usage/101/_language-data.mdx' +import NER101 from '../docs/usage/101/_named-entities.mdx' +import Pipelines101 from '../docs/usage/101/_pipelines.mdx' +import PosDeps101 from '../docs/usage/101/_pos-deps.mdx' +import Serialization101 from '../docs/usage/101/_serialization.mdx' +import Tokenization101 from '../docs/usage/101/_tokenization.mdx' +import Training101 from '../docs/usage/101/_training.mdx' +import Vectors101 from '../docs/usage/101/_vectors-similarity.mdx' + +export const remarkComponents = { + a: Link, + p: P, + pre: Pre, + code: Code, + del: TypeAnnotation, + table: Table, + img: Image, + tr: Tr, + th: Th, + td: Td, + ol: Ol, + ul: Ul, + li: Li, + h2: H2, + h3: H3, + h4: H4, + h5: H5, + blockquote: Aside, + section: Section, + wrapper: ({ children }) => children, + hr: Hr, + + H2, + H3, + H4, + H5, + + Infobox, + Table, + Tr, + Tx, + Th, + Td, + Help, + Button, + YouTube, + SoundCloud, + Iframe, + GoogleSheet, + Abbr, + Tag, + Accordion, + Grid, + CodeBlock, + InlineCode, + Project, + Integration, + IntegrationLogo, + + /** + * This is readded as `Image` it can be explicitly used in MDX files. + * For regular img elements it is not possible to pass properties + */ + Image, + ImageScrollable, + Standalone, + + Label, + Logos, + Colors, + Patterns, + + Changelog, + Features, + Languages, + QuickstartInstall, + QuickstartTraining, + QuickstartModels, + + Benchmarks, + Architecture101, + LanguageData101, + NER101, + Pipelines101, + PosDeps101, + Serialization101, + Tokenization101, + Training101, + Vectors101, +} diff --git a/western_ai/usa/spacy/website/src/styles/accordion.module.sass b/western_ai/usa/spacy/website/src/styles/accordion.module.sass new file mode 100644 index 0000000000000000000000000000000000000000..7ca2b4a3a821053009f30e856ffd14f44a6262c5 --- /dev/null +++ b/western_ai/usa/spacy/website/src/styles/accordion.module.sass @@ -0,0 +1,55 @@ +.root + --color-inline-code-bg: var(--color-theme-opaque) + background: var(--color-theme-light) + margin-bottom: var(--spacing-xs) + border-radius: var(--border-radius) + +.spaced + margin-bottom: var(--spacing-md) + +.button + font: bold var(--font-size-lg)/var(--line-height-md) var(--font-primary) + color: var(--color-theme-dark) + display: flex + align-items: center + justify-content: space-between + width: 100% + padding: 1rem 1.5rem + border-radius: var(--border-radius) + text-align: left + + &:focus + background: var(--color-theme-opaque) + + &[aria-expanded="true"]:focus + border-bottom-left-radius: 0 + border-bottom-right-radius: 0 + +.icon + $width: 2rem + + width: $width + height: $width + flex: 0 0 $width + background: var(--color-theme-dark) + color: var(--color-back) + border-radius: 50% + padding: 0.35rem + pointer-events: none + +.content + padding: 2rem 1.5rem 3rem + + & > *:last-child + margin-bottom: 0 + + p + margin-bottom: var(--spacing-sm) + +.hidden + display: none + +.anchor + color: var(--color-subtle-dark) + padding-left: 0.5em + opacity: 0.75 diff --git a/western_ai/usa/spacy/website/src/styles/alert.module.sass b/western_ai/usa/spacy/website/src/styles/alert.module.sass new file mode 100644 index 0000000000000000000000000000000000000000..7730fcdf3eee3cf1fe7a0626344f4479b6572283 --- /dev/null +++ b/western_ai/usa/spacy/website/src/styles/alert.module.sass @@ -0,0 +1,24 @@ +.root + position: fixed + bottom: 0 + left: 0 + width: 100% + background: var(--color-back) + z-index: 100 + font: var(--font-size-sm)/var(--line-height-md) var(--font-primary) + text-align: center + padding: 1rem + box-shadow: var(--box-shadow) + border-top: 2px solid + color: var(--color-theme-dark) + +.warning + --alert-bg: var(--color-yellow-light) + --color-theme: var(--color-yellow-dark) + --color-theme-dark: var(--color-yellow-dark) + --color-inline-code-bg: var(--color-yellow-opaque) + background: var(--color-yellow-light) + color: var(--color-yellow-dark) + +.clickable + cursor: pointer diff --git a/western_ai/usa/spacy/website/src/styles/aside.module.sass b/western_ai/usa/spacy/website/src/styles/aside.module.sass new file mode 100644 index 0000000000000000000000000000000000000000..1b029cbb405646f5bdb3e1cd3b479d3a47338cc9 --- /dev/null +++ b/western_ai/usa/spacy/website/src/styles/aside.module.sass @@ -0,0 +1,97 @@ +@use 'sass:math' +@import base + +$triangle-size: 2rem +$border-radius: 6px + +.root + position: relative + +.content + --font-size-sm: 1.2rem + --color-inline-code-text: var(--color-back) + --color-inline-code-bg: var(--color-dark-secondary) + + background: var(--color-front) + border-top-left-radius: $border-radius + border-bottom-left-radius: $border-radius + font-size: var(--font-size-sm) + z-index: 10 + + pre + padding: 0 + margin: 0 0 var(--spacing-sm) 0 + + &:last-child + margin: 0 + + &:first-child h4 + margin-top: 0 !important + + code + padding: 0 !important + margin: 0 + + h4 + margin-left: 0 + + p, ul, ol + font: inherit + margin-bottom: var(--spacing-sm) + + ul li + padding: 0 + margin: 0 + + &:before + content: initial + +@include breakpoint(min, md) + .content + position: absolute + top: -3rem + left: calc(100% + 5.5rem) + width: calc(var(--width-aside) + 2rem) + + // Banner effect + &:after + position: absolute + bottom: math.div(-$triangle-size, 2) + left: math.div($border-radius, 2) + width: 0 + height: 0 + border-color: transparent + border-style: solid + border-top-color: var(--color-dark) + border-width: math.div($triangle-size, 2) 0 0 calc(#{$triangle-size} - #{math.div($border-radius, 2)}) + content: "" + +@include breakpoint(max, sm) + .content + display: block + margin: 2rem 0 + +.text + font: var(--font-size-sm)/var(--line-height-sm) var(--font-primary) + color: var(--color-back) + padding: 1.5rem 2.5rem 2.5rem 2rem + + a, a:hover + color: var(--color-subtle-on-dark) + + & > *:last-child + margin-bottom: 0 + +.title, +.text h4 + font: bold var(--font-size-lg)/var(--line-height-md) var(--font-secondary) + text-transform: uppercase + display: inline-block + border-radius: 1em + padding: 0 1rem 0.15rem !important + background: var(--color-dark) + box-shadow: inset 1px 1px 1px rgba(0, 0, 0, 0.25) + color: var(--color-back) + margin-bottom: 1.25rem + margin-left: -0.5rem + pointer-events: none diff --git a/western_ai/usa/spacy/website/src/styles/base.sass b/western_ai/usa/spacy/website/src/styles/base.sass new file mode 100644 index 0000000000000000000000000000000000000000..7b5a571f01132cfda11a9b261c76602944b52bcb --- /dev/null +++ b/western_ai/usa/spacy/website/src/styles/base.sass @@ -0,0 +1,57 @@ +/* Mixins */ + +//- Responsive Breakpoint utility + +$breakpoints: ( sm: 768px, md: 992px, lg: 1200px ) + +@mixin breakpoint($limit, $size) + $breakpoints-max: ( xs: map-get($breakpoints, sm) - 1, sm: map-get($breakpoints, md) - 1, md: map-get($breakpoints, lg) - 1 ) + + @if $limit == "min" + @media(min-width: #{map-get($breakpoints, $size)}) + @content + + @else if $limit == "max" + @media(max-width: #{map-get($breakpoints-max, $size)}) + @content + +// Scroll shadows for reponsive tables +// adapted from David Bushell, http://codepen.io/dbushell/pen/wGaamR +// $scroll-shadow-color - color of shadow +// $scroll-shadow-side - side to cover shadow (left or right) +// $scroll-shadow-background - original background color to match + +@function scroll-shadow-gradient($scroll-gradient-direction, $scroll-shadow-background) + @return linear-gradient(to #{$scroll-gradient-direction}, $scroll-shadow-background 50%, rgba(255, 255, 255, 0) 100%) + +@mixin scroll-shadow-base($scroll-shadow-color) + background: radial-gradient(ellipse at 0 50%, $scroll-shadow-color 0%, rgba(0,0,0,0) 75%) 0 center, radial-gradient(ellipse at 100% 50%, $scroll-shadow-color 0%, transparent 75%) 100% center + background-attachment: scroll, scroll + background-repeat: no-repeat + background-size: 10px 100%, 10px 100% + +@mixin scroll-shadow-cover($scroll-shadow-side, $scroll-shadow-background) + $scroll-gradient-direction: right !default + background-repeat: no-repeat + + @if $scroll-shadow-side == right + $scroll-gradient-direction: left + background-position: 100% 0 + + @if $scroll-shadow-side == both + background-image: scroll-shadow-gradient(left, $scroll-shadow-background), scroll-shadow-gradient(right, $scroll-shadow-background) + background-position: 100% 0, 0 0 + background-size: 20px 100%, 20px 100% + @else + background-image: scroll-shadow-gradient($scroll-gradient-direction, $scroll-shadow-background) + background-size: 20px 100% + +// Full vertical scroll shadows +// adapted from: https://codepen.io/laustdeleuran/pen/DBaAu + +@mixin scroll-shadow($background-color, $shadow-color, $shadow-offset: 0, $cover-size: 40px, $shadow-size: 15px) + background: linear-gradient($background-color 30%, rgba(255, 255, 255,0)) 0 $shadow-offset, linear-gradient(rgba(255,255,255,0), $background-color 70%) 0 100%, radial-gradient(farthest-side at 50% 0, $shadow-color, rgba(255,255,255,0)) -20px $shadow-offset, radial-gradient(farthest-side at 50% 100%, $shadow-color, rgba(255,255,255,0)) 0 100% + background-repeat: no-repeat + background-color: $background-color + background-size: 100% $cover-size, 100% $cover-size, 100% $shadow-size, 100% $shadow-size + background-attachment: local, local, scroll, scroll diff --git a/western_ai/usa/spacy/website/src/styles/button.module.sass b/western_ai/usa/spacy/website/src/styles/button.module.sass new file mode 100644 index 0000000000000000000000000000000000000000..9edf2e92595b3b6569fdade6c39c93af8916fda9 --- /dev/null +++ b/western_ai/usa/spacy/website/src/styles/button.module.sass @@ -0,0 +1,42 @@ +.root + display: inline-block + padding: 0.65rem 1.1rem 0.825rem + margin-bottom: 1px + border: 2px solid var(--color-theme-dark) + border-radius: 2em + text-align: center + transition: background-color, color 0.25s ease + font: bold var(--font-size-xs)/var(--line-height-md) var(--font-secondary) + text-transform: uppercase + white-space: nowrap + + &:hover + border-color: var(--color-theme-dark) + +.large + font-size: var(--font-size-lg) + padding: 0.8em 1.1em 1em + +.primary + background: var(--color-theme-dark) + color: var(--color-back) + + &:hover + background: var(--color-theme-dark) + color: var(--color-back) + +.secondary + background: var(--color-back) + color: var(--color-theme-dark) + + &:hover + color: var(--color-theme-dark) + +.tertiary + background: transparent + color: var(--color-back) + border-color: currentColor + + &:hover + color: var(--color-back) + border-color: currentColor diff --git a/western_ai/usa/spacy/website/src/styles/card.module.sass b/western_ai/usa/spacy/website/src/styles/card.module.sass new file mode 100644 index 0000000000000000000000000000000000000000..59c11ee9d622f26d279a778b31b917f3a728e1f3 --- /dev/null +++ b/western_ai/usa/spacy/website/src/styles/card.module.sass @@ -0,0 +1,23 @@ +.root + background: var(--color-subtle-light) + border-radius: var(--border-radius) + padding: 2rem + font: var(--font-size-md)/var(--line-height-md) var(--font-primary) + margin-bottom: var(--spacing-sm) + +.small + padding: 1.5rem + font-size: var(--font-size-sm) + line-height: var(--line-height-sm) + color: var(--color-dark) + + .title + margin-bottom: var(--spacing-xs) + +.image + $image-size: 35px + width: $image-size + height: $image-size + overflow: hidden + float: right + border-radius: 50% diff --git a/western_ai/usa/spacy/website/src/styles/code.module.sass b/western_ai/usa/spacy/website/src/styles/code.module.sass new file mode 100644 index 0000000000000000000000000000000000000000..c01422fe8fdf05eae90b21bdceb966685bacb1f7 --- /dev/null +++ b/western_ai/usa/spacy/website/src/styles/code.module.sass @@ -0,0 +1,195 @@ +.pre + position: relative + background: var(--color-front) + color: var(--color-subtle-on-dark) + border-radius: var(--border-radius) + overflow: auto + width: 100% + max-width: 100% + white-space: pre + direction: ltr + margin-bottom: var(--spacing-md) + +.max-height + height: 450px + +.code, +.juniper-input pre, +.juniper-output + font: var(--font-size-code)/var(--line-height-code) var(--font-code) !important + font-variant-ligatures: none !important + -webkit-font-smoothing: subpixel-antialiased + -moz-osx-font-smoothing: auto + +.code, +.juniper-input pre + display: block + padding: 1.75em 1.5em + +.code + &[data-prompt]:before, span[data-prompt]:before + content: attr(data-prompt) + margin-right: 0.65em + display: inline-block + vertical-align: middle + opacity: 0.5 + +.inline-code + color: var(--color-inline-code-text) + font-size: 90% + background-color: var(--color-inline-code-bg) + padding: 0.2rem 0.4rem + border-radius: 0.25rem + font-family: var(--font-code) + margin: 0 + box-decoration-break: clone + white-space: nowrap + text-shadow: none + font-variant-ligatures: none + -webkit-font-smoothing: subpixel-antialiased + -moz-osx-font-smoothing: auto + + a & + color: inherit + +.inline-code-dark + --color-inline-code-text: var(--color-back) + --color-inline-code-bg: var(--color-dark-secondary) + +.type-annotation + white-space: pre-wrap + font-family: var(--font-code) + + &.wrap + word-wrap: break-word + + a + border: 0 + + // Special style for types in API tables + td:not(:first-child) > &:last-child + display: block + border-top: 1px dotted var(--color-subtle) + border-radius: 0 + background: none + width: calc(100% + 2rem) + margin-left: -1rem + padding-left: 1rem + padding-top: 5px + margin-top: 5px + margin-bottom: -5px + + &:before + content: "Type: " + opacity: 0.75 + font-family: var(--font-primary) + color: var(--color-dark-secondary) + font-weight: bold + text-transform: uppercase + margin-right: 5px + +.type-annotation-meta + font-size: 90% + color: var(--color-subtle-dark) + +.wrap + white-space: pre-wrap + word-wrap: anywhere + +.title, +.juniper-button + font: bold var(--font-size-lg)/var(--line-height-md) var(--font-secondary) + text-transform: uppercase + display: inline-block + border-radius: 1em + padding: 0 1rem 0.15rem + color: var(--color-back) + +.title + box-shadow: inset 1px 1px 1px rgba(0, 0, 0, 0.25) + background: var(--color-dark) + margin: 1.5rem 0 0 2rem + position: sticky + left: 2rem + +.header + width: 100% + background: var(--color-front) + position: sticky + top: -0.75rem + margin-top: -0.75rem + border-top-left-radius: var(--border-radius) + border-top-right-radius: var(--border-radius) + padding: 1.25rem 1rem 1rem + font-size: var(--font-size-sm) + +.juniper-wrapper + background: var(--color-dark-secondary) + padding: 5px + +.juniper-title + font: bold var(--font-size-sm)/var(--line-height-sm) var(--font-primary) + text-align: center + padding: 0.25rem 1rem 0.5rem + display: flex + justify-content: space-between + +.juniper-cell + border: 0 + background: var(--color-front) + padding: 1rem 0 + +.juniper-input + padding-top: 1rem + padding-bottom: 2rem + padding-left: 2rem + background: var(--color-front) + + & > div + padding: 0 + height: auto + +.juniper-output + font: var(--font-size-xs) var(--font-code) + +.juniper-button + transition: background-color 0.15s ease + background: var(--color-theme-dark) + margin: 0.5rem 0 1rem 2rem + + &:hover + background: var(--color-theme-dark) + +.juniper-meta + font-size: var(--font-size-xs) + font-weight: normal + padding-top: 0.1rem + color: var(--color-subtle-dark) + +.cli + padding-top: calc(var(--spacing-sm) - 6px) + padding-bottom: calc(var(--spacing-sm) - 12px) + + [data-prompt]:before + color: var(--color-subtle) + +.cli-arg + border: 1px solid var(--color-dark) + padding: 1px 6px + margin-bottom: 5px + border-radius: 0.5em + display: inline-block + + a + color: inherit !important + +.cli-arg-highlight + background: var(--color-theme-dark) + border-color: var(--color-theme-dark) + color: var(--color-back) !important + +.cli-arg-subtle + color: var(--syntax-comment) + +.cli-arg-emphasis + font-style: italic diff --git a/western_ai/usa/spacy/website/src/styles/copy.module.sass b/western_ai/usa/spacy/website/src/styles/copy.module.sass new file mode 100644 index 0000000000000000000000000000000000000000..9e27b77e63b16eb2a21da3def8c4c565eca6511b --- /dev/null +++ b/western_ai/usa/spacy/website/src/styles/copy.module.sass @@ -0,0 +1,25 @@ +.root + background: var(--color-back) + border-radius: 2em + border: 1px solid var(--color-subtle) + width: 100% + padding: 0.25em 1em + display: inline-flex + margin: var(--spacing-xs) 0 + font: var(--font-size-code)/var(--line-height-code) var(--font-code) + -webkit-font-smoothing: subpixel-antialiased + -moz-osx-font-smoothing: auto + +.textarea + flex: 100% + background: transparent + resize: none + font: inherit + overflow: hidden + white-space: nowrap + text-overflow: ellipsis + margin-right: 1rem + +.prefix + margin-right: 0.75em + color: var(--color-subtle-dark) diff --git a/western_ai/usa/spacy/website/src/styles/dropdown.module.sass b/western_ai/usa/spacy/website/src/styles/dropdown.module.sass new file mode 100644 index 0000000000000000000000000000000000000000..a1deb85e25b30f0282887d19c05722b87390e36b --- /dev/null +++ b/western_ai/usa/spacy/website/src/styles/dropdown.module.sass @@ -0,0 +1,16 @@ +.root + --dropdown-text-color: var(--color-front) + font: inherit + background: transparent + border: none + appearance: none + background-color: var(--color-back) + background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23929e9b%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E') + background-repeat: no-repeat + background-position: right 0.7em top 50% + background-size: 0.5em auto + padding: 0 1.4em 0 0.5em + + &:-moz-focusring + text-shadow: 0 0 0 var(--dropdown-text-color) + color: transparent diff --git a/western_ai/usa/spacy/website/src/styles/embed.module.sass b/western_ai/usa/spacy/website/src/styles/embed.module.sass new file mode 100644 index 0000000000000000000000000000000000000000..1e7da33c55a7351f4e381d8eb33ea2be37a19c8d --- /dev/null +++ b/western_ai/usa/spacy/website/src/styles/embed.module.sass @@ -0,0 +1,55 @@ +@use 'sass:math' + +.root + margin-bottom: var(--spacing-md) + +.responsive + position: relative + height: 0 + +@each $ratio1, $ratio2 in (16, 9), (4, 3) + .ratio#{$ratio1}x#{$ratio2} + padding-bottom: (100% * math.div($ratio2, $ratio1)) + +.iframe + position: absolute + top: 0 + left: 0 + width: 100% + height: 100% + border-radius: var(--border-radius) + +.standalone + max-width: 100% + border: 1px solid var(--color-subtle) + border-radius: var(--border-radius) + padding: var(--spacing-xs) + margin-bottom: var(--spacing-md) + +.scrollable + max-width: 100% + overflow: auto + +.image + position: relative + display: block + max-width: 100% + margin: 0 auto + +.image-scrollable + display: block + max-width: fit-content + +.figure-fill + display: block + position: relative + width: 100% + img + object-fit: contain + +.image-link + display: block + +.google-sheet + width: 100% + margin-bottom: 1rem diff --git a/western_ai/usa/spacy/website/src/styles/footer.module.sass b/western_ai/usa/spacy/website/src/styles/footer.module.sass new file mode 100644 index 0000000000000000000000000000000000000000..07bf8b70d32d0bc6613b652b80b2b54cd4dd9d22 --- /dev/null +++ b/western_ai/usa/spacy/website/src/styles/footer.module.sass @@ -0,0 +1,45 @@ +@import base + +.root + position: relative + padding: 2.5rem 0 + overflow: auto + background: var(--color-subtle-light) + font: var(--font-size-md)/var(--line-height-md) var(--font-primary) + +.content + padding: 2rem 7.5rem 3rem + margin: 0 auto + width: var(--width-content) + max-width: 100% + +@include breakpoint(max, sm) + .content + padding: 3rem + +.label + color: var(--color-subtle-dark) + font: bold var(--font-size-lg)/var(--line-height-md) var(--font-secondary) + text-transform: uppercase + +.full + flex: 100% + grid-column: 1 / span 3 + +.column + margin-bottom: var(--spacing-md) + +.copy + border-top: 1px dotted var(--color-subtle) + font-size: var(--font-size-xs) + color: var(--color-front-dark) + text-align: center + width: 100% + +.logo + margin: 0 3rem + display: inline-block + vertical-align: middle + + &:hover + color: var(--color-theme-dark) diff --git a/western_ai/usa/spacy/website/src/styles/grid.module.sass b/western_ai/usa/spacy/website/src/styles/grid.module.sass new file mode 100644 index 0000000000000000000000000000000000000000..81cd6851af47f363f2aeef276844e888743d57d4 --- /dev/null +++ b/western_ai/usa/spacy/website/src/styles/grid.module.sass @@ -0,0 +1,42 @@ +@use 'sass:math' +@import base + +$grid-gap-wide: 5rem +$grid-gap-narrow: 2rem +$flex-gap: 2rem + +@mixin flex-fallback($cols, $gap: 0) + & > * + @if $gap == 0 + flex: 0 0 100% / $cols + @else + flex: 0 0 calc(#{math.div(100%, $cols)} - #{$gap * ($cols - 1)}) + +.root + display: flex + flex-direction: row + flex-wrap: wrap + justify-content: space-between + grid-column-gap: $grid-gap-wide + + & > * + min-width: 0 + +@supports(display: grid) + .root + display: grid + +@include breakpoint(min, lg) + .root + grid-template-columns: 1fr + + @each $name, $cols in (half: 2, third: 3, quarter: 4) + .#{$name} + @include flex-fallback($cols, $flex-gap) + grid-template-columns: repeat($cols, 1fr) + +.narrow + grid-column-gap: $grid-gap-narrow + +.spacing:not(:empty) + margin-bottom: var(--spacing-md) diff --git a/western_ai/usa/spacy/website/src/styles/icon.module.sass b/western_ai/usa/spacy/website/src/styles/icon.module.sass new file mode 100644 index 0000000000000000000000000000000000000000..bbd1bfb6d95d3f03d41c8e19c8da9118a157b810 --- /dev/null +++ b/western_ai/usa/spacy/website/src/styles/icon.module.sass @@ -0,0 +1,20 @@ +.root + vertical-align: middle + +.inline + margin: 0 0.55em 0 0.1em + +.tag + vertical-align: bottom + height: 100% + position: relative + top: 1px + +.success + color: var(--color-green-medium) + +.error + color: var(--color-red-medium) + +.subtle + color: var(--color-subtle-dark) diff --git a/western_ai/usa/spacy/website/src/styles/infobox.module.sass b/western_ai/usa/spacy/website/src/styles/infobox.module.sass new file mode 100644 index 0000000000000000000000000000000000000000..c6dd9f309cffc20c3b7b9c4d71de55cdaace90d9 --- /dev/null +++ b/western_ai/usa/spacy/website/src/styles/infobox.module.sass @@ -0,0 +1,64 @@ +.root + margin-bottom: var(--spacing-md) + font: var(--font-size-sm)/var(--line-height-md) var(--font-primary) + background: var(--color-subtle-light) + padding: 1.5rem 2rem 0.75rem 1.5rem + border-radius: var(--border-radius) + color: var(--color-dark) + border-left: 0.75rem solid var(--color-subtle-light) + + p, pre, ul, ol + margin-bottom: var(--spacing-xs) + + p, li + font-size: inherit + line-height: inherit + + ul li + padding-left: 0.75em + +.list ul li + font-size: var(--font-size-sm) + list-style: none + padding: 0 + margin: 0 0 0.35rem 0 + + &:before + all: initial + + a, a span + border-bottom: 0 !important + +.title + font-weight: bold + color: var(--color-theme-dark) + display: block + margin-bottom: var(--spacing-xs) + font-size: var(--font-size-md) + + code + font-weight: normal + color: inherit + +.icon + color: var(--color-theme-dark) + vertical-align: baseline + position: relative + bottom: -2px + +.emoji + margin-right: 0.65em + +.warning + --color-theme: var(--color-yellow-dark) + --color-theme-dark: var(--color-yellow-dark) + --color-inline-code-bg: var(--color-yellow-opaque) + border-color: var(--color-yellow-medium) + background: var(--color-yellow-light) + +.danger + --color-theme: var(--color-red-dark) + --color-theme-dark: var(--color-red-dark) + --color-inline-code-bg: var(--color-red-opaque) + border-color: var(--color-red-medium) + background: var(--color-red-light) diff --git a/western_ai/usa/spacy/website/src/styles/landing.module.sass b/western_ai/usa/spacy/website/src/styles/landing.module.sass new file mode 100644 index 0000000000000000000000000000000000000000..9add1d1427826656acb7a0d050438753e18b550a --- /dev/null +++ b/western_ai/usa/spacy/website/src/styles/landing.module.sass @@ -0,0 +1,154 @@ +@import base + +.header + background: var(--color-theme) + padding-top: var(--height-nav) + width: 100% + text-align: center + --header-top-margin: 27px + +.header-wrapper + background: var(--color-theme) + background-position: center var(--header-top-margin) + background-repeat: repeat + width: 100% + background-size: 799px 643px + +.header-content + background-position: center calc(-138px + var(--header-top-margin)) + background-repeat: no-repeat + width: 100% + min-height: calc(573px + var(--header-top-margin)) + background-size: 1444px 573px + padding-top: var(--header-top-margin) + +.title + font: normal 600 7rem/#{1} var(--font-secondary) + color: var(--color-back) + text-align: center + margin-bottom: 0.75rem + padding: 0 1rem + +@include breakpoint(max, sm) + .title + font-size: 4rem + padding-top: 1.5rem + +.label + font: bold var(--font-size-lg)/var(--line-height-md) var(--font-secondary) + text-transform: uppercase + display: inline-block + border-radius: 1em + padding: 0 1rem 0.15rem + background: var(--color-back) + color: var(--color-theme) + +.subtitle + margin-top: 1rem + +.blocks + position: relative + top: -25rem + margin-bottom: -25rem + +.card + display: flex + flex-direction: column + padding: 3rem 2.5rem + background: var(--color-back) + border-radius: var(--border-radius) + box-shadow: var(--box-shadow) + margin-bottom: 3rem + +.card-text + flex: 100% + +.button + width: 100% + +.demo + flex: 0 0 66% + grid-column: 1 / span 2 + +.banner-grid + grid-gap: 0 + + & > * + flex-basis: 50% + +.banner + background: var(--color-theme) + color: var(--color-back) + padding: 1rem 5rem + margin-bottom: var(--spacing-md) + background-size: cover + +.banner-content + margin-bottom: 0 + height: 100% + + a, a:hover + color: inherit + +.banner-content-small + display: block + margin-bottom: 0 !important + +.banner-title + display: block + margin-top: 1.5rem + margin-bottom: 0.5em + +.banner-label + margin-bottom: 1rem + +.banner-text + font-weight: 500 + + strong + font-weight: 800 + + p + font-size: 1.5rem + +.banner-text-small p + font-size: 1.35rem + margin-bottom: 1.5rem + +@include breakpoint(min, md) + .banner-content + padding: 0 6.5rem 0 4rem + + .banner-content-small + padding: 0 2.25rem 1rem + + .banner-text + padding-top: 7rem + grid-column: 2 / span 2 + flex: 0 0 66% + + .banner-text-small + padding-top: 1rem + grid-column: unset + flex: 0 0 100% + padding-right: 2rem + +@include breakpoint(max, md) + .banner + padding: 1rem 3rem + + .banner-content + display: block + + .banner-text + padding-top: 0 + + .grid + grid-template-columns: 1fr !important + +.banner-button + margin-bottom: var(--spacing-sm) + text-align: right + +.banner-button-element + background: var(--color-theme) diff --git a/western_ai/usa/spacy/website/src/styles/layout.sass b/western_ai/usa/spacy/website/src/styles/layout.sass new file mode 100644 index 0000000000000000000000000000000000000000..119437bde9f8ca2a2544801e7880a6ca135dd7f9 --- /dev/null +++ b/western_ai/usa/spacy/website/src/styles/layout.sass @@ -0,0 +1,545 @@ +@import base + +/* Theme */ + +\:root + // Sizes + --height-nav: 55px + --width-content: 1250px + --width-sidebar: 235px + --width-aside: 27.5vw + + // Fonts + --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol' + --font-secondary: 'HK Grotesk', Roboto, Helvetica, Arial, sans-serif + --font-code: "Jetbrains Mono", Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace + + // Font Sizes + --font-size-xs: 1.1rem + --font-size-sm: 1.3rem + --font-size-md: 1.35rem + --font-size-lg: 1.4rem + --font-size-code: 1.2rem + + --line-height-xs: 1.25 + --line-height-sm: 1.375 + --line-height-md: 1.5 + --line-height-lg: 1.9 + --line-height-code: 1.7 + + // Spacing + --spacing-xs: 1rem + --spacing-sm: 2rem + --spacing-md: 4rem + --spacing-lg: 6rem + + // Theme Colors + --color-theme-blue: hsl(195, 92%, 44%) + --color-theme-blue-dark: hsl(195, 92%, 34%) + --color-theme-blue-light: hsla(195, 92%, 44%, 0.06) + --color-theme-blue-opaque: hsla(195, 92%, 44%, 0.11) + + --color-theme-green: hsl(164, 94%, 35%) + --color-theme-green-dark: hsl(164, 94%, 25%) + --color-theme-green-light: hsla(164, 94%, 35%, 0.06) + --color-theme-green-opaque: hsla(164, 94%, 35%, 0.11) + + --color-theme-purple: hsl(255, 61%, 54%) + --color-theme-purple-dark: hsl(255, 61%, 44%) + --color-theme-purple-light: hsla(255, 61%, 54%, 0.06) + --color-theme-purple-opaque: hsla(255, 61%, 54%, 0.11) + + --color-theme-nightly: hsl(257, 99%, 67%) + --color-theme-nightly-dark: hsl(257, 99%, 57%) + --color-theme-nightly-light: hsla(257, 99%, 67%, 0.06) + --color-theme-nightly-opaque: hsla(257, 99%, 67%, 0.11) + + --color-theme-legacy: #6f6f6f + --color-theme-legacy-dark: hsl(257, 0%, 35%) + --color-theme-legacy-light: hsla(257, 0%, 67%, 0.06) + --color-theme-legacy-opaque: hsla(257, 0%, 67%, 0.11) + + // Regular colors + --color-back: hsl(0, 0%, 100%) + --color-front: hsl(213, 15%, 12%) + --color-dark: hsl(214, 15%, 32%) + --color-dark-secondary: hsl(214, 14%, 22%) + --color-subtle-opaque: hsla(0, 0%, 96%, 0.56) + --color-subtle: hsla(0, 0%, 0%, 0.13) + --color-subtle-light: hsla(0, 0%, 0%, 0.04) + --color-subtle-dark: hsla(162, 5%, 0%, 0.55) + --color-subtle-on-dark: hsla(0, 0%, 100%, 0.87) + + --color-green-medium: hsl(108, 66%, 63%) + --color-green-transparent: hsla(108, 66%, 63%, 0.12) + --color-red-light: hsl(355, 100%, 96%) + --color-red-medium: hsl(346, 84%, 61%) + --color-red-dark: hsl(332, 64%, 34%) + --color-red-opaque: hsl(346, 96%, 89%) + --color-red-transparent: hsla(346, 84%, 61%, 0.12) + --color-yellow-light: hsl(46, 100%, 95%) + --color-yellow-medium: hsl(45, 90%, 55%) + --color-yellow-dark: hsl(44, 94%, 27%) + --color-yellow-opaque: hsl(45, 90%, 87%) + + // Syntax Highlighting + --syntax-comment: hsl(162, 5%, 60%) + --syntax-tag: hsl(266, 72%, 72%) + --syntax-number: var(--syntax-tag) + --syntax-selector: hsl(31, 100%, 71%) + --syntax-function: hsl(195, 70%, 54%) + --syntax-keyword: hsl(343, 100%, 68%) + --syntax-operator: var(--syntax-keyword) + + // Other + --color-inline-code-text: var(--color-dark) + --color-inline-code-bg: var(--color-subtle-light) + + --color-shadow: hsla(0, 0%, 0%, 0.2) + --box-shadow: 0 1px 5px var(--color-shadow) + --border-radius: 6px + +/* Theming */ +.theme-blue + --color-theme: var(--color-theme-blue) + --color-theme-dark: var(--color-theme-blue-dark) + --color-theme-light: var(--color-theme-blue-light) + --color-theme-opaque: var(--color-theme-blue-opaque) + +.theme-green + --color-theme: var(--color-theme-green) + --color-theme-dark: var(--color-theme-green-dark) + --color-theme-light: var(--color-theme-green-light) + --color-theme-opaque: var(--color-theme-green-opaque) + +.theme-purple + --color-theme: var(--color-theme-purple) + --color-theme-dark: var(--color-theme-purple-dark) + --color-theme-light: var(--color-theme-purple-light) + --color-theme-opaque: var(--color-theme-purple-opaque) + +.theme-nightly + --color-theme: var(--color-theme-nightly) + --color-theme-dark: var(--color-theme-nightly-dark) + --color-theme-light: var(--color-theme-nightly-light) + --color-theme-opaque: var(--color-theme-nightly-opaque) + +.theme-legacy + --color-theme: var(--color-theme-legacy) + --color-theme-dark: var(--color-theme-legacy-dark) + --color-theme-light: var(--color-theme-legacy-light) + --color-theme-opaque: var(--color-theme-legacy-opaque) + + +/* Fonts */ + +@font-face + font-family: "HK Grotesk" + font-style: normal + font-weight: 500 + src: url("../fonts/hkgrotesk-semibold.woff2") format("woff2"), url("../fonts/hkgrotesk-semibold.woff") format("woff") + font-display: swap + +@font-face + font-family: "HK Grotesk" + font-style: italic + font-weight: 500 + src: url("../fonts/hkgrotesk-semibolditalic.woff2") format("woff2"), url("../fonts/hkgrotesk-semibolditalic.woff") format("woff") + font-display: swap + +@font-face + font-family: "HK Grotesk" + font-style: normal + font-weight: 600 + src: url("../fonts/hkgrotesk-bold.woff2") format("woff2"), url("../fonts/hkgrotesk-bold.woff") format("woff") + font-display: swap + +@font-face + font-family: "HK Grotesk" + font-style: italic + font-weight: 600 + src: url("../fonts/hkgrotesk-bolditalic.woff2") format("woff2"), url("../fonts/hkgrotesk-bolditalic.woff") format("woff") + font-display: swap + +@font-face + font-family: "JetBrains Mono" + font-style: normal + font-weight: 500 + font-display: fallback + src: url("../fonts/jetbrainsmono-regular.woff") format("woff"), url("../fonts/jetbrainsmono-regular.woff2") format("woff2") + +@font-face + font-family: "JetBrains Mono" + font-style: italic + font-weight: 500 + font-display: fallback + src: url("../fonts/jetbrainsmono-italic.woff") format("woff"), url("../fonts/jetbrainsmono-italic.woff2") format("woff2") + + +/* Reset */ + +*, *:before, *:after + box-sizing: border-box + padding: 0 + margin: 0 + border: 0 + outline: 0 + +html + font-family: sans-serif + text-rendering: optimizeSpeed + -ms-text-size-adjust: 100% + -webkit-text-size-adjust: 100% + -webkit-font-smoothing: antialiased + -moz-osx-font-smoothing: grayscale + +body + margin: 0 + +article, aside, details, figcaption, figure, footer, header, main, menu, nav, +section, summary, progress + display: block + +a + background-color: transparent + color: inherit + text-decoration: none + + &:active, + &:hover + outline: 0 + +abbr[title] + border-bottom: none + text-decoration: underline + text-decoration: underline dotted + +b, strong + font-weight: inherit + font-weight: bolder + +small + font-size: 80% + +sub, sup + position: relative + font-size: 65% + line-height: 0 + vertical-align: baseline + +sup + top: -0.5em + +sub + bottom: -0.15em + +img + border: 0 + height: auto + max-width: 100% + +svg + max-width: 100% + color-interpolation-filters: sRGB + fill: currentColor + + &:not(:root) + overflow: hidden + +hr + box-sizing: content-box + overflow: visible + height: 0 + +pre + overflow: auto + +code, pre + font-family: var(--font-code) + font-size: var(--font-size-code) + font-variant-ligatures: none + -webkit-font-smoothing: subpixel-antialiased + -moz-osx-font-smoothing: auto + +table + text-align: left + width: 100% + max-width: 100% + border-collapse: collapse + + td, th + vertical-align: top + +ul, ol + list-style: none + +input, button + appearance: none + background: transparent + +button + cursor: pointer + +progress + appearance: none + +/* Layout */ + +html + font-size: 11px + +body + background: var(--color-back) + color: var(--color-front) + +p + margin-bottom: var(--spacing-sm) + font-family: var(--font-primary) + font-size: var(--font-size-md) + line-height: var(--line-height-md) + + &:empty + margin-bottom: 0 + +a:focus + outline: 1px dotted var(--color-theme-dark) + +body [id]:target + padding-top: calc(var(--height-nav) * 1.25) !important + +::selection + background: var(--color-theme-dark) + color: var(--color-back) + text-shadow: none + +// Footnotes + +.footnotes + border-top: 1px dotted var(--color-subtle) + color: var(--color-dark) + + li + font-size: var(--font-size-xs) + + .footnote-backref + border: none + margin-left: 1rem + display: inline-block + width: 1em + line-height: 1 + overflow: hidden + + &:before + content: "\21A9\FE0E" + width: 1em + + hr + display: none + + +// Prism + +[class*="language-"] .token + &.comment, &.prolog, &.doctype, &.cdata, &.punctuation + color: var(--syntax-comment) + + &.property, &.tag, &.symbol + color: var(--syntax-tag) + + &.boolean, &.number + color: var(--syntax-number) + + &.attr-name, &.string, &.char, &.builtin, &.attr-value + color: var(--syntax-selector) + + @at-root .language-css .token.string, + &.operator, &.entity, &.url, &.variable + color: var(--syntax-operator) + + &.atrule, &.function, &.selector + color: var(--syntax-function) + + &.keyword + color: var(--syntax-keyword) + + &.inserted, &.deleted + padding: 2px 0 + border-radius: 2px + opacity: 0.9 + + &.inserted + color: var(--color-green-medium) + background: var(--color-green-transparent) + + &.deleted + color: var(--color-red-medium) + background: var(--color-red-transparent) + + &.italic + font-style: italic + + +[class*="language-"].type-annotation .token + &.builtin, &.boolean, &.number + color: var(--color-inline-code-text) + + &.operator + color: var(--syntax-comment) + +[class*="language-bash"] .token + &.function + color: var(--color-subtle-on-dark) + + &.operator, &.variable + color: var(--syntax-comment) + +// Settings for ini syntax (config files) +[class*="language-ini"] + color: var(--syntax-comment) + + .token + color: var(--color-subtle-on-dark) + +.gatsby-highlight-code-line + background-color: var(--color-dark-secondary) + border-left: 0.35em solid var(--color-theme) + display: block + margin-right: -1.5em + margin-left: -1.5em + padding-right: 1.5em + padding-left: 1.2em + + &:empty:before + // Fix issue where empty lines would disappear + content: " " + +// Jupyter + +.jp-RenderedText pre + .ansi-cyan-fg.ansi-cyan-fg + color: var(--syntax-function) + + .ansi-green-fg.ansi-green-fg + color: var(--color-green-medium) + + .ansi-red-fg.ansi-red-fg + color: var(--syntax-operator) + +.jp-OutputArea + &:not(:empty) + padding: 2rem 2rem 1rem + border-top: 1px solid var(--color-dark) + margin-top: 2rem + + .entities, svg + white-space: initial + font-family: inherit + + .entities + font-size: 1.35rem + + .displacy + margin-top: 1rem + font-family: var(--font-primary) !important + color: var(--color-subtle) !important + background: var(--color-front) !important + +.jp-OutputArea pre + font: inherit + +.jp-OutputPrompt.jp-OutputArea-prompt + padding-top: 0.5em + margin-right: 1rem + font-family: inherit + font-weight: bold + +/* Tooltips */ + +[data-tooltip] + position: relative + +@include breakpoint(min, sm) + [data-tooltip][data-tooltip-style="code"]:before + -webkit-font-smoothing: subpixel-antialiased + -moz-osx-font-smoothing: auto + padding: 0.35em 0.85em 0.45em + font-family: var(--font-code) + white-space: nowrap + min-width: auto + + [data-tooltip]:before + font: normal var(--font-size-xs)/var(--line-height-xs) var(--font-primary) + position: absolute + top: 125% + left: 50% + display: inline-block + content: attr(data-tooltip) + background: var(--color-front) + border-radius: var(--border-radius) + box-shadow: var(--box-shadow) + border: 1px solid var(--color-dark) + color: var(--color-back) + text-transform: none + text-align: left + opacity: 0 + transform: translateX(-50%) translateY(-2px) + transition: opacity 0.1s ease-out, transform 0.1s ease-out + visibility: hidden + max-width: 300px + min-width: 200px + padding: 0.75em 1em 1em + z-index: 200 + white-space: pre-wrap + + [data-tooltip]:hover:before + opacity: 1 + transform: translateX(-50%) translateY(0) + visibility: visible + +/* Gatsby Images */ + +.gatsby-resp-image-figure + margin-bottom: var(--spacing-md) + +.gatsby-resp-image-figcaption, .caption + font: var(--font-size-xs)/var(--line-height-md) var(--font-primary) + color: var(--color-subtle-dark) + padding-top: 0.75rem + padding-left: 3rem + + p + font: inherit + + code, a + color: inherit + + +/* Algolia DocSearch */ + +@include breakpoint(max, xs) + .algolia-autocomplete .ds-dropdown-menu + max-width: 90vw !important + min-width: 90vw !important + +.algolia-autocomplete .algolia-docsearch-suggestion--category-header + display: block + font: bold var(--font-size-lg)/var(--line-height-md) var(--font-secondary) + text-transform: uppercase + color: var(--color-theme-dark) + +.algolia-autocomplete .algolia-docsearch-suggestion--subcategory-column + color: var(--color-dark) + +.algolia-autocomplete .algolia-docsearch-suggestion--title + font-size: var(--font-size-sm) + +.algolia-autocomplete .ds-dropdown-menu .ds-suggestion.ds-cursor .algolia-docsearch-suggestion--content + background: var(--color-subtle-opaque) !important + +.algolia-autocomplete .algolia-docsearch-suggestion--text + font-size: var(--font-size-sm) + +.algolia-autocomplete .algolia-docsearch-suggestion--highlight + box-shadow: none !important + background: var(--color-theme-opaque) !important + color: var(--color-theme-dark) !important diff --git a/western_ai/usa/spacy/website/src/styles/link.module.sass b/western_ai/usa/spacy/website/src/styles/link.module.sass new file mode 100644 index 0000000000000000000000000000000000000000..20a61a2b9a721d1ef7983aa1223a7c45978c861d --- /dev/null +++ b/western_ai/usa/spacy/website/src/styles/link.module.sass @@ -0,0 +1,30 @@ +.root + color: var(--color-theme-dark) + border-bottom: 1px solid + transition: color 0.2s ease + cursor: pointer + + &:hover + color: var(--color-front) + +.no-link-layout + border: none + color: inherit + + &:hover + color: inherit + +.icon + margin-left: 0.5em + width: 1.1em + height: 1.1em + +.nowrap + white-space: nowrap + display: inline-block + +.with-icon + border: none + +.source-text + border-bottom: 1px solid diff --git a/western_ai/usa/spacy/website/src/styles/list.module.sass b/western_ai/usa/spacy/website/src/styles/list.module.sass new file mode 100644 index 0000000000000000000000000000000000000000..01755a06cb9060d1d971925d7c773c84b3006a44 --- /dev/null +++ b/western_ai/usa/spacy/website/src/styles/list.module.sass @@ -0,0 +1,61 @@ +.ol, .ul + margin-bottom: var(--spacing-md) + font: var(--font-size-md)/var(--line-height-md) var(--font-primary) + +.ol + counter-reset: li + + li:before + content: counter(li, decimal) '.' + font-size: 1em + padding-right: 1rem + padding-top: 0 + +.li + padding-left: 2rem + margin-bottom: 0.5em + margin-left: 1.25rem + + p + display: inline-block + margin-bottom: var(--spacing-sm) + + .ol, .ul + margin-top: var(--spacing-xs) + margin-bottom: var(--spacing-xs) + + &:before + content: '\25CF' + position: relative + bottom: 1px + display: inline-block + font-size: 0.6em + font-weight: bold + padding-right: 1.5em + padding-top: 0.5em + margin-left: -3.75rem + text-align: right + width: 2.5rem + counter-increment: li + box-sizing: content-box + vertical-align: top + +.emoji:before + content: attr(data-emoji) + padding-right: 0.75em + padding-top: 0 + margin-left: -2.5em + width: 1.75em + text-align: right + font-size: 1em + position: static + +.li-icon + text-indent: calc(-20px - 0.55em) + + &:before + content: "" + + .ul .ul & + text-indent: initial + margin-left: -20px diff --git a/western_ai/usa/spacy/website/src/styles/main.module.sass b/western_ai/usa/spacy/website/src/styles/main.module.sass new file mode 100644 index 0000000000000000000000000000000000000000..ba2561c80182c9508a5d39b382042034208ebdea --- /dev/null +++ b/western_ai/usa/spacy/website/src/styles/main.module.sass @@ -0,0 +1,41 @@ +@import base + +.root + max-width: 100% + min-height: 100vh + +@include breakpoint(min, md) + .root + padding: var(--height-nav) 0 0 0 + + .with-sidebar + margin-left: var(--width-sidebar) + + .with-asides + margin-right: var(--width-aside) + position: relative + + .asides + position: absolute + top: 0 + left: 100% + width: var(--width-aside) + height: 100% + content: "" + display: block + background-color: var(--color-theme) + background-repeat: repeat + background-position: center top + background-size: 799px 643px + z-index: -1 + min-height: 100vh + +.content + padding: 3rem 7.5rem + margin: 0 auto + width: var(--width-content) + max-width: 100% + +@include breakpoint(max, sm) + .content + padding: 3rem diff --git a/western_ai/usa/spacy/website/src/styles/navigation.module.sass b/western_ai/usa/spacy/website/src/styles/navigation.module.sass new file mode 100644 index 0000000000000000000000000000000000000000..73ebdb354351b60e7027a56d16843912dd7e8571 --- /dev/null +++ b/western_ai/usa/spacy/website/src/styles/navigation.module.sass @@ -0,0 +1,127 @@ +@import base + +.root + position: fixed + top: 0 + left: 0 + width: 100% + height: var(--height-nav) + background: var(--color-back) + color: var(--color-front) + align-items: center + display: flex + justify-content: space-between + flex-flow: row nowrap + padding: 0 0 0 1rem + z-index: 30 + width: 100% + box-shadow: var(--box-shadow) + --docsearch-muted-color: var(--color-subtle-dark) + --docsearch-text-color: var(--docsearch-muted-color) + --docsearch-searchbox-background: var(--color-subtle-light) + +.logo + min-width: 95px + width: 95px + height: 30px + color: var(--color-theme-dark) !important + vertical-align: middle + +.title + display: none + +.list + display: flex + flex-flow: row nowrap + border-color: inherit + justify-content: flex-end + margin-bottom: 0.25rem + +.item + display: inline-flex + align-items: center + height: 100% + text-transform: uppercase + font-family: var(--font-secondary) + font-size: 1.6rem + font-weight: bold + color: var(--color-theme-dark) + + &:not(:first-child) + margin-left: 2em + + &:last-child + padding-right: 2rem + + &:first-child + padding-left: 2rem + +.menu + display: flex + flex-flow: row nowrap + margin-left: 0.5rem + +.is-active + color: var(--color-dark) + pointer-events: none + +.search + display: inline-flex + align-items: center + height: 100% + padding-right: 2rem + +.github + text-transform: initial + margin-top: 0.25rem + margin-left: 1.5em !important + + & > span + min-width: 100px + +.dropdown + --dropdown-text-color: var(--color-theme-dark) + font-family: var(--font-secondary) + font-size: 1.6rem + font-weight: bold + color: var(--color-theme-dark) + text-transform: uppercase + margin-right: 0.5rem + border: 2px solid var(--color-back) + border-radius: 2em + + &:focus + border: 2px dotted var(--color-theme) + outline: none + +.has-alert + display: inline-flex + flex-flow: row nowrap + align-items: center + +.alert + font-size: 1.2rem + font-family: var(--font-primary) + display: inline-block + background: var(--color-yellow-opaque) + color: var(--color-dark) + border-radius: var(--border-radius) + margin-left: var(--spacing-xs) + padding: 0.5rem + line-height: var(--line-height-xs) + text-align: center + +@include breakpoint(max, md) + .alert + display: none + +@include breakpoint(max, xs) + .list + display: none + + .has-alert + display: inline + +@include breakpoint(min, sm) + .dropdown + display: none diff --git a/western_ai/usa/spacy/website/src/styles/newsletter.module.sass b/western_ai/usa/spacy/website/src/styles/newsletter.module.sass new file mode 100644 index 0000000000000000000000000000000000000000..f3e66682477b2b3c06e165df69576e87b4913c6b --- /dev/null +++ b/western_ai/usa/spacy/website/src/styles/newsletter.module.sass @@ -0,0 +1,22 @@ +.root + font: var(--font-size-sm)/var(--line-height-sm) var(--font-primary) + margin: var(--spacing-xs) 0 + background: var(--color-back) + border-radius: 2em + border: 1px solid var(--color-subtle) + padding-right: 1em + display: inline-flex + max-width: 300px + +.input + font: inherit + background: transparent + padding: 0.5em 1em + margin: 0 0 0.25rem 0.25rem + flex: 100% + +.button + font: bold var(--font-size-lg)/var(--line-height-md) var(--font-secondary) + text-transform: uppercase + color: var(--color-theme-dark) + white-space: nowrap diff --git a/western_ai/usa/spacy/website/src/styles/progress.module.sass b/western_ai/usa/spacy/website/src/styles/progress.module.sass new file mode 100644 index 0000000000000000000000000000000000000000..d952de9b9dc0128f40a322cc241c353ec26335df --- /dev/null +++ b/western_ai/usa/spacy/website/src/styles/progress.module.sass @@ -0,0 +1,22 @@ +.root + display: block + flex: 105% + width: 105% + height: 3px + color: var(--color-theme) + background: transparent + border: none + position: absolute + bottom: 0 + left: -2.5% + + &::-webkit-progress-bar + background: var(--color-back) + border-radius: none + + &::-webkit-progress-value + background: var(--color-theme) + border-radius: none + + &::-moz-progress-bar + background: var(--color-theme) diff --git a/western_ai/usa/spacy/website/src/styles/quickstart.module.sass b/western_ai/usa/spacy/website/src/styles/quickstart.module.sass new file mode 100644 index 0000000000000000000000000000000000000000..35f2ddae2b3ad291b64afdc9903071232e68c589 --- /dev/null +++ b/western_ai/usa/spacy/website/src/styles/quickstart.module.sass @@ -0,0 +1,215 @@ +@use 'sass:math' +@import base + +.root + font: var(--font-size-sm)/var(--line-height-sm) var(--font-primary) + margin-bottom: var(--spacing-md) + border-radius: var(--border-radius) + background: var(--color-subtle-light) + padding-top: 1rem + +.title + padding: 0 2rem + margin-bottom: 2rem + + a:before + content: "" + +.description + padding: 0 2rem + +.group + padding: 0.75rem 2rem 0 + border: none + +@include breakpoint(min, md) + .group + display: flex + flex-flow: row nowrap + +.input + // Hide inputs while keeping them focussable + opacity: 0 + width: 0 + height: 0 + position: absolute + left: -9999px + +.label + cursor: pointer + display: inline-block + padding: 0.35rem 0.5rem 0.25rem 0 + margin: 0 1rem 0.5rem 0 + font-size: var(--font-size-xs) + font-weight: bold + + &:hover + background: var(--color-subtle-light) + + .input:focus + border: 1px solid var(--color-theme-dark) + outline: none + + .radio + & + margin: 0 0 0.75rem 0 + border-radius: 0 + border-width: 1px 0 1px 1px + border-style: solid + border-color: var(--color-subtle) + background: var(--color-back) + padding: 0.65rem 1.25rem + + &:nth-child(2) // first child is checkbox + border-top-left-radius: var(--border-radius) + border-bottom-left-radius: var(--border-radius) + + &:nth-last-child(2) // last child is additional container + border-top-right-radius: var(--border-radius) + border-bottom-right-radius: var(--border-radius) + border-right-width: 1px + + .radio:checked + & + color: var(--color-back) + border-color: var(--color-theme-dark) + background: var(--color-theme-dark) + + .checkbox + &:before + $size: 18px + content: "" + display: inline-block + width: $size + height: $size + border: 1px solid var(--color-subtle) + vertical-align: middle + margin-right: 0.5rem + cursor: pointer + border-radius: math.div($size, 4) + background: var(--color-back) + position: relative + top: -1px + + .checkbox:checked + &:before + // Embed "check" icon here for simplicity + background: var(--color-theme-dark) url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij4gICAgPHBhdGggZmlsbD0iI2ZmZiIgZD0iTTkgMTYuMTcybDEwLjU5NC0xMC41OTQgMS40MDYgMS40MDYtMTIgMTItNS41NzgtNS41NzggMS40MDYtMS40MDZ6Ii8+PC9zdmc+) + background-size: contain + border-color: var(--color-theme-dark) + +.field-extra:not(:empty):not(:first-child) + margin-left: 1rem + +.legend + color: var(--color-dark) + padding: 0.75rem 0 + flex: 1 1 35% + font-weight: bold + +.fields + flex: 100% + +.select + cursor: pointer + border: 1px solid var(--color-subtle) + border-radius: var(--border-radius) + display: inline-block + padding: 0.35rem 1.25rem + margin: 0 1rem 0.75rem 0 + font-size: var(--font-size-sm) + background: var(--color-back) + +.select-hidden + display: none + +.text-input + border: 1px solid var(--color-subtle) + border-radius: var(--border-radius) + display: inline-block + padding: 0.35rem 0.75rem + font-size: var(--font-size-sm) + background: var(--color-back) + +.code + background: var(--color-front) + color: var(--color-back) + padding: 0.75em 0 + overflow: auto + width: 100% + max-width: 100% + margin: 1rem 0 0 + border-bottom-left-radius: var(--border-radius) + border-bottom-right-radius: var(--border-radius) + -webkit-font-smoothing: subpixel-antialiased + -moz-osx-font-smoothing: auto + position: relative + +.results + display: block + font: normal normal var(--font-size-lg)/var(--line-height-lg) var(--font-code) + line-height: 2 + padding: 1em 2em + + & > span + display: block + + a + text-decoration: underline + +.small + font-size: var(--font-size-code) + line-height: 1.65 + white-space: pre-wrap + max-height: 400px + overflow-y: auto + + & > span + display: inline + +.hide-prompts .prompt:before + content: initial !important + +.prompt:before + color: var(--color-theme-dark) + margin-right: 1em + +.bash:before + content: "$" + +.python:before + content: ">>>" + +.comment + color: var(--syntax-comment) + +.divider + padding: 1.5rem 0 + +.help + color: var(--color-subtle-dark) + + .input:checked + .label & + color: inherit + +.copy-area + width: 1px + height: 1px + opacity: 0 + position: absolute + +.menu + color: var(--color-subtle-on-dark) + padding-right: 1.5rem + display: inline-block + position: absolute + bottom: var(--spacing-xs) + right: 0 + +.icon-button + display: inline-block + color: inherit + cursor: pointer + transition: transform 0.05s ease + + &:not(:last-child) + margin-right: 1.5rem + + &:hover + transform: scale(1.1) diff --git a/western_ai/usa/spacy/website/src/styles/readnext.module.sass b/western_ai/usa/spacy/website/src/styles/readnext.module.sass new file mode 100644 index 0000000000000000000000000000000000000000..d917c6bc7cc40a3945b62718eed4b55b42c8cd21 --- /dev/null +++ b/western_ai/usa/spacy/website/src/styles/readnext.module.sass @@ -0,0 +1,21 @@ +.root + display: flex + justify-content: flex-end + align-items: center + text-align: right + font: var(--font-size-sm)/var(--line-height-md) var(--font-primary) + +.icon + $icon-size: 35px + width: $icon-size + height: $icon-size + background: var(--color-subtle-light) + color: var(--color-subtle-dark) + border-radius: 50% + padding: 0.5rem 0.65rem 0.5rem 0 + transition: color 0.2s ease + float: right + margin-left: 3rem + + &:hover + color: var(--color-theme-dark) diff --git a/western_ai/usa/spacy/website/src/styles/search.sass b/western_ai/usa/spacy/website/src/styles/search.sass new file mode 100644 index 0000000000000000000000000000000000000000..40fdc314e7f6a338ed2e0e5356c930a40eff6c6b --- /dev/null +++ b/western_ai/usa/spacy/website/src/styles/search.sass @@ -0,0 +1,27 @@ +@import base + +.DocSearch-Modal + --docsearch-primary-color: var(--color-theme-dark) + --docsearch-searchbox-background: var(--color-back) + --docsearch-searchbox-shadow: inset 0 0 0 2px var(--docsearch-primary-color) + --docsearch-highlight-color: var(--docsearch-primary-color) + --docsearch-logo-color: var(--docsearch-primary-color) + + box-shadow: inset 0 0 0 1px var(--color-subtle) + +.DocSearch, .DocSearch-Modal, .DocSearch-Help, .DocSearch-Input, .DocSearch-Hit-title, .DocSearch-Hit-path + font-family: var(--font-primary) + font-size: var(--font-size-md) !important + font-weight: 400 + +.DocSearch-Hits mark + background: var(--docsearch-highlight-color) !important + color: var(--color-back) !important + +.DocSearch-Hit-source + font-size: var(--font-size-lg) !important + font-family: var(--font-secondary) + text-transform: uppercase + +.cls-1, .cls-2 + fill: var(--docsearch-primary-color) !important diff --git a/western_ai/usa/spacy/website/src/styles/section.module.sass b/western_ai/usa/spacy/website/src/styles/section.module.sass new file mode 100644 index 0000000000000000000000000000000000000000..60c00bc4f73616e471553b222ad04003c8aaa18c --- /dev/null +++ b/western_ai/usa/spacy/website/src/styles/section.module.sass @@ -0,0 +1,9 @@ +.root + &:not(:last-child):not(:last-of-type) + margin-bottom: var(--spacing-md) + padding-bottom: var(--spacing-md) + border-bottom: 1px dotted var(--color-subtle) + +.hr + border: 0 + padding: var(--spacing-sm) 0 diff --git a/western_ai/usa/spacy/website/src/styles/sidebar.module.sass b/western_ai/usa/spacy/website/src/styles/sidebar.module.sass new file mode 100644 index 0000000000000000000000000000000000000000..8cf6e49e835c9a4d0ffffadddeeb11bb45f4698e --- /dev/null +++ b/western_ai/usa/spacy/website/src/styles/sidebar.module.sass @@ -0,0 +1,125 @@ +@use 'sass:math' +@import base + +$crumb-bullet: 14px +$crumb-bar: 2px + +.root + overflow-y: auto + font: var(--font-size-md)/var(--line-height-md) var(--font-primary) + +.dropdown + padding: 1rem 0 + border-bottom: 1px solid var(--color-subtle) + width: 100% + +.dropdown-select + width: 100% + padding-left: 1rem + +.section + margin-bottom: var(--spacing-sm) + + & > * + padding: 0 2rem 0.35rem + + &:last-child + margin-bottom: 5rem + +.label + color: var(--color-dark) + font: bold var(--font-size-lg)/var(--line-height-md) var(--font-secondary) + text-transform: uppercase + +.item + color: var(--color-theme-dark) + + &:hover + color: var(--color-front) + +.link + border: none + +.is-active + font-weight: bold + color: var(--color-dark) + margin-top: 1rem + pointer-events: none + + &:hover + color: var(--color-dark) + +.active-heading + display: none + +.crumbs + display: block + padding-top: 1rem + padding-left: 1rem + position: relative + +.crumb + margin-bottom: math.div($crumb-bullet, 2) + position: relative + padding-left: 2rem + color: var(--color-theme-dark) + font-size: 1.2rem + + &:hover + color: var(--color-front) + + &:after + width: $crumb-bullet + height: $crumb-bullet + position: absolute + top: math.div($crumb-bullet, 4) + left: 0 + content: "" + border-radius: 50% + background: var(--color-theme) + z-index: 10 + + &:not(:last-child):before + width: $crumb-bar + height: 100% + position: absolute + top: $crumb-bullet + left: math.div(($crumb-bullet - $crumb-bar), 2) + content: "" + background: var(--color-subtle) + + &:first-child:before + height: calc(100% + #{$crumb-bullet * 2}) + top: math.div(-$crumb-bullet, 2) + +.crumb-active + color: var(--color-dark) + + &:after + background: var(--color-dark) + +@include breakpoint(min, md) + .root + @include scroll-shadow(var(--color-back), var(--color-shadow), var(--height-nav)) + position: fixed + top: 0 + left: 0 + width: var(--width-sidebar) + height: calc(100vh - 3px) + flex: 0 0 var(--width-sidebar) + padding-top: calc(var(--height-nav) + 1.5rem) + z-index: 10 + padding-bottom: 5rem + + .dropdown + display: none + +@include breakpoint(max, sm) + .root + flex: 100% + width: 100% + margin-top: var(--height-nav) + display: block + + .section + display: none diff --git a/western_ai/usa/spacy/website/src/styles/table.module.sass b/western_ai/usa/spacy/website/src/styles/table.module.sass new file mode 100644 index 0000000000000000000000000000000000000000..05e02efc4334027bfbb07ba4665239086cc7bf1e --- /dev/null +++ b/western_ai/usa/spacy/website/src/styles/table.module.sass @@ -0,0 +1,143 @@ +@import base + +.root + vertical-align: top + font: var(--font-size-md)/var(--line-height-md) var(--font-primary) + margin-bottom: var(--spacing-md) + max-width: 100% + +figure > .root + margin-bottom: var(--spacing-sm) + +.fixed + table-layout: fixed + +.tr + thead &:nth-child(odd) + background: transparent + + &:nth-child(odd) + background: var(--color-subtle-opaque) + +.footer + --color-inline-code-bg: var(--color-theme-opaque) + background: var(--color-theme-light) !important + border-top: 2px solid var(--color-theme-dark) + + & > td:first-child + font-family: var(--font-secondary) + color: var(--color-theme-dark) + + & > td:nth-child(2) a + border: 0 + +.td + padding: 0.9rem 1rem + font-size: 95% + + &:not(:last-child) + border-right: 1px solid var(--color-subtle) + +.num + font-feature-settings: "tnum" + font-variant-numeric: tabular-nums + + & > strong + font-feature-settings: initial + font-variant-numeric: initial + +.nowrap + white-space: nowrap + +.th + font: bold var(--font-size-md)/var(--line-height-md) var(--font-secondary) + text-transform: uppercase + color: var(--color-theme-dark) + padding: 1rem 0.5rem + border-bottom: 2px solid var(--color-theme-dark) + vertical-align: bottom + +.th-rotated + height: 100px + +.tx + transform: translate(15px, 0) rotate(315deg) // 45 = 360 - 45 + width: 30px + white-space: nowrap + + & > span + padding-left: 0.5rem + + [data-tooltip] + display: inline-block + transform: rotate(-316deg) + +.divider + height: 0 + border-bottom: 1px solid var(--color-subtle) + + td + top: -1px + height: 0 + position: relative + padding: 0 !important + + & + tr td + padding-top: 12px + + td em + position: absolute + top: -5px + left: 10px + display: inline-block + background: var(--color-theme-dark) + color: var(--color-back) + padding: 0 5px 1px + font-size: 0.85rem + text-transform: uppercase + font-weight: bold + border: 0 + border-radius: 1em + font-style: normal + white-space: nowrap + z-index: 5 + + &:first-child // directly after thead/tr + border-bottom: 0 + + td em + top: -7px + + +// Responsive table +// Shadows adapted from "CSS only Responsive Tables" by David Bushell +// http://codepen.io/dbushell/pen/wGaamR + +@include breakpoint(max, md) + .root + @include scroll-shadow-base(var(--color-shadow)) + display: inline-block + overflow-x: auto + overflow-y: hidden + width: auto + -webkit-overflow-scrolling: touch + + .th, .td + &:first-child + @include scroll-shadow-cover(left, var(--color-back)) + + &:last-child + @include scroll-shadow-cover(right, var(--color-back)) + + &:first-child:last-child + @include scroll-shadow-cover(both, var(--color-back)) + + .footer .td + &:first-child + @include scroll-shadow-cover(left, var(--color-subtle-light)) + + &:last-child + @include scroll-shadow-cover(right, var(--color-subtle-light)) + + &:first-child:last-child + @include scroll-shadow-cover(both, var(--color-subtle-light)) diff --git a/western_ai/usa/spacy/website/src/styles/tag.module.sass b/western_ai/usa/spacy/website/src/styles/tag.module.sass new file mode 100644 index 0000000000000000000000000000000000000000..00d820232aa3dd216c7ddeab17af278e17b44d21 --- /dev/null +++ b/western_ai/usa/spacy/website/src/styles/tag.module.sass @@ -0,0 +1,16 @@ +.root + display: inline-block + font: bold var(--font-size-xs)/#{1} var(--font-secondary) + background: var(--color-theme-dark) + color: var(--color-back) + padding: 2px 6px 4px + border-radius: 1em + text-transform: uppercase + vertical-align: middle + +.spaced + margin-left: 0.75em + margin-right: 0.5em + +.icon + margin-left: 0.5em diff --git a/western_ai/usa/spacy/website/src/styles/title.module.sass b/western_ai/usa/spacy/website/src/styles/title.module.sass new file mode 100644 index 0000000000000000000000000000000000000000..78c96e64d893b4966ef11c488cf99f21dd3c46f5 --- /dev/null +++ b/western_ai/usa/spacy/website/src/styles/title.module.sass @@ -0,0 +1,49 @@ +.root + margin-bottom: var(--spacing-md) + + &:after + content: "" + display: block + width: 10% + min-width: 6rem + height: 6px + background: var(--color-theme) + margin-top: 3rem + +.h1 + padding-top: 0 !important + display: inline + margin-bottom: 0.5em + vertical-align: middle + + &[id]:target + padding-top: 0 !important + +.teaser + font: normal var(--font-size-sm)/var(--line-height-md) var(--font-primary) + color: var(--color-dark) + margin-bottom: var(--spacing-sm) + margin-top: var(--spacing-sm) + +.image + $image-size: 100px + width: $image-size + height: $image-size + overflow: hidden + border-radius: 50% + +.corner + float: right + +.label + display: inline + margin-right: var(--spacing-xs) + +.meta-icon + position: relative + top: -2px + +.tags + display: inline-block + position: relative + top: 0.5rem diff --git a/western_ai/usa/spacy/website/src/styles/typography.module.sass b/western_ai/usa/spacy/website/src/styles/typography.module.sass new file mode 100644 index 0000000000000000000000000000000000000000..619c7cadb65d99e722897561f7a0fdbe13460cba --- /dev/null +++ b/western_ai/usa/spacy/website/src/styles/typography.module.sass @@ -0,0 +1,92 @@ +@import base + +.heading + margin-bottom: 1em + + &:not(:first-child) + padding-top: 0.5em + +@include breakpoint(max, md) + .heading + word-wrap: break-word + +@each $level, $size in (1: 4.4, 2: 3.4, 3: 2.6, 4: 2.2, 5: 1.8) + .h#{$level} + font: normal 500 #{$size}rem/#{1.1} var(--font-secondary) + +.permalink + position: relative + + &:before + content: "\00b6" + font-size: 0.9em + font-weight: normal + color: var(--color-subtle-dark) + position: absolute + top: 0.15em + left: -2.85rem + opacity: 0 + transition: opacity 0.2s ease + + &:hover:before + opacity: 1 + + &:active:before + color: var(--color-theme-dark) + + &:target + display: inline-block + + &:before + bottom: 0.15em + top: initial + +@include breakpoint(min, md) + .abbr + cursor: help + border-bottom: 1px dotted var(--color-subtle-dark) + +@supports(text-decoration: underline dotted) + .abbr + text-decoration: underline dotted var(--color-subtle-dark) + border-bottom: none + +@include breakpoint(max, sm) + .abbr:after + content: " (" attr(aria-label) ")" + color: var(--color-subtle-dark) + text-decoration: none + +.label + display: block + font: bold var(--font-size-lg)/var(--line-height-md) var(--font-secondary) + text-transform: uppercase + color: var(--color-dark) + +.inline-list + & > * + display: inline + + &:not(:last-child) + margin-right: 2rem + +.no-gutter + margin-bottom: 0 !important + +.clear:after + content: "" + clear: both + display: table + +.action + font: var(--font-size-xs)/var(--line-height-sm) var(--font-primary) + color: var(--color-subtle-dark) + float: right + max-width: 33% + text-align: right + position: relative + top: 0.4rem + margin-right: 1rem + +.help + color: var(--color-dark) diff --git a/western_ai/usa/spacy/website/src/templates/docs.js b/western_ai/usa/spacy/website/src/templates/docs.js new file mode 100644 index 0000000000000000000000000000000000000000..891b5dc8a1b9b3092513c88f95735d6fefcb5d32 --- /dev/null +++ b/western_ai/usa/spacy/website/src/templates/docs.js @@ -0,0 +1,123 @@ +import React from 'react' +import PropTypes from 'prop-types' + +import Models from './models' + +import ReadNext from '../components/readnext' +import Button from '../components/button' +import Grid from '../components/grid' +import Title from '../components/title' +import Footer from '../components/footer' +import Sidebar from '../components/sidebar' +import Main from '../components/main' +import { getCurrentSource, github } from '../components/util' + +import siteMetadata from '../../meta/site.json' +import sidebars from '../../meta/sidebars.json' +import { nightly, legacy } from '../../meta/dynamicMeta.mjs' +import { languagesSorted } from '../../meta/languageSorted' + +const Docs = ({ pageContext, children }) => { + const { + id, + slug, + title, + section, + teaser, + source, + tag, + isIndex, + next, + menu, + theme, + version, + apiDetails, + } = pageContext + const { modelsRepo } = siteMetadata + const isModels = section === 'models' + const sidebar = pageContext.sidebar + ? { items: pageContext.sidebar } + : sidebars.find((bar) => bar.section === section) + let pageMenu = menu ? menu.map(([text, id]) => ({ text, id })) : [] + + if (isModels) { + sidebar.items[1].items = languagesSorted.map((lang) => ({ + text: lang.name, + url: `/models/${lang.code}`, + isActive: id === lang.code, + menu: lang.models.map((model) => ({ + text: model, + id: model, + })), + })) + } + const sourcePath = source ? github(source) : null + const currentSource = getCurrentSource(slug, isIndex) + + const subFooter = ( + +
+ {(!isModels || (isModels && isIndex)) && ( + + )} +
+ {next && } +
+ ) + + return ( + <> + {sidebar && } +
} + > + {isModels && !isIndex ? ( + + {subFooter} + + ) : ( + <> + + {children} + {subFooter} + </> + )} + </Main> + </> + ) +} + +Docs.propTypes = { + pageContext: PropTypes.shape({ + slug: PropTypes.string.isRequired, + title: PropTypes.string.isRequired, + section: PropTypes.string, + teaser: PropTypes.string, + source: PropTypes.string, + tag: PropTypes.string, + isIndex: PropTypes.bool, + next: PropTypes.shape({ + title: PropTypes.string.isRequired, + slug: PropTypes.string.isRequired, + }), + menu: PropTypes.arrayOf(PropTypes.arrayOf(PropTypes.string)), + theme: PropTypes.string, + }), +} + +export default Docs diff --git a/western_ai/usa/spacy/website/src/templates/index.js b/western_ai/usa/spacy/website/src/templates/index.js new file mode 100644 index 0000000000000000000000000000000000000000..e18e571e5cae8110b0200104c1c1e32d68941b2f --- /dev/null +++ b/western_ai/usa/spacy/website/src/templates/index.js @@ -0,0 +1,138 @@ +import React from 'react' +import PropTypes from 'prop-types' +import useOnlineStatus from '@rehooks/online-status' +import classNames from 'classnames' + +// Templates +import Docs from './docs' +import Universe from './universe' + +// Components +import Navigation from '../components/navigation' +import Progress from '../components/progress' +import Footer from '../components/footer' +import SEO from '../components/seo' +import Link from '../components/link' +import { InlineCode } from '../components/inlineCode' +import Alert from '../components/alert' +import Search from '../components/search' + +import siteMetadata from '../../meta/site.json' +import { nightly, legacy } from '../../meta/dynamicMeta.mjs' +import { remarkComponents } from '../remark' + +const AlertSpace = ({ nightly, legacy }) => { + const isOnline = useOnlineStatus() + return ( + <> + {nightly && ( + <Alert + title="You're viewing the pre-release docs." + icon="moon" + closeOnClick={false} + > + The page reflects{' '} + <Link to="https://pypi.org/project/spacy-nightly/"> + <InlineCode>spacy-nightly</InlineCode> + </Link> + , not the latest <Link to="https://spacy.io">stable version</Link>. + </Alert> + )} + {legacy && ( + <Alert + title="You're viewing the old documentation" + icon="warning" + closeOnClick={false} + > + The page reflects an older version of spaCy, not the latest{' '} + <Link to="https://spacy.io">stable release</Link>. + </Alert> + )} + {!isOnline && ( + <Alert title="Looks like you're offline." icon="offline" variant="warning"> + But don't worry, your visited pages should be saved for you. + </Alert> + )} + </> + ) +} + +const navAlert = ( + <Link to="https://beta.ellf.ai" noLinkLayout> + 💥 Beta test our new tool for <strong>agentic NLP development</strong>! + </Link> +) + +class Layout extends React.Component { + static defaultProps = { + scope: {}, + } + + static propTypes = { + scope: PropTypes.object.isRequired, + pageContext: PropTypes.shape({ + title: PropTypes.string, + section: PropTypes.string, + teaser: PropTypes.string, + source: PropTypes.string, + isIndex: PropTypes.bool.isRequired, + theme: PropTypes.string, + searchExclude: PropTypes.bool, + next: PropTypes.shape({ + title: PropTypes.string.isRequired, + slug: PropTypes.string.isRequired, + }), + }), + children: PropTypes.node, + } + + constructor(props) { + super(props) + // NB: Compiling the scope here instead of in render() is super + // important! Otherwise, it triggers unnecessary rerenders of ALL + // consumers (e.g. mdx elements), even on anchor navigation! + this.state = { scope: { ...remarkComponents, ...props.scope } } + } + + render() { + const { location, children } = this.props + const { title, section, sectionTitle, teaser, theme, searchExclude } = this.props + const uiTheme = nightly ? 'nightly' : legacy ? 'legacy' : theme ?? 'blue' + const bodyClass = classNames(`theme-${uiTheme}`, { 'search-exclude': !!searchExclude }) + const isDocs = ['usage', 'models', 'api', 'styleguide'].includes(section) + + return ( + <div className={bodyClass}> + <SEO + title={title} + description={teaser || siteMetadata.description} + section={section} + sectionTitle={sectionTitle} + nightly={nightly} + /> + <AlertSpace nightly={nightly} legacy={legacy} /> + <Navigation + title={siteMetadata.title} + items={siteMetadata.navigation} + section={section} + search={<Search />} + alert={nightly ? null : navAlert} + > + <Progress /> + </Navigation> + {isDocs ? ( + <Docs pageContext={this.props}>{children}</Docs> + ) : section === 'universe' ? ( + <Universe pageContext={this.props} location={location} /> + ) : ( + <div> + {children} + <Footer wide /> + </div> + )} + </div> + ) + } +} + +export default Layout diff --git a/western_ai/usa/spacy/website/src/templates/models.js b/western_ai/usa/spacy/website/src/templates/models.js new file mode 100644 index 0000000000000000000000000000000000000000..58631206758b911d0f78a220044bf3f3ec3e7013 --- /dev/null +++ b/western_ai/usa/spacy/website/src/templates/models.js @@ -0,0 +1,440 @@ +import React, { useEffect, useState, useMemo, Fragment } from 'react' +import { window } from 'browser-monads' + +import Title from '../components/title' +import Section from '../components/section' +import Button from '../components/button' +import Aside from '../components/aside' +import { InlineCode } from '../components/inlineCode' +import CodeBlock from '../components/codeBlock' +import { Table, Tr, Td, Th } from '../components/table' +import Tag from '../components/tag' +import { H2, Label } from '../components/typography' +import Icon from '../components/icon' +import Link, { OptionalLink } from '../components/link' +import Infobox from '../components/infobox' +import Accordion from '../components/accordion' +import { isString, isEmptyObj, join, arrayToObj, abbrNum } from '../components/util' +import MarkdownToReact from '../components/markdownToReactDynamic' + +import siteMetadata from '../../meta/site.json' +import languages from '../../meta/languages.json' + +const COMPONENT_LINKS = { + tok2vec: '/api/tok2vec', + transformer: '/api/transformer', + tagger: '/api/tagger', + parser: '/api/dependencyparser', + ner: '/api/entityrecognizer', + lemmatizer: '/api/lemmatizer', + attribute_ruler: '/api/attributeruler', + senter: '/api/sentencerecognizer', + morphologizer: '/api/morphologizer', +} + +const MODEL_META = { + core: 'Vocabulary, syntax, entities, vectors', + core_no_vectors: 'Vocabulary, syntax, entities', + dep: 'Vocabulary, syntax', + ent: 'Named entities', + sent: 'Sentence boundaries', + pytt: 'PyTorch Transformers', + trf: 'Transformers', + vectors: 'Word vectors', + web: 'written text (blogs, news, comments)', + news: 'written text (news, media)', + wiki: 'Wikipedia', + uas: 'Unlabeled dependencies', + las: 'Labeled dependencies', + dep_uas: 'Unlabeled dependencies', + dep_las: 'Labeled dependencies', + token_acc: 'Tokenization', + tok: 'Tokenization', + lemma: 'Lemmatization', + morph: 'Morphological analysis', + lemma_acc: 'Lemmatization', + morph_acc: 'Morphological analysis', + tags_acc: 'Part-of-speech tags (fine grained tags, Token.tag)', + tag_acc: 'Part-of-speech tags (fine grained tags, Token.tag)', + tag: 'Part-of-speech tags (fine grained tags, Token.tag)', + pos: 'Part-of-speech tags (coarse grained tags, Token.pos)', + pos_acc: 'Part-of-speech tags (coarse grained tags, Token.pos)', + ents_f: 'Named entities (F-score)', + ents_p: 'Named entities (precision)', + ents_r: 'Named entities (recall)', + ner_f: 'Named entities (F-score)', + ner_p: 'Named entities (precision)', + ner_r: 'Named entities (recall)', + sents_f: 'Sentence segmentation (F-score)', + sents_p: 'Sentence segmentation (precision)', + sents_r: 'Sentence segmentation (recall)', + cpu: 'words per second on CPU', + gpu: 'words per second on GPU', + pipeline: 'Active processing pipeline components in order', + components: 'All processing pipeline components (including disabled components)', + sources: 'Sources of training data', + vecs: 'Word vectors included in the package. Packages that only support context vectors compute similarity via the tensors shared with the pipeline.', + benchmark_parser: 'Syntax accuracy', + benchmark_ner: 'NER accuracy', + benchmark_speed: 'Speed', + compat: 'Latest compatible package version for your spaCy installation', + download_link: 'Download link for the pipeline', +} + +const LABEL_SCHEME_META = { + tagger: 'Part-of-speech tags via Token.tag_', + parser: 'Dependency labels via Token.dep_', + ner: 'Named entity labels', +} + +const MARKDOWN_COMPONENTS = { + code: InlineCode, +} + +function getModelComponents(name) { + const [lang, type, genre, size] = name.split('_') + return { lang, type, genre, size } +} + +function isStableVersion(v) { + return !v.includes('a') && !v.includes('b') && !v.includes('dev') && !v.includes('rc') +} + +function getLatestVersion(modelId, compatibility, prereleases) { + for (let [version, models] of Object.entries(compatibility)) { + if (isStableVersion(version) && models[modelId]) { + const modelVersions = models[modelId] + for (let modelVersion of modelVersions) { + if (isStableVersion(modelVersion) || prereleases) { + return modelVersion + } + } + } + } +} + +function formatVectors(data) { + if (!data) return 'n/a' + if (Object.values(data).every((n) => n === 0)) return 'context vectors only' + const { keys, vectors, width } = data + if (keys >= 0) { + return `${abbrNum(keys)} keys, ${abbrNum(vectors)} unique vectors (${width} dimensions)` + } else { + return `${abbrNum(vectors)} floret vectors (${width} dimensions)` + } +} + +function formatAccuracy(data, lang) { + const exclude = lang !== 'ja' ? ['speed'] : ['speed', 'morph_acc'] + if (!data) return [] + return Object.keys(data) + .map((label) => { + const value = data[label] + return isNaN(value) || exclude.includes(label) + ? null + : { + label, + value: value.toFixed(2), + help: MODEL_META[label], + } + }) + .filter((item) => item) +} + +function formatDownloadLink(lang, name, version) { + const fullName = `${lang}_${name}-${version}` + const filename = `${fullName}-py3-none-any.whl` + const url = `https://github.com/explosion/spacy-models/releases/download/${fullName}/${filename}` + return ( + <Link to={url} hideIcon> + {filename} + </Link> + ) +} + +function formatModelMeta(data) { + return { + fullName: `${data.lang}_${data.name}-${data.version}`, + version: data.version, + sizeFull: data.size, + pipeline: data.pipeline, + components: data.components, + notes: data.notes, + description: data.description, + sources: data.sources, + author: data.author, + url: data.url, + license: data.license, + labels: isEmptyObj(data.labels) ? null : data.labels, + vectors: formatVectors(data.vectors), + accuracy: formatAccuracy(data.performance, data.lang), + download_link: formatDownloadLink(data.lang, data.name, data.version), + } +} + +function formatSources(data = []) { + const sources = data.map((s) => (isString(s) ? { name: s } : s)) + return sources.map(({ name, url, author }, i) => ( + <Fragment key={i}> + {i > 0 && <br />} + {name && url ? <Link to={url}>{name}</Link> : name} + {author && ` (${author})`} + </Fragment> + )) +} + +function linkComponents(components = []) { + return join( + components.map((c) => ( + <Fragment key={c}> + <OptionalLink to={COMPONENT_LINKS[c]} hideIcon> + <InlineCode>{c}</InlineCode> + </OptionalLink> + </Fragment> + )) + ) +} + +const Help = ({ children }) => ( + <span data-tooltip={children}> + <Icon name="help2" width={16} variant="subtle" inline /> + </span> +) + +const Model = ({ + name, + langId, + langName, + baseUrl, + repo, + compatibility, + hasExamples, + licenses, + prereleases, +}) => { + const [initialized, setInitialized] = useState(false) + const [isError, setIsError] = useState(true) + const [meta, setMeta] = useState({}) + const { type, genre, size } = getModelComponents(name) + const display_type = + type === 'core' && (size === 'sm' || size === 'trf') ? 'core_no_vectors' : type + const version = useMemo( + () => getLatestVersion(name, compatibility, prereleases), + [name, compatibility, prereleases] + ) + + useEffect(() => { + window.dispatchEvent(new Event('resize')) // scroll position for progress + if (!initialized && version) { + setIsError(false) + fetch(`${baseUrl}/meta/${name}-${version}.json`) + .then((res) => res.json()) + .then((json) => { + setMeta(formatModelMeta(json)) + }) + .catch((err) => { + setIsError(true) + console.error(err) + }) + setInitialized(true) + } + }, [initialized, version, baseUrl, name]) + + const releaseTag = meta.fullName ? `tag/${meta.fullName}` : '' + const releaseUrl = `https://github.com/${repo}/releases/${releaseTag}` + const pipeline = linkComponents(meta.pipeline) + const components = linkComponents(meta.components) + const sources = formatSources(meta.sources) + const author = !meta.url ? meta.author : <Link to={meta.url}>{meta.author}</Link> + const licenseUrl = licenses[meta.license] ? licenses[meta.license].url : null + const license = licenseUrl ? <Link to={licenseUrl}>{meta.license}</Link> : meta.license + const hasInteractiveCode = size === 'sm' && hasExamples && !isError + const labels = meta.labels + + const rows = [ + { label: 'Language', tag: langId, content: langName }, + { label: 'Type', tag: type, content: MODEL_META[display_type] }, + { label: 'Genre', tag: genre, content: MODEL_META[genre] }, + { label: 'Size', tag: size, content: meta.sizeFull }, + { label: 'Components', content: components, help: MODEL_META.components }, + { label: 'Pipeline', content: pipeline, help: MODEL_META.pipeline }, + { label: 'Vectors', content: meta.vectors, help: MODEL_META.vecs }, + { label: 'Download Link', content: meta.download_link, help: MODEL_META.download_link }, + { label: 'Sources', content: sources, help: MODEL_META.sources }, + { label: 'Author', content: author }, + { label: 'License', content: license }, + ] + + const error = ( + <Infobox title="Unable to load model details from GitHub" variant="danger"> + <p> + To find out more about this model, see the overview of the{' '} + <Link to={`https://github.com/${repo}/releases`} ws hideIcon> + latest model releases. + </Link> + </p> + </Infobox> + ) + return ( + <Section id={name}> + <H2 + id={name} + action={ + <> + <Button to={releaseUrl}>Release Details</Button> + {version && ( + <div> + Latest: <InlineCode>{version}</InlineCode> + </div> + )} + </> + } + > + {name} + </H2> + <Aside title="Installation"> + <CodeBlock lang="bash" prompt="$"> + $ python -m spacy download {name} + </CodeBlock> + </Aside> + {meta.description && <MarkdownToReact markdown={meta.description} />} + {isError && error} + <Table> + <tbody> + {rows.map(({ label, tag, help, content }, i) => + !tag && !content ? null : ( + <Tr key={i}> + <Td nowrap> + <Label> + {`${label} `} + {help && <Help>{help}</Help>} + </Label> + </Td> + <Td> + {tag && <Tag spaced>{tag}</Tag>} + {content} + </Td> + </Tr> + ) + )} + </tbody> + </Table> + {meta.notes && <MarkdownToReact markdown={meta.notes} />} + {hasInteractiveCode && ( + <CodeBlock title="Try out the model" lang="python" executable={true}> + {[ + `import spacy`, + `from spacy.lang.${langId}.examples import sentences `, + ``, + `nlp = spacy.load("${name}")`, + `doc = nlp(sentences[0])`, + `print(doc.text)`, + `for token in doc:`, + ` print(token.text, token.pos_, token.dep_)`, + ].join('\n')} + </CodeBlock> + )} + {meta.accuracy && ( + <Accordion id={`${name}-accuracy`} title="Accuracy Evaluation"> + <Table> + <tbody> + {meta.accuracy.map(({ label, value, help }) => ( + <Tr key={`${name}-${label}`}> + <Td nowrap> + <InlineCode>{label.toUpperCase()}</InlineCode> + </Td> + <Td>{help}</Td> + <Td num style={{ textAlign: 'right' }}> + {value} + </Td> + </Tr> + ))} + </tbody> + </Table> + </Accordion> + )} + {labels && ( + <Accordion id={`${name}-labels`} title="Label Scheme"> + <p> + The statistical components included in this model package assign the + following labels. The labels are specific to the corpus that the model was + trained on. To see the description of a label, you can use{' '} + <Link to="/api/top-level#spacy.explain"> + <InlineCode>spacy.explain</InlineCode> + </Link> + . + </p> + <Table fixed> + <tbody> + {Object.keys(labels).map((pipe) => { + const labelNames = labels[pipe] || [] + const help = LABEL_SCHEME_META[pipe] + return ( + <Tr evenodd={false} key={pipe}> + <Td style={{ width: '20%' }}> + <Label> + {pipe} {help && <Help>{help}</Help>} + </Label> + </Td> + <Td> + {labelNames.map((label, i) => ( + <Fragment key={i}> + {i > 0 && ', '} + <InlineCode wrap key={label}> + {label} + </InlineCode> + </Fragment> + ))} + </Td> + </Tr> + ) + })} + </tbody> + </Table> + </Accordion> + )} + </Section> + ) +} + +const Models = ({ pageContext, repo, children }) => { + const [initialized, setInitialized] = useState(false) + const [compatibility, setCompatibility] = useState({}) + const { id, title, meta } = pageContext + const { models } = meta + const baseUrl = `https://raw.githubusercontent.com/${repo}/master` + + useEffect(() => { + window.dispatchEvent(new Event('resize')) // scroll position for progress + if (!initialized) { + fetch(`${baseUrl}/compatibility.json`) + .then((res) => res.json()) + .then(({ spacy }) => setCompatibility(spacy)) + .catch((err) => console.error(err)) + setInitialized(true) + } + }, [initialized, baseUrl]) + + return ( + <> + <Title title={title} teaser={`Available trained pipelines for ${title}`} /> + {models.map((modelName) => ( + <Model + key={modelName} + name={modelName} + langId={id} + langName={title} + compatibility={compatibility} + baseUrl={baseUrl} + repo={repo} + licenses={arrayToObj(languages.licenses, 'id')} + hasExamples={meta.hasExamples} + prereleases={siteMetadata.nightly} + /> + ))} + {children} + </> + ) +} + +export default Models diff --git a/western_ai/usa/spacy/website/src/templates/universe.js b/western_ai/usa/spacy/website/src/templates/universe.js new file mode 100644 index 0000000000000000000000000000000000000000..618b198dc9c70e16bf3c6b099a8a91c129fbfb98 --- /dev/null +++ b/western_ai/usa/spacy/website/src/templates/universe.js @@ -0,0 +1,369 @@ +import React from 'react' +import PropTypes from 'prop-types' + +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 Tag from '../components/tag' +import { InlineCode } from '../components/inlineCode' +import CodeBlock from '../components/codeBlock' +import Aside from '../components/aside' +import Sidebar from '../components/sidebar' +import Section, { Hr } 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 } from '../components/util' +import MarkdownToReact from '../components/markdownToReactDynamic' + +import { nightly, legacy } from '../../meta/dynamicMeta.mjs' +import universe from '../../meta/universe.json' +import Image from 'next/image' + +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, theme, pageContext, mdxComponents }) => { + const { data = {} } = pageContext + const filteredResources = filterResources(content, data) + const activeData = data ? content.find(({ id }) => id === data.id) : null + const markdownComponents = { ...mdxComponents, code: InlineCode } + const slug = pageContext.slug + 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 ( + <> + <Sidebar items={sidebar} slug={slug} /> + <Main section="universe" theme={theme} sidebar asides wrapContent footer={<Footer />}> + {activeData ? ( + <Project data={activeData} components={markdownComponents} /> + ) : ( + <Section> + {isHome ? ( + <Title + title="Universe" + teaser="This section collects the many great resources developed with or for spaCy. It includes standalone packages, plugins, extensions, educational materials, operational utilities and bindings for other languages." + /> + ) : ( + <Title + title={data.title} + teaser={data.description} + tag={String(filteredResources.length)} + /> + )} + <Grid + cols={data && data.isCategory && data.id === 'books' ? 3 : 2} + className="search-exclude" + > + {filteredResources.map( + ({ id, type, title, slogan, thumb, cover, youtube }) => { + if (isHome && type === 'education') { + return null + } + const url = `/universe/project/${id}` + const header = youtube && ( + <Image + src={`https://img.youtube.com/vi/${youtube}/0.jpg`} + alt={title} + width="480" + height="360" + style={{ + clipPath: 'inset(12.9% 0)', + marginBottom: 'calc(-12.9% + 1rem)', + }} + /> + ) + return cover ? ( + <p key={id}> + <Link key={id} to={url} noLinkLayout> + {/* eslint-disable-next-line @next/next/no-img-element */} + <img src={cover} alt={title || id} /> + </Link> + </p> + ) : data.id === 'videos' ? ( + <div> + <Link key={id} to={url} noLinkLayout> + {header} + <H5>{title}</H5> + </Link> + </div> + ) : ( + <Card + key={id} + title={title || id} + image={thumb} + to={url} + header={header} + > + {slogan} + </Card> + ) + } + )} + </Grid> + </Section> + )} + <section className="search-exclude"> + <H3>Found a mistake or something isn't working?</H3> + <p> + If you've come across a universe project that isn't working or is + incompatible with the reported spaCy version, let us know by{' '} + <Link to="https://github.com/explosion/spaCy/discussions/new"> + opening a discussion thread + </Link> + . + </p> + </section> + <Hr /> + <section className="search-exclude"> + <H3>Submit your project</H3> + <p> + 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 + <Link + to={ + 'https://github.com/explosion/spaCy/discussions/categories/new-features-project-ideas/' + } + hideIcon + ws + > + project idea + </Link> + section in Discussions. + </p> + + <InlineList> + <Button variant="primary" to={github('website/UNIVERSE.md')}> + Read the docs + </Button> + <Button icon="code" to={github('website/meta/universe.json')}> + JSON source + </Button> + </InlineList> + </section> + </Main> + </> + ) +} + +UniverseContent.propTypes = { + content: PropTypes.arrayOf(PropTypes.object), + categories: PropTypes.arrayOf( + PropTypes.shape({ + label: PropTypes.string.isRequired, + items: PropTypes.arrayOf( + PropTypes.shape({ + id: PropTypes.string.isRequired, + title: PropTypes.string.isRequired, + description: PropTypes.string.isRequired, + }) + ).isRequired, + }) + ).isRequired, + theme: PropTypes.string, + location: PropTypes.object.isRequired, + mdxComponents: PropTypes.object, +} + +const SpaCyVersion = ({ version }) => { + const versions = !Array.isArray(version) ? [version] : version + return versions.map((v, i) => ( + <> + <Tag tooltip={`This project is compatible with spaCy v${v}`}>spaCy v{v}</Tag>{' '} + </> + )) +} + +const ImageGitHub = ({ url, isRounded, title }) => ( + // eslint-disable-next-line @next/next/no-img-element + <img + style={{ + borderRadius: isRounded ? '1em' : 0, + marginRight: '0.5rem', + verticalAlign: 'middle', + }} + src={`https://img.shields.io/github/${url}`} + alt={`${title} on GitHub`} + /> +) + +const Project = ({ data, components }) => ( + <> + <Title title={data.title || data.id} teaser={data.slogan} image={data.thumb}> + {(data.github || data.spacy_version) && ( + <p> + {data.spacy_version && <SpaCyVersion version={data.spacy_version} />} + {data.github && ( + <Link to={`https://github.com/${data.github}`} noLinkLayout> + <ImageGitHub + title={data.title || data.id} + url={`release/${data.github}/all.svg?style=flat-square`} + isRounded + /> + <ImageGitHub + title={data.title || data.id} + url={`license/${data.github}.svg?style=flat-square`} + isRounded + /> + <ImageGitHub + title={data.title || data.id} + url={`stars/${data.github}.svg?style=social&label=Stars`} + /> + </Link> + )} + </p> + )} + + {data.pip && ( + + )} + {data.cran && ( + + )} + + {data.cover && ( +

+ {/* eslint-disable-next-line @next/next/no-img-element */} + {data.title} +

+ )} + +
+ {data.youtube && } + {data.soundcloud && } + {data.iframe && ( +