just-the-docs 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE.txt +21 -0
- data/README.md +48 -0
- data/Rakefile +1 -0
- data/_includes/head.html +11 -0
- data/_includes/nav.html +24 -0
- data/_layouts/default.html +68 -0
- data/_layouts/post.html +5 -0
- data/_sass/base.scss +104 -0
- data/_sass/buttons.scss +114 -0
- data/_sass/code.scss +121 -0
- data/_sass/content.scss +64 -0
- data/_sass/custom/custom.scss +112 -0
- data/_sass/labels.scss +35 -0
- data/_sass/layout.scss +121 -0
- data/_sass/navigation.scss +134 -0
- data/_sass/normalize.scss/README.md +78 -0
- data/_sass/normalize.scss/normalize.scss +427 -0
- data/_sass/normalize.scss/package.json +70 -0
- data/_sass/search.scss +88 -0
- data/_sass/support/_functions.scss +10 -0
- data/_sass/support/_variables.scss +122 -0
- data/_sass/support/mixins/_buttons.scss +25 -0
- data/_sass/support/mixins/_layout.scss +34 -0
- data/_sass/support/mixins/_typography.scss +81 -0
- data/_sass/support/mixins/mixins.scss +3 -0
- data/_sass/support/support.scss +3 -0
- data/_sass/tables.scss +77 -0
- data/_sass/typography.scss +54 -0
- data/_sass/utilities/_colors.scss +231 -0
- data/_sass/utilities/_layout.scss +38 -0
- data/_sass/utilities/_lists.scss +11 -0
- data/_sass/utilities/_spacing.scss +121 -0
- data/_sass/utilities/_typography.scss +91 -0
- data/_sass/utilities/utilities.scss +5 -0
- data/assets/css/just-the-docs.scss +33 -0
- data/assets/images/just-the-docs.png +0 -0
- data/assets/images/search.svg +1 -0
- data/assets/js/just-the-docs.js +150 -0
- data/assets/js/vendor/lunr.min.js +6 -0
- data/bin/just-the-docs +16 -0
- data/lib/tasks/search.rake +22 -0
- metadata +129 -0
@@ -0,0 +1,91 @@
|
|
1
|
+
//
|
2
|
+
// Utility classes for typography
|
3
|
+
//
|
4
|
+
|
5
|
+
// stylelint-disable primer/selector-no-utility
|
6
|
+
|
7
|
+
.fs-1 {
|
8
|
+
@include fs-1;
|
9
|
+
}
|
10
|
+
|
11
|
+
.fs-2 {
|
12
|
+
@include fs-2;
|
13
|
+
}
|
14
|
+
|
15
|
+
.fs-3 {
|
16
|
+
@include fs-3;
|
17
|
+
}
|
18
|
+
|
19
|
+
.fs-4 {
|
20
|
+
@include fs-4;
|
21
|
+
}
|
22
|
+
|
23
|
+
.fs-5 {
|
24
|
+
@include fs-5;
|
25
|
+
}
|
26
|
+
|
27
|
+
.fs-6 {
|
28
|
+
@include fs-6;
|
29
|
+
}
|
30
|
+
|
31
|
+
.fs-7 {
|
32
|
+
@include fs-7;
|
33
|
+
}
|
34
|
+
|
35
|
+
.fs-8 {
|
36
|
+
@include fs-8;
|
37
|
+
}
|
38
|
+
|
39
|
+
.fs-9 {
|
40
|
+
@include fs-9;
|
41
|
+
}
|
42
|
+
|
43
|
+
.fs-10 {
|
44
|
+
@include fs-10;
|
45
|
+
}
|
46
|
+
|
47
|
+
.fw-300 {
|
48
|
+
font-weight: 300 !important;
|
49
|
+
}
|
50
|
+
|
51
|
+
.fw-400 {
|
52
|
+
font-weight: 400 !important;
|
53
|
+
}
|
54
|
+
|
55
|
+
.fw-500 {
|
56
|
+
font-weight: 500 !important;
|
57
|
+
}
|
58
|
+
|
59
|
+
.fw-700 {
|
60
|
+
font-weight: 700 !important;
|
61
|
+
}
|
62
|
+
|
63
|
+
.lh-0 {
|
64
|
+
line-height: 0 !important;
|
65
|
+
}
|
66
|
+
|
67
|
+
.lh-default {
|
68
|
+
line-height: $body-line-height;
|
69
|
+
}
|
70
|
+
|
71
|
+
.lh-tight {
|
72
|
+
line-height: $body-heading-line-height;
|
73
|
+
}
|
74
|
+
|
75
|
+
.ls-5 {
|
76
|
+
letter-spacing: 0.05em !important;
|
77
|
+
}
|
78
|
+
|
79
|
+
.ls-10 {
|
80
|
+
letter-spacing: 0.1em !important;
|
81
|
+
}
|
82
|
+
|
83
|
+
.ls-0 {
|
84
|
+
letter-spacing: 0 !important;
|
85
|
+
}
|
86
|
+
|
87
|
+
.text-uppercase {
|
88
|
+
text-transform: uppercase !important;
|
89
|
+
}
|
90
|
+
|
91
|
+
// stylelint-enable primer/selector-no-utility
|
@@ -0,0 +1,33 @@
|
|
1
|
+
---
|
2
|
+
# this ensures Jekyll reads the file to be transformed into CSS later
|
3
|
+
# only Main files contain this front matter, not partials.
|
4
|
+
---
|
5
|
+
|
6
|
+
//
|
7
|
+
// Import dependancies
|
8
|
+
//
|
9
|
+
|
10
|
+
@import "./normalize.scss/normalize.scss";
|
11
|
+
|
12
|
+
//
|
13
|
+
// Import Just the docs scss
|
14
|
+
//
|
15
|
+
|
16
|
+
// Support
|
17
|
+
@import "./support/support";
|
18
|
+
|
19
|
+
// Custom overrides
|
20
|
+
@import "./custom/custom";
|
21
|
+
|
22
|
+
// Modules
|
23
|
+
@import "./base";
|
24
|
+
@import "./layout";
|
25
|
+
@import "./content";
|
26
|
+
@import "./navigation";
|
27
|
+
@import "./typography";
|
28
|
+
@import "./labels";
|
29
|
+
@import "./buttons";
|
30
|
+
@import "./search";
|
31
|
+
@import "./tables";
|
32
|
+
@import "./code";
|
33
|
+
@import "./utilities/utilities";
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
<svg width="28" height="28" viewBox="0 0 28 28" xmlns="http://www.w3.org/2000/svg"><title>Search</title><g fill-rule="nonzero" fill="#959396"><path d="M17.332 20.735c-5.537 0-10-4.6-10-10.247 0-5.646 4.463-10.247 10-10.247 5.536 0 10 4.601 10 10.247s-4.464 10.247-10 10.247zm0-4c3.3 0 6-2.783 6-6.247 0-3.463-2.7-6.247-6-6.247s-6 2.784-6 6.247c0 3.464 2.7 6.247 6 6.247z"/><path d="M11.672 13.791L.192 25.271 3.02 28.1 14.5 16.62z"/></g></svg>
|
@@ -0,0 +1,150 @@
|
|
1
|
+
// Event handling
|
2
|
+
|
3
|
+
function addEvent(el, type, handler) {
|
4
|
+
if (el.attachEvent) el.attachEvent('on'+type, handler); else el.addEventListener(type, handler);
|
5
|
+
}
|
6
|
+
function removeEvent(el, type, handler) {
|
7
|
+
if (el.detachEvent) el.detachEvent('on'+type, handler); else el.removeEventListener(type, handler);
|
8
|
+
}
|
9
|
+
|
10
|
+
// Show/hide mobile menu
|
11
|
+
|
12
|
+
function toggleNav(){
|
13
|
+
const nav = document.querySelector('.js-main-nav');
|
14
|
+
const auxNav = document.querySelector('.js-aux-nav');
|
15
|
+
const navTrigger = document.querySelector('.js-main-nav-trigger');
|
16
|
+
|
17
|
+
addEvent(navTrigger, 'click', function(){
|
18
|
+
var text = navTrigger.innerText;
|
19
|
+
var textToggle = navTrigger.getAttribute('data-text-toggle');
|
20
|
+
|
21
|
+
nav.classList.toggle('nav-open');
|
22
|
+
auxNav.classList.toggle('nav-open');
|
23
|
+
navTrigger.classList.toggle('nav-open');
|
24
|
+
navTrigger.innerText = textToggle;
|
25
|
+
navTrigger.setAttribute('data-text-toggle', text);
|
26
|
+
textToggle = text;
|
27
|
+
})
|
28
|
+
}
|
29
|
+
|
30
|
+
// Site search
|
31
|
+
|
32
|
+
function initSearch() {
|
33
|
+
var index = lunr(function () {
|
34
|
+
this.ref('id');
|
35
|
+
this.field('title', { boost: 20 });
|
36
|
+
this.field('content');
|
37
|
+
this.field('url');
|
38
|
+
});
|
39
|
+
|
40
|
+
// Get the generated search_data.json file so lunr.js can search it locally.
|
41
|
+
|
42
|
+
var request = new XMLHttpRequest();
|
43
|
+
request.open('GET', '/search-data.json', true);
|
44
|
+
|
45
|
+
request.onload = function() {
|
46
|
+
if (request.status >= 200 && request.status < 400) {
|
47
|
+
// Success!
|
48
|
+
var data = JSON.parse(request.responseText);
|
49
|
+
var keys = Object.keys(data);
|
50
|
+
|
51
|
+
for(var i in data) {
|
52
|
+
index.add({
|
53
|
+
id: data[i].id,
|
54
|
+
title: data[i].title,
|
55
|
+
content: data[i].content,
|
56
|
+
url: data[i].url
|
57
|
+
});
|
58
|
+
}
|
59
|
+
searchResults(data);
|
60
|
+
} else {
|
61
|
+
// We reached our target server, but it returned an error
|
62
|
+
console.log('Error loading ajax request. Request status:' + request.status);
|
63
|
+
}
|
64
|
+
};
|
65
|
+
|
66
|
+
request.onerror = function() {
|
67
|
+
// There was a connection error of some sort
|
68
|
+
console.log('There was a connection error');
|
69
|
+
};
|
70
|
+
|
71
|
+
request.send();
|
72
|
+
|
73
|
+
function searchResults(dataStore) {
|
74
|
+
var searchInput = document.querySelector('.js-search-input');
|
75
|
+
var searchResults = document.querySelector('.js-search-results');
|
76
|
+
var store = dataStore;
|
77
|
+
|
78
|
+
function hideResults() {
|
79
|
+
searchResults.innerHTML = '';
|
80
|
+
searchResults.classList.remove('active');
|
81
|
+
}
|
82
|
+
|
83
|
+
addEvent(searchInput, 'keyup', function(e){
|
84
|
+
var query = this.value;
|
85
|
+
|
86
|
+
searchResults.innerHTML = '';
|
87
|
+
searchResults.classList.remove('active');
|
88
|
+
|
89
|
+
if (query === '') {
|
90
|
+
hideResults();
|
91
|
+
} else {
|
92
|
+
var results = index.search(query);
|
93
|
+
|
94
|
+
if (results.length > 1) {
|
95
|
+
searchResults.classList.add('active');
|
96
|
+
var resultsList = document.createElement('ul');
|
97
|
+
searchResults.appendChild(resultsList);
|
98
|
+
|
99
|
+
for (var i in results) {
|
100
|
+
var resultsListItem = document.createElement('li');
|
101
|
+
var resultsLink = document.createElement('a');
|
102
|
+
var resultsUrlDesc = document.createElement('span');
|
103
|
+
var resultsUrl = store[results[i].ref].url;
|
104
|
+
var resultsTitle = store[results[i].ref].title;
|
105
|
+
|
106
|
+
resultsLink.setAttribute('href', store[results[i].ref].url);
|
107
|
+
resultsLink.innerText = resultsTitle;
|
108
|
+
resultsUrlDesc.innerText = resultsUrl;
|
109
|
+
|
110
|
+
resultsList.classList.add('search-results-list');
|
111
|
+
resultsListItem.classList.add('search-results-list-item');
|
112
|
+
resultsLink.classList.add('search-results-link');
|
113
|
+
resultsUrlDesc.classList.add('fs-2','text-grey-dk-000','d-block');
|
114
|
+
|
115
|
+
resultsList.appendChild(resultsListItem);
|
116
|
+
resultsListItem.appendChild(resultsLink);
|
117
|
+
resultsLink.appendChild(resultsUrlDesc);
|
118
|
+
}
|
119
|
+
}
|
120
|
+
|
121
|
+
// When esc key is pressed, hide the results and clear the field
|
122
|
+
if (e.keyCode == 27) {
|
123
|
+
hideResults();
|
124
|
+
searchInput.value = '';
|
125
|
+
}
|
126
|
+
}
|
127
|
+
});
|
128
|
+
|
129
|
+
addEvent(searchInput, 'blur', function(){
|
130
|
+
setTimeout(function(){ hideResults() }, 300);
|
131
|
+
});
|
132
|
+
}
|
133
|
+
}
|
134
|
+
|
135
|
+
|
136
|
+
// Document ready
|
137
|
+
|
138
|
+
function ready(){
|
139
|
+
toggleNav();
|
140
|
+
initSearch();
|
141
|
+
}
|
142
|
+
|
143
|
+
// in case the document is already rendered
|
144
|
+
if (document.readyState!='loading') ready();
|
145
|
+
// modern browsers
|
146
|
+
else if (document.addEventListener) document.addEventListener('DOMContentLoaded', ready);
|
147
|
+
// IE <= 8
|
148
|
+
else document.attachEvent('onreadystatechange', function(){
|
149
|
+
if (document.readyState=='complete') ready();
|
150
|
+
});
|
@@ -0,0 +1,6 @@
|
|
1
|
+
/**
|
2
|
+
* lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 1.0.0
|
3
|
+
* Copyright (C) 2017 Oliver Nightingale
|
4
|
+
* @license MIT
|
5
|
+
*/
|
6
|
+
!function(){var t=function(e){var n=new t.Index;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),e&&e.call(n,n),n};t.version="1.0.0",t.utils={},t.utils.warn=function(t){return function(e){t.console&&console.warn&&console.warn(e)}}(this),t.utils.asString=function(t){return void 0===t||null===t?"":t.toString()},t.EventEmitter=function(){this.events={}},t.EventEmitter.prototype.addListener=function(){var t=Array.prototype.slice.call(arguments),e=t.pop(),n=t;if("function"!=typeof e)throw new TypeError("last argument must be a function");n.forEach(function(t){this.hasHandler(t)||(this.events[t]=[]),this.events[t].push(e)},this)},t.EventEmitter.prototype.removeListener=function(t,e){if(this.hasHandler(t)){var n=this.events[t].indexOf(e);this.events[t].splice(n,1),this.events[t].length||delete this.events[t]}},t.EventEmitter.prototype.emit=function(t){if(this.hasHandler(t)){var e=Array.prototype.slice.call(arguments,1);this.events[t].forEach(function(t){t.apply(void 0,e)})}},t.EventEmitter.prototype.hasHandler=function(t){return t in this.events},t.tokenizer=function(e){return arguments.length&&null!=e&&void 0!=e?Array.isArray(e)?e.map(function(e){return t.utils.asString(e).toLowerCase()}):e.toString().trim().toLowerCase().split(t.tokenizer.separator):[]},t.tokenizer.separator=/[\s\-]+/,t.tokenizer.load=function(t){var e=this.registeredFunctions[t];if(!e)throw new Error("Cannot load un-registered function: "+t);return e},t.tokenizer.label="default",t.tokenizer.registeredFunctions={"default":t.tokenizer},t.tokenizer.registerFunction=function(e,n){n in this.registeredFunctions&&t.utils.warn("Overwriting existing tokenizer: "+n),e.label=n,this.registeredFunctions[n]=e},t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions={},t.Pipeline.registerFunction=function(e,n){n in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(e){var i=t.Pipeline.registeredFunctions[e];if(!i)throw new Error("Cannot load un-registered function: "+e);n.add(i)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(e){t.Pipeline.warnIfFunctionNotRegistered(e),this._stack.push(e)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var i=this._stack.indexOf(e);if(-1==i)throw new Error("Cannot find existingFn");i+=1,this._stack.splice(i,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var i=this._stack.indexOf(e);if(-1==i)throw new Error("Cannot find existingFn");this._stack.splice(i,0,n)},t.Pipeline.prototype.remove=function(t){var e=this._stack.indexOf(t);-1!=e&&this._stack.splice(e,1)},t.Pipeline.prototype.run=function(t){for(var e=[],n=t.length,i=this._stack.length,r=0;n>r;r++){for(var o=t[r],s=0;i>s&&(o=this._stack[s](o,r,t),void 0!==o&&""!==o);s++);void 0!==o&&""!==o&&e.push(o)}return e},t.Pipeline.prototype.reset=function(){this._stack=[]},t.Pipeline.prototype.toJSON=function(){return this._stack.map(function(e){return t.Pipeline.warnIfFunctionNotRegistered(e),e.label})},t.Vector=function(){this._magnitude=null,this.list=void 0,this.length=0},t.Vector.Node=function(t,e,n){this.idx=t,this.val=e,this.next=n},t.Vector.prototype.insert=function(e,n){this._magnitude=void 0;var i=this.list;if(!i)return this.list=new t.Vector.Node(e,n,i),this.length++;if(e<i.idx)return this.list=new t.Vector.Node(e,n,i),this.length++;for(var r=i,o=i.next;void 0!=o;){if(e<o.idx)return r.next=new t.Vector.Node(e,n,o),this.length++;r=o,o=o.next}return r.next=new t.Vector.Node(e,n,o),this.length++},t.Vector.prototype.magnitude=function(){if(this._magnitude)return this._magnitude;for(var t,e=this.list,n=0;e;)t=e.val,n+=t*t,e=e.next;return this._magnitude=Math.sqrt(n)},t.Vector.prototype.dot=function(t){for(var e=this.list,n=t.list,i=0;e&&n;)e.idx<n.idx?e=e.next:e.idx>n.idx?n=n.next:(i+=e.val*n.val,e=e.next,n=n.next);return i},t.Vector.prototype.similarity=function(t){return this.dot(t)/(this.magnitude()*t.magnitude())},t.SortedSet=function(){this.length=0,this.elements=[]},t.SortedSet.load=function(t){var e=new this;return e.elements=t,e.length=t.length,e},t.SortedSet.prototype.add=function(){var t,e;for(t=0;t<arguments.length;t++)e=arguments[t],~this.indexOf(e)||this.elements.splice(this.locationFor(e),0,e);this.length=this.elements.length},t.SortedSet.prototype.toArray=function(){return this.elements.slice()},t.SortedSet.prototype.map=function(t,e){return this.elements.map(t,e)},t.SortedSet.prototype.forEach=function(t,e){return this.elements.forEach(t,e)},t.SortedSet.prototype.indexOf=function(t){for(var e=0,n=this.elements.length,i=n-e,r=e+Math.floor(i/2),o=this.elements[r];i>1;){if(o===t)return r;t>o&&(e=r),o>t&&(n=r),i=n-e,r=e+Math.floor(i/2),o=this.elements[r]}return o===t?r:-1},t.SortedSet.prototype.locationFor=function(t){for(var e=0,n=this.elements.length,i=n-e,r=e+Math.floor(i/2),o=this.elements[r];i>1;)t>o&&(e=r),o>t&&(n=r),i=n-e,r=e+Math.floor(i/2),o=this.elements[r];return o>t?r:t>o?r+1:void 0},t.SortedSet.prototype.intersect=function(e){for(var n=new t.SortedSet,i=0,r=0,o=this.length,s=e.length,a=this.elements,h=e.elements;;){if(i>o-1||r>s-1)break;a[i]!==h[r]?a[i]<h[r]?i++:a[i]>h[r]&&r++:(n.add(a[i]),i++,r++)}return n},t.SortedSet.prototype.clone=function(){var e=new t.SortedSet;return e.elements=this.toArray(),e.length=e.elements.length,e},t.SortedSet.prototype.union=function(t){var e,n,i;this.length>=t.length?(e=this,n=t):(e=t,n=this),i=e.clone();for(var r=0,o=n.toArray();r<o.length;r++)i.add(o[r]);return i},t.SortedSet.prototype.toJSON=function(){return this.toArray()},t.Index=function(){this._fields=[],this._ref="id",this.pipeline=new t.Pipeline,this.documentStore=new t.Store,this.tokenStore=new t.TokenStore,this.corpusTokens=new t.SortedSet,this.eventEmitter=new t.EventEmitter,this.tokenizerFn=t.tokenizer,this._idfCache={},this.on("add","remove","update",function(){this._idfCache={}}.bind(this))},t.Index.prototype.on=function(){var t=Array.prototype.slice.call(arguments);return this.eventEmitter.addListener.apply(this.eventEmitter,t)},t.Index.prototype.off=function(t,e){return this.eventEmitter.removeListener(t,e)},t.Index.load=function(e){e.version!==t.version&&t.utils.warn("version mismatch: current "+t.version+" importing "+e.version);var n=new this;return n._fields=e.fields,n._ref=e.ref,n.tokenizer(t.tokenizer.load(e.tokenizer)),n.documentStore=t.Store.load(e.documentStore),n.tokenStore=t.TokenStore.load(e.tokenStore),n.corpusTokens=t.SortedSet.load(e.corpusTokens),n.pipeline=t.Pipeline.load(e.pipeline),n},t.Index.prototype.field=function(t,e){var e=e||{},n={name:t,boost:e.boost||1};return this._fields.push(n),this},t.Index.prototype.ref=function(t){return this._ref=t,this},t.Index.prototype.tokenizer=function(e){var n=e.label&&e.label in t.tokenizer.registeredFunctions;return n||t.utils.warn("Function is not a registered tokenizer. This may cause problems when serialising the index"),this.tokenizerFn=e,this},t.Index.prototype.add=function(e,n){var i={},r=new t.SortedSet,o=e[this._ref],n=void 0===n?!0:n;this._fields.forEach(function(t){var n=this.pipeline.run(this.tokenizerFn(e[t.name]));i[t.name]=n;for(var o=0;o<n.length;o++){var s=n[o];r.add(s),this.corpusTokens.add(s)}},this),this.documentStore.set(o,r);for(var s=0;s<r.length;s++){for(var a=r.elements[s],h=0,u=0;u<this._fields.length;u++){var l=this._fields[u],c=i[l.name],f=c.length;if(f){for(var d=0,p=0;f>p;p++)c[p]===a&&d++;h+=d/f*l.boost}}this.tokenStore.add(a,{ref:o,tf:h})}n&&this.eventEmitter.emit("add",e,this)},t.Index.prototype.remove=function(t,e){var n=t[this._ref],e=void 0===e?!0:e;if(this.documentStore.has(n)){var i=this.documentStore.get(n);this.documentStore.remove(n),i.forEach(function(t){this.tokenStore.remove(t,n)},this),e&&this.eventEmitter.emit("remove",t,this)}},t.Index.prototype.update=function(t,e){var e=void 0===e?!0:e;this.remove(t,!1),this.add(t,!1),e&&this.eventEmitter.emit("update",t,this)},t.Index.prototype.idf=function(t){var e="@"+t;if(Object.prototype.hasOwnProperty.call(this._idfCache,e))return this._idfCache[e];var n=this.tokenStore.count(t),i=1;return n>0&&(i=1+Math.log(this.documentStore.length/n)),this._idfCache[e]=i},t.Index.prototype.search=function(e){var n=this.pipeline.run(this.tokenizerFn(e)),i=new t.Vector,r=[],o=this._fields.reduce(function(t,e){return t+e.boost},0),s=n.some(function(t){return this.tokenStore.has(t)},this);if(!s)return[];n.forEach(function(e,n,s){var a=1/s.length*this._fields.length*o,h=this,u=this.tokenStore.expand(e).reduce(function(n,r){var o=h.corpusTokens.indexOf(r),s=h.idf(r),u=1,l=new t.SortedSet;if(r!==e){var c=Math.max(3,r.length-e.length);u=1/Math.log(c)}o>-1&&i.insert(o,a*s*u);for(var f=h.tokenStore.get(r),d=Object.keys(f),p=d.length,v=0;p>v;v++)l.add(f[d[v]].ref);return n.union(l)},new t.SortedSet);r.push(u)},this);var a=r.reduce(function(t,e){return t.intersect(e)});return a.map(function(t){return{ref:t,score:i.similarity(this.documentVector(t))}},this).sort(function(t,e){return e.score-t.score})},t.Index.prototype.documentVector=function(e){for(var n=this.documentStore.get(e),i=n.length,r=new t.Vector,o=0;i>o;o++){var s=n.elements[o],a=this.tokenStore.get(s)[e].tf,h=this.idf(s);r.insert(this.corpusTokens.indexOf(s),a*h)}return r},t.Index.prototype.toJSON=function(){return{version:t.version,fields:this._fields,ref:this._ref,tokenizer:this.tokenizerFn.label,documentStore:this.documentStore.toJSON(),tokenStore:this.tokenStore.toJSON(),corpusTokens:this.corpusTokens.toJSON(),pipeline:this.pipeline.toJSON()}},t.Index.prototype.use=function(t){var e=Array.prototype.slice.call(arguments,1);e.unshift(this),t.apply(this,e)},t.Store=function(){this.store={},this.length=0},t.Store.load=function(e){var n=new this;return n.length=e.length,n.store=Object.keys(e.store).reduce(function(n,i){return n[i]=t.SortedSet.load(e.store[i]),n},{}),n},t.Store.prototype.set=function(t,e){this.has(t)||this.length++,this.store[t]=e},t.Store.prototype.get=function(t){return this.store[t]},t.Store.prototype.has=function(t){return t in this.store},t.Store.prototype.remove=function(t){this.has(t)&&(delete this.store[t],this.length--)},t.Store.prototype.toJSON=function(){return{store:this.store,length:this.length}},t.stemmer=function(){var t={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},e={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},n="[^aeiou]",i="[aeiouy]",r=n+"[^aeiouy]*",o=i+"[aeiou]*",s="^("+r+")?"+o+r,a="^("+r+")?"+o+r+"("+o+")?$",h="^("+r+")?"+o+r+o+r,u="^("+r+")?"+i,l=new RegExp(s),c=new RegExp(h),f=new RegExp(a),d=new RegExp(u),p=/^(.+?)(ss|i)es$/,v=/^(.+?)([^s])s$/,g=/^(.+?)eed$/,m=/^(.+?)(ed|ing)$/,y=/.$/,S=/(at|bl|iz)$/,w=new RegExp("([^aeiouylsz])\\1$"),k=new RegExp("^"+r+i+"[^aeiouwxy]$"),x=/^(.+?[^aeiou])y$/,b=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,E=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,F=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,_=/^(.+?)(s|t)(ion)$/,z=/^(.+?)e$/,O=/ll$/,P=new RegExp("^"+r+i+"[^aeiouwxy]$"),T=function(n){var i,r,o,s,a,h,u;if(n.length<3)return n;if(o=n.substr(0,1),"y"==o&&(n=o.toUpperCase()+n.substr(1)),s=p,a=v,s.test(n)?n=n.replace(s,"$1$2"):a.test(n)&&(n=n.replace(a,"$1$2")),s=g,a=m,s.test(n)){var T=s.exec(n);s=l,s.test(T[1])&&(s=y,n=n.replace(s,""))}else if(a.test(n)){var T=a.exec(n);i=T[1],a=d,a.test(i)&&(n=i,a=S,h=w,u=k,a.test(n)?n+="e":h.test(n)?(s=y,n=n.replace(s,"")):u.test(n)&&(n+="e"))}if(s=x,s.test(n)){var T=s.exec(n);i=T[1],n=i+"i"}if(s=b,s.test(n)){var T=s.exec(n);i=T[1],r=T[2],s=l,s.test(i)&&(n=i+t[r])}if(s=E,s.test(n)){var T=s.exec(n);i=T[1],r=T[2],s=l,s.test(i)&&(n=i+e[r])}if(s=F,a=_,s.test(n)){var T=s.exec(n);i=T[1],s=c,s.test(i)&&(n=i)}else if(a.test(n)){var T=a.exec(n);i=T[1]+T[2],a=c,a.test(i)&&(n=i)}if(s=z,s.test(n)){var T=s.exec(n);i=T[1],s=c,a=f,h=P,(s.test(i)||a.test(i)&&!h.test(i))&&(n=i)}return s=O,a=c,s.test(n)&&a.test(n)&&(s=y,n=n.replace(s,"")),"y"==o&&(n=o.toLowerCase()+n.substr(1)),n};return T}(),t.Pipeline.registerFunction(t.stemmer,"stemmer"),t.generateStopWordFilter=function(t){var e=t.reduce(function(t,e){return t[e]=e,t},{});return function(t){return t&&e[t]!==t?t:void 0}},t.stopWordFilter=t.generateStopWordFilter(["a","able","about","across","after","all","almost","also","am","among","an","and","any","are","as","at","be","because","been","but","by","can","cannot","could","dear","did","do","does","either","else","ever","every","for","from","get","got","had","has","have","he","her","hers","him","his","how","however","i","if","in","into","is","it","its","just","least","let","like","likely","may","me","might","most","must","my","neither","no","nor","not","of","off","often","on","only","or","other","our","own","rather","said","say","says","she","should","since","so","some","than","that","the","their","them","then","there","these","they","this","tis","to","too","twas","us","wants","was","we","were","what","when","where","which","while","who","whom","why","will","with","would","yet","you","your"]),t.Pipeline.registerFunction(t.stopWordFilter,"stopWordFilter"),t.trimmer=function(t){return t.replace(/^\W+/,"").replace(/\W+$/,"")},t.Pipeline.registerFunction(t.trimmer,"trimmer"),t.TokenStore=function(){this.root={docs:{}},this.length=0},t.TokenStore.load=function(t){var e=new this;return e.root=t.root,e.length=t.length,e},t.TokenStore.prototype.add=function(t,e,n){var n=n||this.root,i=t.charAt(0),r=t.slice(1);return i in n||(n[i]={docs:{}}),0===r.length?(n[i].docs[e.ref]=e,void(this.length+=1)):this.add(r,e,n[i])},t.TokenStore.prototype.has=function(t){if(!t)return!1;for(var e=this.root,n=0;n<t.length;n++){if(!e[t.charAt(n)])return!1;e=e[t.charAt(n)]}return!0},t.TokenStore.prototype.getNode=function(t){if(!t)return{};for(var e=this.root,n=0;n<t.length;n++){if(!e[t.charAt(n)])return{};e=e[t.charAt(n)]}return e},t.TokenStore.prototype.get=function(t,e){return this.getNode(t,e).docs||{}},t.TokenStore.prototype.count=function(t,e){return Object.keys(this.get(t,e)).length},t.TokenStore.prototype.remove=function(t,e){if(t){for(var n=this.root,i=0;i<t.length;i++){if(!(t.charAt(i)in n))return;n=n[t.charAt(i)]}delete n.docs[e]}},t.TokenStore.prototype.expand=function(t,e){var n=this.getNode(t),i=n.docs||{},e=e||[];return Object.keys(i).length&&e.push(t),Object.keys(n).forEach(function(n){"docs"!==n&&e.concat(this.expand(t+n,e))},this),e},t.TokenStore.prototype.toJSON=function(){return{root:this.root,length:this.length}},function(t,e){"function"==typeof define&&define.amd?define(e):"object"==typeof exports?module.exports=e():t.lunr=e()}(this,function(){return t})}();
|
data/bin/just-the-docs
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
gem_dir = File.expand_path("..",File.dirname(__FILE__))
|
4
|
+
$LOAD_PATH.unshift gem_dir# Look in gem directory for resources first.
|
5
|
+
exec_type = ARGV[0]
|
6
|
+
|
7
|
+
if exec_type == 'rake' then
|
8
|
+
require 'rake'
|
9
|
+
require 'pp'
|
10
|
+
pwd=Dir.pwd
|
11
|
+
Dir.chdir(gem_dir) # We'll load rakefile from the gem's dir.
|
12
|
+
Rake.application.init
|
13
|
+
Rake.application.load_rakefile
|
14
|
+
Dir.chdir(pwd) # Revert to original pwd for any path args passed to task.
|
15
|
+
Rake.application.invoke_task(ARGV[1])
|
16
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
namespace :search do
|
2
|
+
desc 'Generate the files needed for search functionality'
|
3
|
+
task :init do
|
4
|
+
puts 'Creating search data json file...'
|
5
|
+
touch 'search-data.json'
|
6
|
+
content = %Q[{{ page.content | markdownify | strip_html | xml_escape | remove: 'Table of contents' | strip_newlines | replace: '\\', ' ' }}]
|
7
|
+
|
8
|
+
File.open('search-data.json', 'w') do |f|
|
9
|
+
f.puts '---
|
10
|
+
---
|
11
|
+
{
|
12
|
+
{% for page in site.html_pages %}"{{ forloop.index0 }}": {
|
13
|
+
"id": "{{ forloop.index0 }}",
|
14
|
+
"title": "{{ page.title | xml_escape }}",
|
15
|
+
"content": "'+content+'",
|
16
|
+
"url": "{{ page.url | xml_escape }}"
|
17
|
+
}{% if forloop.last %}{% else %},
|
18
|
+
{% endif %}{% endfor %}
|
19
|
+
}'
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
metadata
ADDED
@@ -0,0 +1,129 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: just-the-docs
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Patrick Marsceill
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-10-22 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: jekyll
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '3.3'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '3.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.12'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.12'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '10.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '10.0'
|
55
|
+
description:
|
56
|
+
email:
|
57
|
+
- patrick.marsceill@gmail.com
|
58
|
+
executables:
|
59
|
+
- just-the-docs
|
60
|
+
extensions: []
|
61
|
+
extra_rdoc_files: []
|
62
|
+
files:
|
63
|
+
- LICENSE.txt
|
64
|
+
- README.md
|
65
|
+
- Rakefile
|
66
|
+
- _includes/head.html
|
67
|
+
- _includes/nav.html
|
68
|
+
- _layouts/default.html
|
69
|
+
- _layouts/post.html
|
70
|
+
- _sass/base.scss
|
71
|
+
- _sass/buttons.scss
|
72
|
+
- _sass/code.scss
|
73
|
+
- _sass/content.scss
|
74
|
+
- _sass/custom/custom.scss
|
75
|
+
- _sass/labels.scss
|
76
|
+
- _sass/layout.scss
|
77
|
+
- _sass/navigation.scss
|
78
|
+
- _sass/normalize.scss/README.md
|
79
|
+
- _sass/normalize.scss/normalize.scss
|
80
|
+
- _sass/normalize.scss/package.json
|
81
|
+
- _sass/search.scss
|
82
|
+
- _sass/support/_functions.scss
|
83
|
+
- _sass/support/_variables.scss
|
84
|
+
- _sass/support/mixins/_buttons.scss
|
85
|
+
- _sass/support/mixins/_layout.scss
|
86
|
+
- _sass/support/mixins/_typography.scss
|
87
|
+
- _sass/support/mixins/mixins.scss
|
88
|
+
- _sass/support/support.scss
|
89
|
+
- _sass/tables.scss
|
90
|
+
- _sass/typography.scss
|
91
|
+
- _sass/utilities/_colors.scss
|
92
|
+
- _sass/utilities/_layout.scss
|
93
|
+
- _sass/utilities/_lists.scss
|
94
|
+
- _sass/utilities/_spacing.scss
|
95
|
+
- _sass/utilities/_typography.scss
|
96
|
+
- _sass/utilities/utilities.scss
|
97
|
+
- assets/css/just-the-docs.scss
|
98
|
+
- assets/images/just-the-docs.png
|
99
|
+
- assets/images/search.svg
|
100
|
+
- assets/js/just-the-docs.js
|
101
|
+
- assets/js/vendor/lunr.min.js
|
102
|
+
- bin/just-the-docs
|
103
|
+
- lib/tasks/search.rake
|
104
|
+
homepage: https://github.com/pmarsceill/just-the-docs
|
105
|
+
licenses:
|
106
|
+
- MIT
|
107
|
+
metadata: {}
|
108
|
+
post_install_message:
|
109
|
+
rdoc_options: []
|
110
|
+
require_paths:
|
111
|
+
- lib
|
112
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - ">="
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '0'
|
117
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
118
|
+
requirements:
|
119
|
+
- - ">="
|
120
|
+
- !ruby/object:Gem::Version
|
121
|
+
version: '0'
|
122
|
+
requirements: []
|
123
|
+
rubyforge_project:
|
124
|
+
rubygems_version: 2.5.1
|
125
|
+
signing_key:
|
126
|
+
specification_version: 4
|
127
|
+
summary: A nice looking, high customizable, responsive Jekyll theme for documention
|
128
|
+
with built-in search.
|
129
|
+
test_files: []
|