Skip to content

Commit

Permalink
Merge pull request #116 from indirectlylit/versions
Browse files Browse the repository at this point in the history
versions
  • Loading branch information
indirectlylit authored Dec 2, 2020
2 parents 76301f6 + 3609c46 commit e1ac772
Show file tree
Hide file tree
Showing 10 changed files with 230 additions and 74 deletions.
2 changes: 1 addition & 1 deletion docs/assets/definitions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ $code-color: #696680;
$link-color: #368d74;
$link-hover-color: #26614d;
$selection-color: #f0e7ed;
$basic-transition: color 0.25s ease;
$basic-transition: color 0.25s ease, fill 0.25s ease;
$nav-width: 260px;
6 changes: 3 additions & 3 deletions docs/common/DocsAnchorTarget.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
type: String,
validator(value) {
if (!value.startsWith('#')) {
log.warn(`'anchor' prop value '${value}' must start with a '#'`);
log.error(`'anchor' prop value '${value}' must start with a '#'`);
return false;
}
if (!value.match(/^#[a-zA-Z0-9_-]*$/)) {
log.warn(`'anchor' prop value '${value}' must match /^#[a-zA-Z0-9_-]*$/`);
if (!value.match(/^#[\w.:]*$/)) {
log.error(`'anchor' prop value '${value}' invalid`);
return false;
}
return true;
Expand Down
108 changes: 108 additions & 0 deletions docs/common/DocsGithubLink.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
<template>

<a :href="linkUrl" target="_blank">
<svg
class="logo"
role="img"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
>
<title>GitHub</title>
<path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12" />
</svg><span>{{ linkText }}</span>
</a>

</template>


<script>
import log from 'loglevel';
function validator(value) {
if (typeof value === 'string') {
if (value.startsWith('#')) {
log.error(`PR or issue number '${value}' should not start with a '#'`);
return false;
}
if (!value.match(/^\d+$/)) {
log.error(`PR or issue number '${value}' invalid`);
return false;
}
}
return true;
}
export default {
name: 'DocsExternalLink',
props: {
/**
* If provided, set the link text
*/
text: {
type: String,
required: false,
},
/**
* If provided, set the link URL
*/
href: {
type: String,
required: false,
},
/**
* If provided, create a link to a PR in the design-system repo
*/
pull: {
type: [String, Number],
required: false,
validator,
},
/**
* If provided, create a link to an issue in the design-system repo
*/
issue: {
type: [String, Number],
required: false,
validator,
},
},
computed: {
linkText() {
if (this.text) return this.text;
if (this.pull) return `#${this.pull}`;
if (this.issue) return `#${this.issue}`;
return this.linkUrl;
},
linkUrl() {
if (this.href) return this.href;
if (this.pull)
return `https://github.com/learningequality/kolibri-design-system/pull/${this.pull}`;
if (this.issue)
return `https://github.com/learningequality/kolibri-design-system/issue/${this.issue}`;
log.error(`No URL, PR, or issue provided`);
return undefined;
},
},
mounted() {
if (this.pull && this.issue) {
log.warn("Pass either 'pull' or 'issue', not both");
}
},
};
</script>


<style lang="scss" scoped>
.logo {
position: relative;
top: -1px;
width: 16px;
height: 16px;
margin-right: 4px;
vertical-align: middle;
}
</style>
48 changes: 48 additions & 0 deletions docs/common/DocsPageTemplate/BranchLink.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<template>

<div class="link-wrapper">
<DocsGithubLink
v-if="showLink"
:href="linkUrl"
:text="linkText"
/>
<span v-else>
Local environment
</span>
<span>| <DocsInternalLink text="Version history" href="/versions" /></span>
</div>

</template>


<script>
import environment from '~/environment';
export default {
name: 'BranchLink',
computed: {
showLink() {
return environment && !environment.local;
},
linkUrl() {
return environment.url;
},
linkText() {
return environment.branch;
},
},
};
</script>


<style lang="scss" scoped>
.link-wrapper {
margin: 18px;
font-size: 14px;
font-weight: normal;
}
</style>
66 changes: 0 additions & 66 deletions docs/common/DocsPageTemplate/GitHubLink.vue

This file was deleted.

6 changes: 3 additions & 3 deletions docs/common/DocsPageTemplate/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<span class="visuallyhidden">link to current page</span>
</a>
</h1>
<GitHubLink style="float: right" />
<BranchLink style="float: right" />
</div>
<div style="clear: both;"></div>
<ul v-if="sections.length" class="nav">
Expand All @@ -28,12 +28,12 @@

<script>
import GitHubLink from './GitHubLink.vue';
import BranchLink from './BranchLink.vue';
export default {
name: 'Header',
components: {
GitHubLink,
BranchLink,
},
props: {
sections: {
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/inclusive.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
Like with keyboard navigation, using the built-in components is a good way to
ensure compatibility with screen readers. However, it's also critical to test
all new functionality. See this
<DocsExternalLink href="https://github.com/learningequality/kolibri/wiki/Accessibility-Resources-(Tools)" text="comprehensive list of A11y testing tools" />.
<DocsExternalLink href="https://kolibri-dev.readthedocs.io/en/develop/manual_testing/a11y_resources/index.html" text="comprehensive list of A11y testing tools" />.
</p>

<p>
Expand Down
60 changes: 60 additions & 0 deletions docs/pages/versions.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<template>

<DocsPageTemplate>

<DocsPageSection title="Overview" anchor="#overview">
<p>
Releases are specified as tags in the <DocsExternalLink text="Github releases page" href="https://github.com/learningequality/kolibri-design-system/releases" />
</p>
</DocsPageSection>

<DocsPageSection title="Version 0.2" anchor="#0.2">
<h3>0.2.1</h3>
<h4>Content updates</h4>
<ul>
<li>Added design principles documentation - <DocsGithubLink pull="95" /></li>
<li>Added errors documentation - <DocsGithubLink pull="97" /></li>
<li>Added switches documentation - <DocsGithubLink pull="105" /></li>
<li>Added menu documentation - <DocsGithubLink pull="106" /></li>
</ul>
<h4>Library updates</h4>
<ul>
<li>Added 'email', 'sidebar', and 'add' icons - <DocsGithubLink pull="110" /></li>
<li>Updated 'clipboard' icon - <DocsGithubLink pull="121" /></li>
<li>Fixed z-order bug in icon button - <DocsGithubLink pull="95" />, <DocsGithubLink pull="122" /></li>
</ul>
<h4>Docs site updates</h4>
<ul>
<li>Added support for exporting icons to user documentation - <DocsGithubLink pull="104" /></li>
<li>Documentation bugs and improvements - <DocsGithubLink pull="112" />, <DocsGithubLink pull="114" />, <DocsGithubLink pull="115" /></li>
</ul>
<h3>0.2.1</h3>
<h4>Library updates</h4>
<ul>
<li>Fixed regression related to external links opening in new tabs - <DocsGithubLink pull="93" /></li>
</ul>
<h3>0.2.0</h3>
<p>
This was the first release of the Design System, with documentation written in a Nuxt-based statically-generated site. The focus was on migrating components out of the Kolibri and making them reusable in a shared component library.
</p>
</DocsPageSection>

<DocsPageSection title="Version 0.1" anchor="#0.1">
<p>
The design system was originally based on a set of internal Kolibri components and their use as documented in the Kolibri Style Guide, which was first introduced into the Kolibri code base <DocsExternalLink text="in version 0.6" href="https://github.com/learningequality/kolibri/tree/release-v0.6.x/kolibri/plugins/style_guide" />. This remained until <DocsExternalLink text="version 0.13" href="https://github.com/learningequality/kolibri/tree/release-v0.13.x/kolibri/plugins/style_guide" /> after which the content was migrated here.
</p>
</DocsPageSection>

</DocsPageTemplate>

</template>


<script>
export default {};
</script>


<style lang="scss" scoped></style>
2 changes: 2 additions & 0 deletions docs/plugins/load-common-components.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Vue from 'vue';

import VueSimpleMarkdown from 'vue-simple-markdown';
import DocsExternalLink from '~/common/DocsExternalLink';
import DocsGithubLink from '~/common/DocsGithubLink';
import DocsInternalLink from '~/common/DocsInternalLink';
import DocsAnchorTarget from '~/common/DocsAnchorTarget';
import DocsPageSection from '~/common/DocsPageSection';
Expand All @@ -15,6 +16,7 @@ Vue.component('DocsPageSection', DocsPageSection);
Vue.component('DocsInternalLink', DocsInternalLink);
Vue.component('DocsAnchorTarget', DocsAnchorTarget);
Vue.component('DocsExternalLink', DocsExternalLink);
Vue.component('DocsGithubLink', DocsGithubLink);
Vue.component('DocsShow', DocsShow);
Vue.component('DocsDoNot', DocsDoNot);
Vue.component('DocsFilter', DocsFilter);
Expand Down
4 changes: 4 additions & 0 deletions docs/tableOfContents.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ export default [
path: '/principles',
title: 'Design principles',
}),
new Page({
path: '/versions',
title: 'Version history',
}),
],
}),
new Section({
Expand Down

0 comments on commit e1ac772

Please sign in to comment.