2016-10-31 21:04:15 +03:00
|
|
|
//- 💫 MIXINS > BASE
|
|
|
|
|
|
|
|
//- 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
|
|
|
|
|
|
|
|
//- Date
|
|
|
|
input - [string] date in the format YYYY-MM-DD
|
|
|
|
|
|
|
|
mixin date(input)
|
|
|
|
- var date = new Date(input)
|
|
|
|
- var months = [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ]
|
|
|
|
|
|
|
|
time(datetime=JSON.parse(JSON.stringify(date)))&attributes(attributes)=months[date.getMonth()] + ' ' + date.getDate() + ', ' + date.getFullYear()
|
|
|
|
|
|
|
|
|
|
|
|
//- SVG from map
|
2017-01-01 14:43:43 +03:00
|
|
|
file - [string] SVG file name in /assets/img/
|
|
|
|
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
|
|
|
|
|
|
|
mixin svg(file, name, width, height)
|
|
|
|
svg(aria-hidden="true" viewBox="0 0 #{width} #{height || width}" width=width height=(height || width))&attributes(attributes)
|
|
|
|
use(xlink:href="/assets/img/#{file}.svg##{name}")
|
|
|
|
|
|
|
|
|
|
|
|
//- Icon
|
2017-01-01 14:43:43 +03:00
|
|
|
name - [string] icon name, should be SVG symbol ID
|
|
|
|
size - [integer] icon width and height (default: 20)
|
2016-10-31 21:04:15 +03:00
|
|
|
|
|
|
|
mixin icon(name, size)
|
2017-05-26 13:39:59 +03:00
|
|
|
- var size = size || 20
|
|
|
|
+svg("icons", name, size).o-icon(style="min-width: #{size}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-01-03 23:24:14 +03:00
|
|
|
- colors = { pro: "green", con: "red", neutral: "yellow" }
|
2017-05-24 00:11:38 +03:00
|
|
|
+icon(icon, size)(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
|
|
|
|
a.u-permalink(id=id href="##{id}")
|
|
|
|
+icon("anchor").u-permalink__icon
|
|
|
|
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)
|
|
|
|
label.c-quickstart__label(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
|
|
|
|
2017-05-21 21:50:11 +03:00
|
|
|
.c-quickstart__info.u-text-tiny.o-block.u-text-right
|
|
|
|
| Like this widget? Check out #[+a("https://github.com/ines/quickstart").u-link quickstart.js]!
|
|
|
|
|
2017-05-17 13:03:11 +03:00
|
|
|
|
|
|
|
//- Quickstart code item
|
|
|
|
data [object] - Rendering conditions (keyed by option group ID, value: option)
|
|
|
|
|
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-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))
|
|
|
|
|
|
|
|
button.js-gitter-button.c-chat__button.u-text-small
|
|
|
|
+icon("chat").o-icon--inline
|
|
|
|
!=button
|
|
|
|
|
|
|
|
|
2017-03-26 15:11:22 +03:00
|
|
|
//- Badge
|
|
|
|
name - [string] "pipy" or "conda"
|
|
|
|
|
|
|
|
mixin badge(name)
|
|
|
|
- site = BADGES[name]
|
|
|
|
|
|
|
|
if site
|
|
|
|
+a(site.link).u-padding-small
|
|
|
|
img(src=site.badge alt="{name} version" height="20")
|
|
|
|
|
|
|
|
|
2016-10-31 21:04:15 +03:00
|
|
|
//- Logo
|
|
|
|
|
|
|
|
mixin logo()
|
2017-01-17 19:56:34 +03:00
|
|
|
+svg("graphics", "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
|
|
|
|
|
|
|
|
|
|
|
mixin landing-badge(url, graphic, alt, size)
|
|
|
|
+a(url)(aria-label=alt title=alt).c-landing__badge
|
|
|
|
+svg("graphics", graphic, size || 225)
|
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()
|
|
|
|
+infobox("🚧 Under construction")
|
|
|
|
| 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!
|