2016-10-31 21:04:15 +03:00
|
|
|
//- 💫 MIXINS > BASE
|
|
|
|
|
2017-10-03 15:20:13 +03:00
|
|
|
//- Section
|
|
|
|
id - [string] anchor assigned to section (used for breadcrumb navigation)
|
|
|
|
|
|
|
|
mixin section(id)
|
|
|
|
section.o-section(id="section-" + id data-section=id)
|
|
|
|
block
|
|
|
|
|
|
|
|
|
2016-10-31 21:04:15 +03:00
|
|
|
//- Aside wrapper
|
2017-01-01 14:43:43 +03:00
|
|
|
label - [string] aside label
|
2016-10-31 21:04:15 +03:00
|
|
|
|
|
|
|
mixin aside-wrapper(label)
|
|
|
|
aside.c-aside
|
|
|
|
.c-aside__content(role="complementary")&attributes(attributes)
|
|
|
|
if label
|
|
|
|
h4.u-text-label.u-text-label--dark=label
|
|
|
|
|
|
|
|
block
|
|
|
|
|
|
|
|
|
2017-10-03 15:20:13 +03:00
|
|
|
//- SVG from map (uses embedded SVG sprite)
|
2017-01-01 14:43:43 +03:00
|
|
|
name - [string] SVG symbol id
|
|
|
|
width - [integer] width in px
|
|
|
|
height - [integer] height in px (default: same as width)
|
2016-10-31 21:04:15 +03:00
|
|
|
|
2017-10-03 15:20:13 +03:00
|
|
|
mixin svg(name, width, height)
|
2016-10-31 21:04:15 +03:00
|
|
|
svg(aria-hidden="true" viewBox="0 0 #{width} #{height || width}" width=width height=(height || width))&attributes(attributes)
|
2017-10-03 15:20:13 +03:00
|
|
|
use(xlink:href="#svg_#{name}")
|
2016-10-31 21:04:15 +03:00
|
|
|
|
|
|
|
|
|
|
|
//- Icon
|
2017-10-03 15:20:13 +03:00
|
|
|
name - [string] icon name (will be used as symbol id: #svg_{name})
|
|
|
|
width - [integer] icon width (default: 20)
|
|
|
|
height - [integer] icon height (defaults to width)
|
2016-10-31 21:04:15 +03:00
|
|
|
|
2017-10-03 15:20:13 +03:00
|
|
|
mixin icon(name, width, height)
|
|
|
|
- var width = width || 20
|
|
|
|
- var height = height || width
|
|
|
|
+svg(name, width, height).o-icon(style="min-width: #{width}px")&attributes(attributes)
|
2016-10-31 21:04:15 +03:00
|
|
|
|
|
|
|
|
|
|
|
//- Pro/Con/Neutral icon
|
2017-01-01 14:43:43 +03:00
|
|
|
icon - [string] "pro", "con" or "neutral" (default: "neutral")
|
2017-05-24 00:11:38 +03:00
|
|
|
size - [integer] icon size (optional)
|
2016-10-31 21:04:15 +03:00
|
|
|
|
2017-05-24 00:11:38 +03:00
|
|
|
mixin procon(icon, size)
|
2017-10-03 15:20:13 +03:00
|
|
|
- colors = { pro: "green", con: "red", neutral: "subtle" }
|
|
|
|
+icon("circle", size || 16)(class="u-color-#{colors[icon] || 'subtle'}" aria-label=icon)&attributes(attributes)
|
2016-10-31 21:04:15 +03:00
|
|
|
|
|
|
|
|
|
|
|
//- Headlines Helper Mixin
|
2017-01-01 14:43:43 +03:00
|
|
|
level - [integer] 1, 2, 3, 4, or 5
|
2016-10-31 21:04:15 +03:00
|
|
|
|
|
|
|
mixin headline(level)
|
|
|
|
if level == 1
|
|
|
|
h1.u-heading-1&attributes(attributes)
|
|
|
|
block
|
|
|
|
|
|
|
|
else if level == 2
|
|
|
|
h2.u-heading-2&attributes(attributes)
|
|
|
|
block
|
|
|
|
|
|
|
|
else if level == 3
|
|
|
|
h3.u-heading-3&attributes(attributes)
|
|
|
|
block
|
|
|
|
|
|
|
|
else if level == 4
|
|
|
|
h4.u-heading-4&attributes(attributes)
|
|
|
|
block
|
|
|
|
|
|
|
|
else if level == 5
|
|
|
|
h5.u-heading-5&attributes(attributes)
|
|
|
|
block
|
|
|
|
|
|
|
|
|
|
|
|
//- Permalink rendering
|
2017-01-01 14:43:43 +03:00
|
|
|
id - [string] permalink ID used for link anchor
|
2016-10-31 21:04:15 +03:00
|
|
|
|
|
|
|
mixin permalink(id)
|
|
|
|
if id
|
2017-10-03 15:20:13 +03:00
|
|
|
a.u-permalink(href="##{id}")
|
2016-10-31 21:04:15 +03:00
|
|
|
block
|
|
|
|
|
|
|
|
else
|
|
|
|
block
|
|
|
|
|
|
|
|
|
2017-05-17 13:03:11 +03:00
|
|
|
//- Quickstart widget
|
|
|
|
quickstart.js with manual markup, inspired by PyTorch's "Getting started"
|
|
|
|
groups - [object] option groups, uses global variable QUICKSTART
|
|
|
|
headline - [string] optional text to be rendered as widget headline
|
|
|
|
|
2017-05-28 17:36:07 +03:00
|
|
|
mixin quickstart(groups, headline, description, hide_results)
|
2017-05-21 21:51:00 +03:00
|
|
|
.c-quickstart.o-block-small#qs
|
2017-05-17 13:03:11 +03:00
|
|
|
.c-quickstart__content
|
|
|
|
if headline
|
|
|
|
+h(2)=headline
|
2017-05-21 21:51:00 +03:00
|
|
|
if description
|
|
|
|
p=description
|
2017-05-17 13:03:11 +03:00
|
|
|
for group in groups
|
|
|
|
.c-quickstart__group.u-text-small(data-qs-group=group.id)
|
2017-05-28 17:36:07 +03:00
|
|
|
if group.title
|
|
|
|
.c-quickstart__legend=group.title
|
|
|
|
if group.help
|
|
|
|
| #[+help(group.help)]
|
2017-05-17 13:03:11 +03:00
|
|
|
.c-quickstart__fields
|
|
|
|
for option in group.options
|
2017-05-31 13:43:30 +03:00
|
|
|
input.c-quickstart__input(class="c-quickstart__input--" + (group.input_style ? group.input_style : group.multiple ? "check" : "radio") type=group.multiple ? "checkbox" : "radio" name=group.id id="qs-#{option.id}" value=option.id checked=option.checked)
|
2017-10-03 15:20:13 +03:00
|
|
|
label.c-quickstart__label.u-text-tiny(for="qs-#{option.id}")!=option.title
|
2017-05-17 13:03:11 +03:00
|
|
|
if option.meta
|
|
|
|
| #[span.c-quickstart__label__meta (#{option.meta})]
|
|
|
|
if option.help
|
2017-05-21 21:51:00 +03:00
|
|
|
| #[+help(option.help)]
|
2017-05-17 13:03:11 +03:00
|
|
|
|
2017-05-28 17:36:07 +03:00
|
|
|
if hide_results
|
|
|
|
block
|
|
|
|
else
|
|
|
|
pre.c-code-block
|
|
|
|
code.c-code-block__content.c-quickstart__code(data-qs-results="")
|
|
|
|
block
|
2017-05-17 13:03:11 +03:00
|
|
|
|
|
|
|
|
|
|
|
//- Quickstart code item
|
2017-10-03 15:20:13 +03:00
|
|
|
data - [object] Rendering conditions (keyed by option group ID, value: option)
|
|
|
|
style - [string] modifier ID for line style
|
2017-05-17 13:03:11 +03:00
|
|
|
|
2017-05-21 21:51:00 +03:00
|
|
|
mixin qs(data, style)
|
2017-05-17 13:03:11 +03:00
|
|
|
- args = {}
|
|
|
|
for value, setting in data
|
|
|
|
- args['data-qs-' + setting] = value
|
2017-05-21 21:51:00 +03:00
|
|
|
span.c-quickstart__line(class="c-quickstart__line--#{style || 'bash'}")&attributes(args)
|
2017-05-17 13:03:11 +03:00
|
|
|
block
|
|
|
|
|
|
|
|
|
2016-10-31 21:04:15 +03:00
|
|
|
//- Terminal-style code window
|
2017-01-01 14:43:43 +03:00
|
|
|
label - [string] title displayed in top bar of terminal window
|
2016-10-31 21:04:15 +03:00
|
|
|
|
|
|
|
mixin terminal(label)
|
|
|
|
.x-terminal
|
|
|
|
.x-terminal__icons: span
|
|
|
|
.u-padding-small.u-text-label.u-text-center=label
|
|
|
|
|
|
|
|
+code.x-terminal__code
|
|
|
|
block
|
|
|
|
|
2017-10-03 15:20:13 +03:00
|
|
|
//- Chart.js
|
|
|
|
id - [string] chart ID, will be assigned as #chart_{id}
|
|
|
|
|
|
|
|
mixin chart(id)
|
|
|
|
figure.o-block&attributes(attributes)
|
|
|
|
canvas(id="chart_#{id}" width="800" height="400" style="max-width: 100%")
|
|
|
|
|
2016-10-31 21:04:15 +03:00
|
|
|
|
2017-01-01 14:46:01 +03:00
|
|
|
//- Gitter chat button and widget
|
|
|
|
button - [string] text shown on button
|
|
|
|
label - [string] title of chat window (default: same as button)
|
|
|
|
|
|
|
|
mixin gitter(button, label)
|
|
|
|
aside.js-gitter.c-chat.is-collapsed(data-title=(label || button))
|
|
|
|
|
2017-10-03 15:20:13 +03:00
|
|
|
button.js-gitter-button.c-chat__button.u-text-tag
|
|
|
|
+icon("chat", 16).o-icon--inline
|
2017-01-01 14:46:01 +03:00
|
|
|
!=button
|
|
|
|
|
|
|
|
|
2017-03-26 15:11:22 +03:00
|
|
|
//- Badge
|
2017-10-03 15:20:13 +03:00
|
|
|
image - [string] path to badge image
|
|
|
|
url - [string] badge link
|
2017-03-26 15:11:22 +03:00
|
|
|
|
2017-10-03 15:20:13 +03:00
|
|
|
mixin badge(image, url)
|
|
|
|
+a(url).u-padding-small.u-hide-link&attributes(attributes)
|
|
|
|
img.o-badge(src=image alt=url height="20")
|
2017-03-26 15:11:22 +03:00
|
|
|
|
|
|
|
|
2017-10-03 15:20:13 +03:00
|
|
|
//- spaCy logo
|
2016-10-31 21:04:15 +03:00
|
|
|
|
|
|
|
mixin logo()
|
2017-10-03 15:20:13 +03:00
|
|
|
+svg("spacy", 675, 215).o-logo&attributes(attributes)
|
2016-10-31 21:04:15 +03:00
|
|
|
|
|
|
|
|
|
|
|
//- Landing
|
|
|
|
|
|
|
|
mixin landing-header()
|
|
|
|
header.c-landing
|
|
|
|
.c-landing__wrapper
|
|
|
|
.c-landing__content
|
|
|
|
block
|
2017-04-08 11:09:33 +03:00
|
|
|
|
2017-10-03 15:20:13 +03:00
|
|
|
mixin landing-banner(headline, label)
|
|
|
|
.c-landing__banner.u-padding.o-block.u-color-light
|
|
|
|
+grid.c-landing__banner__content.o-no-block
|
|
|
|
+grid-col("third")
|
|
|
|
h3.u-heading.u-heading-1
|
|
|
|
if label
|
|
|
|
div
|
|
|
|
span.u-text-label.u-text-label--light=label
|
|
|
|
!=headline
|
|
|
|
|
|
|
|
+grid-col("two-thirds").c-landing__banner__text
|
|
|
|
block
|
|
|
|
|
2017-04-08 11:09:33 +03:00
|
|
|
|
2017-10-03 15:20:13 +03:00
|
|
|
mixin landing-logos(title, logos)
|
|
|
|
.o-content.u-text-center&attributes(attributes)
|
|
|
|
h3.u-heading.u-text-label.u-color-dark=title
|
|
|
|
|
|
|
|
each row, i in logos
|
|
|
|
- var is_last = i == logos.length - 1
|
|
|
|
+grid("center").o-inline-list.o-no-block(class=is_last ? "o-no-block" : null)
|
|
|
|
each details, name in row
|
|
|
|
+a(details[0]).u-padding-medium
|
|
|
|
+icon(name, details[1], details[2])
|
|
|
|
|
|
|
|
if is_last
|
|
|
|
block
|
2017-05-26 14:17:48 +03:00
|
|
|
|
|
|
|
|
|
|
|
//- Under construction (temporary)
|
|
|
|
Marks sections that still need to be completed for the v2.0 release.
|
|
|
|
|
|
|
|
mixin under-construction()
|
2017-10-03 15:20:13 +03:00
|
|
|
+infobox("Under construction", "🚧")
|
2017-05-26 14:17:48 +03:00
|
|
|
| This section is still being written and will be updated for the v2.0
|
|
|
|
| release. Is there anything that you think should definitely mentioned or
|
|
|
|
| explained here? Any examples you'd like to see? #[strong Let us know]
|
2017-06-06 01:58:12 +03:00
|
|
|
| on the #[+a(gh("spacy") + "/issues/1105") v2.0 alpha thread] on GitHub!
|
2017-10-03 15:20:13 +03:00
|
|
|
|
|
|
|
|
|
|
|
//- Alpha infobox (temporary)
|
|
|
|
Added in the templates to notify user that they're visiting the alpha site.
|
|
|
|
|
|
|
|
mixin alpha-info()
|
|
|
|
+infobox("You are viewing the spaCy v2.0.0 alpha docs", "⚠️")
|
|
|
|
strong This page is part of the alpha documentation for spaCy v2.0.
|
|
|
|
| It does not reflect the state of the latest stable release.
|
|
|
|
| Because v2.0 is still under development, the implementation
|
|
|
|
| may differ from the intended state described here. See the
|
|
|
|
| #[+a(gh("spaCy") + "/releases/tag/v2.0.0-alpha") release notes]
|
|
|
|
| for details on how to install and test the new version. To
|
|
|
|
| read the official docs for spaCy v1.x,
|
|
|
|
| #[+a("https://spacy.io/docs") go here].
|