spaCy/website/universe/index.jade

147 lines
8.7 KiB
Plaintext
Raw Normal View History

💫 Interactive code examples, spaCy Universe and various docs improvements (#2274) * Integrate Python kernel via Binder * Add live model test for languages with examples * Update docs and code examples * Adjust margin (if not bootstrapped) * Add binder version to global config * Update terminal and executable code mixins * Pass attributes through infobox and section * Hide v-cloak * Fix example * Take out model comparison for now * Add meta text for compat * Remove chart.js dependency * Tidy up and simplify JS and port big components over to Vue * Remove chartjs example * Add Twitter icon * Add purple stylesheet option * Add utility for hand cursor (special cases only) * Add transition classes * Add small option for section * Add thumb object for small round thumbnail images * Allow unset code block language via "none" value (workaround to still allow unset language to default to DEFAULT_SYNTAX) * Pass through attributes * Add syntax highlighting definitions for Julia, R and Docker * Add website icon * Remove user survey from navigation * Don't hide GitHub icon on small screens * Make top navigation scrollable on small screens * Remove old resources page and references to it * Add Universe * Add helper functions for better page URL and title * Update site description * Increment versions * Update preview images * Update mentions of resources * Fix image * Fix social images * Fix problem with cover sizing and floats * Add divider and move badges into heading * Add docstrings * Reference converting section * Add section on converting word vectors * Move converting section to custom section and fix formatting * Remove old fastText example * Move extensions content to own section Keep weird ID to not break permalinks for now (we don't want to rewrite URLs if not absolutely necessary) * Use better component example and add factories section * Add note on larger model * Use better example for non-vector * Remove similarity in context section Only works via small models with tensors so has always been kind of confusing * Add note on init-model command * Fix lightning tour examples and make excutable if possible * Add spacy train CLI section to train * Fix formatting and add video * Fix formatting * Fix textcat example description (resolves #2246) * Add dummy file to try resolve conflict * Delete dummy file * Tidy up [ci skip] * Ensure sufficient height of loading container * Add loading animation to universe * Update Thebelab build and use better startup message * Fix asset versioning * Fix typo [ci skip] * Add note on project idea label
2018-04-29 00:06:46 +00:00
//- 💫 DOCS > UNIVERSE
include ../_includes/_mixins
mixin sidebar-section(title)
ul.c-sidebar__section.o-block-small
if title
li.u-text-label.u-color-dark=title
block
section(data-vue="universe")
menu.c-sidebar.js-sidebar.u-text
+sidebar-section("Overview")
li.c-sidebar__item
a.u-hand(v-on:click="filterBy('all')" v-bind:class="{'is-active': activeMenu == 'all'}") All Projects
+sidebar-section("Projects")
li.c-sidebar__item(v-for="(data, id) in projectCats")
a.u-hand(v-on:click="filterBy(id, 'category')" v-text="data.title" v-bind:class="{ 'is-active': activeMenu == id }")
+sidebar-section("Education")
li.c-sidebar__item(v-for="(data, id) in educationCats")
a.u-hand(v-on:click="filterBy(id, 'category')" v-text="data.title" v-bind:class="{ 'is-active': activeMenu == id }")
main.o-main.o-main--sidebar.o-main--aside
article.o-content
transition-group(name="u-fade")
section(v-if="selected" key="selected" v-cloak="")
+h(1).u-heading--title
.u-float-right.o-thumb(v-if="selected.thumb")
img(v-bind:src="selected.thumb" width="100" role="presentation")
| {{ selected.title || selected.id }}
.u-heading__teaser.u-text-small.u-color-dark.o-block-small(v-if="selected.slogan") {{ selected.slogan }}
p(v-if="selected.github")
a.u-hide-link(v-bind:href="`https://github.com/${selected.github}`")
| #[img.o-badge(v-bind:src="`https://img.shields.io/github/release/${selected.github}/all.svg?style=flat-square`")]
| #[img.o-badge(v-bind:src="`https://img.shields.io/github/license/${selected.github}.svg?style=flat-square`")]
| #[img(v-bind:src="`https://img.shields.io/github/stars/${selected.github}.svg?style=social&label=Stars`")]
div(v-if="selected.pip")
+aside-code("Installation", "bash", "$").
pip install {{ selected.pip }}
div(v-else-if="selected.cran")
+aside-code("Installation", "r").
install.packages("{{ selected.cran }}")
+section.o-section--small
img.o-block-small.u-padding-medium.u-float-right(v-if="selected.cover" v-bind:src="selected.cover" v-bind:alt="selected.title" width="250" style="max-width: 50%")
.x-markdown.o-block(v-if="selected.description")
vue-markdown(v-bind:source="selected.description")
.o-block(v-if="selected.code_example")
+code("Example", "none")(v-bind:class="`lang-${selected.code_language||'#{DEFAULT_SYNTAX}'}`")
| {{ selected.code_example.join('\n') }}
figure.o-block.u-text(v-if="selected.image")
img(v-bind:src="selected.image" width="800" v-bind:alt="selected.slogan || selected.title || selected.id")
p(v-if="selected.url")
+button("", false, "primary", "small")(target="_blank" v-bind:href="selected.url") View more
+grid
+grid-col("half")(v-if="selected.author")
+label Author info
p.o-inline-list
span {{ selected.author }}
span.u-color-subtle-dark(v-if="selected.author_links")  
span(v-for="id in ['github', 'twitter', 'website']" v-if="selected.author_links[id]")
a.u-hide-link(rel="noopener nofollow" v-bind:href="getAuthorLink(id, selected.author_links[id])" v-bind:aria-label="id")
svg.o-icon(aria-hidden="true" viewBox="0 0 18 18" width="18" height="18")
use(v-bind:xlink:href="`#svg_${id}`")
|  
+grid-col("half")(v-if="selected.github")
+label GitHub
p.o-no-block
span.u-inline-block.u-nowrap
+a("", false)(target="_blank" v-bind:href="`https://github.com/${selected.github}`")
code.u-break.u-break--all(v-text="selected.github")
| #[+icon("code", 16).o-icon--inline.u-color-theme]
+grid-col("full")(v-if="selected.category")
+label Categories
p.o-no-block
span(v-for="cat in selected.category" v-if="categories[cat]")
a.u-text.u-hand(v-on:click="filterBy(cat, 'category')")
code(v-text="cat")
|  
section(v-else="" key="overview")
+h(1).u-heading--title
span(v-if="activeMenu && categories[activeMenu]" v-cloak="")
| {{ categories[activeMenu].title }}
+tag {{ resources.length }}
.u-heading__teaser.u-text-small.u-color-dark(v-if="categories[activeMenu].description" v-text="categories[activeMenu].description")
span(v-else)=title
.u-heading__teaser.u-text-small.u-color-dark=teaser
+section().o-section--small
+infobox()(v-if="false")
| Couldn't load the projects overview. This may
| happen if there's a bug in our code, or if you
| have JavaScript disabled. The resources list
| displayed on this page is open-source and
| available on GitHub see
| #[+src(gh("spacy", "website/universe/universe.json")) #[code universe.json]]
| for the full data.
+grid()(v-cloak="" v-bind:data-loading="loading")
+grid-col().u-text(v-for="resource in resources" v-bind:key="resource.id" v-bind:class="{'o-box': !resource.cover, 'o-grid__col--third': resource.cover, 'o-grid__col--half': !resource.cover}" v-if="(activeMenu && activeMenu != 'all') || resource.type != 'education'")
a.u-hand(v-on:click="viewResource(resource.id)")
img(v-bind:src="resource.cover" v-bind:alt="resource.title" v-if="resource.cover")
div(v-else)
+h(5).o-block-small
.o-thumb.o-thumb--small.u-float-right(v-if="resource.thumb")
img(v-bind:src="resource.thumb" width="35" role="presentation")
span {{ resource.title || resource.id }}
.u-text-small.o-no-block(v-if="resource.slogan" v-text="resource.slogan")
+section().o-section--small
+h(3) Submit your project
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
| #[+a(gh("spacy") + "/labels/project%20idea") #[code project idea]]
| label on the issue tracker.
p.o-inline-list
+button(gh("spacy", "website/universe/README.md"), false, "small", "primary") Read the docs
+button(gh("spacy", "website/universe/universe.json"), false, "small", "secondary") JSON source #[+icon("code", 16)]
include ../_includes/_footer