From ab01de4d077206a8fede70da5bf588cdb7e0bb40 Mon Sep 17 00:00:00 2001 From: Dave Henderson Date: Mon, 15 Apr 2019 19:43:48 -0400 Subject: Adding search functionality to docs site Signed-off-by: Dave Henderson --- docs/config.toml | 14 +- docs/content/search.md | 31 + docs/layouts/_default/index.json | 5 + docs/layouts/partials/footer.html | 74 ++ docs/layouts/partials/footer_js.html | 91 ++ docs/layouts/partials/header.html | 48 + docs/static/js/application.js | 1577 +++++++++++++++++++++++++++++++ docs/static/js/search.js | 132 +++ docs/static/stylesheets/application.css | 1386 +++++++++++++++++++++++++++ docs/static/stylesheets/search.css | 22 + 10 files changed, 3379 insertions(+), 1 deletion(-) create mode 100644 docs/content/search.md create mode 100644 docs/layouts/_default/index.json create mode 100644 docs/layouts/partials/footer.html create mode 100644 docs/layouts/partials/footer_js.html create mode 100644 docs/layouts/partials/header.html create mode 100644 docs/static/js/application.js create mode 100644 docs/static/js/search.js create mode 100644 docs/static/stylesheets/application.css create mode 100644 docs/static/stylesheets/search.css diff --git a/docs/config.toml b/docs/config.toml index 59e3a6c4..c577f104 100644 --- a/docs/config.toml +++ b/docs/config.toml @@ -12,7 +12,16 @@ googleAnalytics = "UA-82637990-3" repo_url = "https://github.com/hairyhenderson/gomplate" logo = "images/gomplate-icon.svg" favicon = "favicon.ico" - custom_css = ["stylesheets/custom-palettes.css"] + custom_css = [ + "stylesheets/search.css", + "stylesheets/custom-palettes.css", + ] + custom_js = [ + "https://code.jquery.com/jquery-3.3.1.min.js", + "https://cdnjs.cloudflare.com/ajax/libs/fuse.js/3.4.4/fuse.min.js", + "https://cdnjs.cloudflare.com/ajax/libs/mark.js/8.11.1/jquery.mark.min.js", + "js/search.js" + ] [params.palette] primary = "spalding-gray" @@ -21,3 +30,6 @@ googleAnalytics = "UA-82637990-3" [social] twitter = "hairyhenderson" github = "hairyhenderson" + +[outputs] + home = ["HTML", "RSS", "JSON"] diff --git a/docs/content/search.md b/docs/content/search.md new file mode 100644 index 00000000..a8bf9610 --- /dev/null +++ b/docs/content/search.md @@ -0,0 +1,31 @@ +--- +title: "Search Results" +sitemap: + priority : 0.1 +--- + +## Results for _""_ + +

+Showing results... +

+ +
+
+
+
+ + + diff --git a/docs/layouts/_default/index.json b/docs/layouts/_default/index.json new file mode 100644 index 00000000..c93f8057 --- /dev/null +++ b/docs/layouts/_default/index.json @@ -0,0 +1,5 @@ +{{- $.Scratch.Add "index" slice -}} +{{- range .Site.RegularPages -}} + {{- $.Scratch.Add "index" (dict "title" .Title "tags" .Params.tags "categories" .Params.categories "contents" .Plain "permalink" .Permalink) -}} +{{- end -}} +{{- $.Scratch.Get "index" | jsonify -}} diff --git a/docs/layouts/partials/footer.html b/docs/layouts/partials/footer.html new file mode 100644 index 00000000..70f391dc --- /dev/null +++ b/docs/layouts/partials/footer.html @@ -0,0 +1,74 @@ +{{ if .IsPage }} +{{ if .NextPage | or .PrevPage }} + +{{ end }} +{{ end }} + +{{ if .IsHome }} +{{ if gt (len .Site.Pages) 2 }} + +{{ end }} +{{ end }} diff --git a/docs/layouts/partials/footer_js.html b/docs/layouts/partials/footer_js.html new file mode 100644 index 00000000..14a9acd7 --- /dev/null +++ b/docs/layouts/partials/footer_js.html @@ -0,0 +1,91 @@ + + + + {{ range .Site.Params.custom_js }} + + {{ end }} + + + + {{ with .Site.GoogleAnalytics }} + + {{ end }} + + + + + diff --git a/docs/layouts/partials/header.html b/docs/layouts/partials/header.html new file mode 100644 index 00000000..52e80239 --- /dev/null +++ b/docs/layouts/partials/header.html @@ -0,0 +1,48 @@ + diff --git a/docs/static/js/application.js b/docs/static/js/application.js new file mode 100644 index 00000000..6245bb4f --- /dev/null +++ b/docs/static/js/application.js @@ -0,0 +1,1577 @@ +function pegasus(t, e) { + return ( + (e = new XMLHttpRequest()), + e.open("GET", t), + (t = []), + (e.onreadystatechange = e.then = function (n, o, i, r) { + if ( + (n && n.call && (t = [, n, o]), + 4 == e.readyState && (i = t[0 | (e.status / 200)])) + ) { + try { + r = JSON.parse(e.responseText); + } catch (s) { + r = null; + } + i(r, e); + } + }), + e.send(), + e + ); +} +if ( + ("document" in self && + ("classList" in document.createElement("_") + ? !(function () { + "use strict"; + var t = document.createElement("_"); + if ((t.classList.add("c1", "c2"), !t.classList.contains("c2"))) { + var e = function (t) { + var e = DOMTokenList.prototype[t]; + DOMTokenList.prototype[t] = function (t) { + var n, + o = arguments.length; + for (n = 0; o > n; n++) (t = arguments[n]), e.call(this, t); + }; + }; + e("add"), e("remove"); + } + if ((t.classList.toggle("c3", !1), t.classList.contains("c3"))) { + var n = DOMTokenList.prototype.toggle; + DOMTokenList.prototype.toggle = function (t, e) { + return 1 in arguments && !this.contains(t) == !e + ? e + : n.call(this, t); + }; + } + t = null; + })() + : !(function (t) { + "use strict"; + if ("Element" in t) { + var e = "classList", + n = "prototype", + o = t.Element[n], + i = Object, + r = + String[n].trim || + function () { + return this.replace(/^\s+|\s+$/g, ""); + }, + s = + Array[n].indexOf || + function (t) { + for (var e = 0, n = this.length; n > e; e++) + if (e in this && this[e] === t) return e; + return -1; + }, + a = function (t, e) { + (this.name = t), + (this.code = DOMException[t]), + (this.message = e); + }, + c = function (t, e) { + if ("" === e) + throw new a( + "SYNTAX_ERR", + "An invalid or illegal string was specified" + ); + if (/\s/.test(e)) + throw new a( + "INVALID_CHARACTER_ERR", + "String contains an invalid character" + ); + return s.call(t, e); + }, + l = function (t) { + for ( + var e = r.call(t.getAttribute("class") || ""), + n = e ? e.split(/\s+/) : [], + o = 0, + i = n.length; + i > o; + o++ + ) + this.push(n[o]); + this._updateClassName = function () { + t.setAttribute("class", this.toString()); + }; + }, + u = (l[n] = []), + d = function () { + return new l(this); + }; + if ( + ((a[n] = Error[n]), + (u.item = function (t) { + return this[t] || null; + }), + (u.contains = function (t) { + return (t += ""), -1 !== c(this, t); + }), + (u.add = function () { + var t, + e = arguments, + n = 0, + o = e.length, + i = !1; + do + (t = e[n] + ""), + -1 === c(this, t) && (this.push(t), (i = !0)); + while (++n < o); + i && this._updateClassName(); + }), + (u.remove = function () { + var t, + e, + n = arguments, + o = 0, + i = n.length, + r = !1; + do + for (t = n[o] + "", e = c(this, t); -1 !== e;) + this.splice(e, 1), (r = !0), (e = c(this, t)); + while (++o < i); + r && this._updateClassName(); + }), + (u.toggle = function (t, e) { + t += ""; + var n = this.contains(t), + o = n ? e !== !0 && "remove" : e !== !1 && "add"; + return o && this[o](t), e === !0 || e === !1 ? e : !n; + }), + (u.toString = function () { + return this.join(" "); + }), + i.defineProperty) + ) { + var h = { get: d, enumerable: !0, configurable: !0 }; + try { + i.defineProperty(o, e, h); + } catch (f) { + -2146823252 === f.number && + ((h.enumerable = !1), i.defineProperty(o, e, h)); + } + } else i[n].__defineGetter__ && o.__defineGetter__(e, d); + } + })(self)), + (function () { + "use strict"; + function t(e, o) { + function i(t, e) { + return function () { + return t.apply(e, arguments); + }; + } + var r; + if ( + ((o = o || {}), + (this.trackingClick = !1), + (this.trackingClickStart = 0), + (this.targetElement = null), + (this.touchStartX = 0), + (this.touchStartY = 0), + (this.lastTouchIdentifier = 0), + (this.touchBoundary = o.touchBoundary || 10), + (this.layer = e), + (this.tapDelay = o.tapDelay || 200), + (this.tapTimeout = o.tapTimeout || 700), + !t.notNeeded(e)) + ) { + for ( + var s = [ + "onMouse", + "onClick", + "onTouchStart", + "onTouchMove", + "onTouchEnd", + "onTouchCancel" + ], + a = this, + c = 0, + l = s.length; + l > c; + c++ + ) + a[s[c]] = i(a[s[c]], a); + n && + (e.addEventListener("mouseover", this.onMouse, !0), + e.addEventListener("mousedown", this.onMouse, !0), + e.addEventListener("mouseup", this.onMouse, !0)), + e.addEventListener("click", this.onClick, !0), + e.addEventListener("touchstart", this.onTouchStart, !1), + e.addEventListener("touchmove", this.onTouchMove, !1), + e.addEventListener("touchend", this.onTouchEnd, !1), + e.addEventListener("touchcancel", this.onTouchCancel, !1), + Event.prototype.stopImmediatePropagation || + ((e.removeEventListener = function (t, n, o) { + var i = Node.prototype.removeEventListener; + "click" === t + ? i.call(e, t, n.hijacked || n, o) + : i.call(e, t, n, o); + }), + (e.addEventListener = function (t, n, o) { + var i = Node.prototype.addEventListener; + "click" === t + ? i.call( + e, + t, + n.hijacked || + (n.hijacked = function (t) { + t.propagationStopped || n(t); + }), + o + ) + : i.call(e, t, n, o); + })), + "function" == typeof e.onclick && + ((r = e.onclick), + e.addEventListener( + "click", + function (t) { + r(t); + }, + !1 + ), + (e.onclick = null)); + } + } + var e = navigator.userAgent.indexOf("Windows Phone") >= 0, + n = navigator.userAgent.indexOf("Android") > 0 && !e, + o = /iP(ad|hone|od)/.test(navigator.userAgent) && !e, + i = o && /OS 4_\d(_\d)?/.test(navigator.userAgent), + r = o && /OS [6-7]_\d/.test(navigator.userAgent), + s = navigator.userAgent.indexOf("BB10") > 0; + (t.prototype.needsClick = function (t) { + switch (t.nodeName.toLowerCase()) { + case "button": + case "select": + case "textarea": + if (t.disabled) return !0; + break; + case "input": + if ((o && "file" === t.type) || t.disabled) return !0; + break; + case "label": + case "iframe": + case "video": + return !0; + } + return /\bneedsclick\b/.test(t.className); + }), + (t.prototype.needsFocus = function (t) { + switch (t.nodeName.toLowerCase()) { + case "textarea": + return !0; + case "select": + return !n; + case "input": + switch (t.type) { + case "button": + case "checkbox": + case "file": + case "image": + case "radio": + case "submit": + return !1; + } + return !t.disabled && !t.readOnly; + default: + return /\bneedsfocus\b/.test(t.className); + } + }), + (t.prototype.sendClick = function (t, e) { + var n, o; + document.activeElement && + document.activeElement !== t && + document.activeElement.blur(), + (o = e.changedTouches[0]), + (n = document.createEvent("MouseEvents")), + n.initMouseEvent( + this.determineEventType(t), + !0, + !0, + window, + 1, + o.screenX, + o.screenY, + o.clientX, + o.clientY, + !1, + !1, + !1, + !1, + 0, + null + ), + (n.forwardedTouchEvent = !0), + t.dispatchEvent(n); + }), + (t.prototype.determineEventType = function (t) { + return n && "select" === t.tagName.toLowerCase() + ? "mousedown" + : "click"; + }), + (t.prototype.focus = function (t) { + var e; + o && + t.setSelectionRange && + 0 !== t.type.indexOf("date") && + "time" !== t.type && + "month" !== t.type + ? ((e = t.value.length), t.setSelectionRange(e, e)) + : t.focus(); + }), + (t.prototype.updateScrollParent = function (t) { + var e, n; + if (((e = t.fastClickScrollParent), !e || !e.contains(t))) { + n = t; + do { + if (n.scrollHeight > n.offsetHeight) { + (e = n), (t.fastClickScrollParent = n); + break; + } + n = n.parentElement; + } while (n); + } + e && (e.fastClickLastScrollTop = e.scrollTop); + }), + (t.prototype.getTargetElementFromEventTarget = function (t) { + return t.nodeType === Node.TEXT_NODE ? t.parentNode : t; + }), + (t.prototype.onTouchStart = function (t) { + var e, n, r; + if (t.targetTouches.length > 1) return !0; + if ( + ((e = this.getTargetElementFromEventTarget(t.target)), + (n = t.targetTouches[0]), + o) + ) { + if (((r = window.getSelection()), r.rangeCount && !r.isCollapsed)) + return !0; + if (!i) { + if (n.identifier && n.identifier === this.lastTouchIdentifier) + return t.preventDefault(), !1; + (this.lastTouchIdentifier = n.identifier), + this.updateScrollParent(e); + } + } + return ( + (this.trackingClick = !0), + (this.trackingClickStart = t.timeStamp), + (this.targetElement = e), + (this.touchStartX = n.pageX), + (this.touchStartY = n.pageY), + t.timeStamp - this.lastClickTime < this.tapDelay && + t.preventDefault(), + !0 + ); + }), + (t.prototype.touchHasMoved = function (t) { + var e = t.changedTouches[0], + n = this.touchBoundary; + return Math.abs(e.pageX - this.touchStartX) > n || + Math.abs(e.pageY - this.touchStartY) > n + ? !0 + : !1; + }), + (t.prototype.onTouchMove = function (t) { + return this.trackingClick + ? ((this.targetElement !== + this.getTargetElementFromEventTarget(t.target) || + this.touchHasMoved(t)) && + ((this.trackingClick = !1), (this.targetElement = null)), + !0) + : !0; + }), + (t.prototype.findControl = function (t) { + return void 0 !== t.control + ? t.control + : t.htmlFor + ? document.getElementById(t.htmlFor) + : t.querySelector( + "button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea" + ); + }), + (t.prototype.onTouchEnd = function (t) { + var e, + s, + a, + c, + l, + u = this.targetElement; + if (!this.trackingClick) return !0; + if (t.timeStamp - this.lastClickTime < this.tapDelay) + return (this.cancelNextClick = !0), !0; + if (t.timeStamp - this.trackingClickStart > this.tapTimeout) return !0; + if ( + ((this.cancelNextClick = !1), + (this.lastClickTime = t.timeStamp), + (s = this.trackingClickStart), + (this.trackingClick = !1), + (this.trackingClickStart = 0), + r && + ((l = t.changedTouches[0]), + (u = + document.elementFromPoint( + l.pageX - window.pageXOffset, + l.pageY - window.pageYOffset + ) || u), + (u.fastClickScrollParent = this.targetElement.fastClickScrollParent)), + (a = u.tagName.toLowerCase()), + "label" === a) + ) { + if ((e = this.findControl(u))) { + if ((this.focus(u), n)) return !1; + u = e; + } + } else if (this.needsFocus(u)) + return t.timeStamp - s > 100 || + (o && window.top !== window && "input" === a) + ? ((this.targetElement = null), !1) + : (this.focus(u), + this.sendClick(u, t), + (o && "select" === a) || + ((this.targetElement = null), t.preventDefault()), + !1); + return o && + !i && + ((c = u.fastClickScrollParent), + c && c.fastClickLastScrollTop !== c.scrollTop) + ? !0 + : (this.needsClick(u) || (t.preventDefault(), this.sendClick(u, t)), + !1); + }), + (t.prototype.onTouchCancel = function () { + (this.trackingClick = !1), (this.targetElement = null); + }), + (t.prototype.onMouse = function (t) { + return this.targetElement + ? t.forwardedTouchEvent + ? !0 + : t.cancelable && + (!this.needsClick(this.targetElement) || this.cancelNextClick) + ? (t.stopImmediatePropagation + ? t.stopImmediatePropagation() + : (t.propagationStopped = !0), + t.stopPropagation(), + t.preventDefault(), + !1) + : !0 + : !0; + }), + (t.prototype.onClick = function (t) { + var e; + return this.trackingClick + ? ((this.targetElement = null), (this.trackingClick = !1), !0) + : "submit" === t.target.type && 0 === t.detail + ? !0 + : ((e = this.onMouse(t)), e || (this.targetElement = null), e); + }), + (t.prototype.destroy = function () { + var t = this.layer; + n && + (t.removeEventListener("mouseover", this.onMouse, !0), + t.removeEventListener("mousedown", this.onMouse, !0), + t.removeEventListener("mouseup", this.onMouse, !0)), + t.removeEventListener("click", this.onClick, !0), + t.removeEventListener("touchstart", this.onTouchStart, !1), + t.removeEventListener("touchmove", this.onTouchMove, !1), + t.removeEventListener("touchend", this.onTouchEnd, !1), + t.removeEventListener("touchcancel", this.onTouchCancel, !1); + }), + (t.notNeeded = function (t) { + var e, o, i, r; + if ("undefined" == typeof window.ontouchstart) return !0; + if ((o = +(/Chrome\/([0-9]+)/.exec(navigator.userAgent) || [, 0])[1])) { + if (!n) return !0; + if ((e = document.querySelector("meta[name=viewport]"))) { + if (-1 !== e.content.indexOf("user-scalable=no")) return !0; + if ( + o > 31 && + document.documentElement.scrollWidth <= window.outerWidth + ) + return !0; + } + } + if ( + s && + ((i = navigator.userAgent.match(/Version\/([0-9]*)\.([0-9]*)/)), + i[1] >= 10 && + i[2] >= 3 && + (e = document.querySelector("meta[name=viewport]"))) + ) { + if (-1 !== e.content.indexOf("user-scalable=no")) return !0; + if (document.documentElement.scrollWidth <= window.outerWidth) + return !0; + } + return "none" === t.style.msTouchAction || + "manipulation" === t.style.touchAction + ? !0 + : ((r = +(/Firefox\/([0-9]+)/.exec(navigator.userAgent) || [, 0])[1]), + r >= 27 && + ((e = document.querySelector("meta[name=viewport]")), + e && + (-1 !== e.content.indexOf("user-scalable=no") || + document.documentElement.scrollWidth <= window.outerWidth)) + ? !0 + : "none" === t.style.touchAction || + "manipulation" === t.style.touchAction + ? !0 + : !1); + }), + (t.attach = function (e, n) { + return new t(e, n); + }), + "function" == typeof define && "object" == typeof define.amd && define.amd + ? define(function () { + return t; + }) + : "undefined" != typeof module && module.exports + ? ((module.exports = t.attach), (module.exports.FastClick = t)) + : (window.FastClick = t); + })(), + (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 = "0.6.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.seperator) + : []; + }), + (t.tokenizer.seperator = /[\s\-]+/), + (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 o = t.Pipeline.registeredFunctions[e]; + if (!o) throw new Error("Cannot load un-registered function: " + e); + n.add(o); + }), + 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 o = this._stack.indexOf(e); + if (-1 == o) throw new Error("Cannot find existingFn"); + (o += 1), this._stack.splice(o, 0, n); + }), + (t.Pipeline.prototype.before = function (e, n) { + t.Pipeline.warnIfFunctionNotRegistered(n); + var o = this._stack.indexOf(e); + if (-1 == o) throw new Error("Cannot find existingFn"); + this._stack.splice(o, 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, o = this._stack.length, i = 0; + n > i; + i++ + ) { + for ( + var r = t[i], s = 0; + o > s && ((r = this._stack[s](r, i, t)), void 0 !== r && "" !== r); + s++ + ); + void 0 !== r && "" !== r && e.push(r); + } + 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 o = this.list; + if (!o) return (this.list = new t.Vector.Node(e, n, o)), this.length++; + if (e < o.idx) + return (this.list = new t.Vector.Node(e, n, o)), this.length++; + for (var i = o, r = o.next; void 0 != r;) { + if (e < r.idx) + return (i.next = new t.Vector.Node(e, n, r)), this.length++; + (i = r), (r = r.next); + } + return (i.next = new t.Vector.Node(e, n, r)), 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, o = 0; e && n;) + e.idx < n.idx + ? (e = e.next) + : e.idx > n.idx + ? (n = n.next) + : ((o += e.val * n.val), (e = e.next), (n = n.next)); + return o; + }), + (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, + o = n - e, + i = e + Math.floor(o / 2), + r = this.elements[i]; + o > 1; + + ) { + if (r === t) return i; + t > r && (e = i), + r > t && (n = i), + (o = n - e), + (i = e + Math.floor(o / 2)), + (r = this.elements[i]); + } + return r === t ? i : -1; + }), + (t.SortedSet.prototype.locationFor = function (t) { + for ( + var e = 0, + n = this.elements.length, + o = n - e, + i = e + Math.floor(o / 2), + r = this.elements[i]; + o > 1; + + ) + t > r && (e = i), + r > t && (n = i), + (o = n - e), + (i = e + Math.floor(o / 2)), + (r = this.elements[i]); + return r > t ? i : t > r ? i + 1 : void 0; + }), + (t.SortedSet.prototype.intersect = function (e) { + for ( + var n = new t.SortedSet(), + o = 0, + i = 0, + r = this.length, + s = e.length, + a = this.elements, + c = e.elements; + ; + + ) { + if (o > r - 1 || i > s - 1) break; + a[o] !== c[i] + ? a[o] < c[i] + ? o++ + : a[o] > c[i] && i++ + : (n.add(a[o]), o++ , i++); + } + 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, o; + return ( + this.length >= t.length + ? ((e = this), (n = t)) + : ((e = t), (n = this)), + (o = e.clone()), + o.add.apply(o, n.toArray()), + o + ); + }), + (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._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.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.add = function (e, n) { + var o = {}, + i = new t.SortedSet(), + r = e[this._ref], + n = void 0 === n ? !0 : n; + this._fields.forEach(function (n) { + var r = this.pipeline.run(t.tokenizer(e[n.name])); + (o[n.name] = r), t.SortedSet.prototype.add.apply(i, r); + }, this), + this.documentStore.set(r, i), + t.SortedSet.prototype.add.apply(this.corpusTokens, i.toArray()); + for (var s = 0; s < i.length; s++) { + var a = i.elements[s], + c = this._fields.reduce(function (t, e) { + var n = o[e.name].length; + if (!n) return t; + var i = o[e.name].filter(function (t) { + return t === a; + }).length; + return t + (i / n) * e.boost; + }, 0); + this.tokenStore.add(a, { ref: r, tf: c }); + } + 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 o = this.documentStore.get(n); + this.documentStore.remove(n), + o.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), + o = 1; + return ( + n > 0 && (o = 1 + Math.log(this.documentStore.length / n)), + (this._idfCache[e] = o) + ); + }), + (t.Index.prototype.search = function (e) { + var n = this.pipeline.run(t.tokenizer(e)), + o = new t.Vector(), + i = [], + r = 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 * r, + c = this, + l = this.tokenStore.expand(e).reduce(function (n, i) { + var r = c.corpusTokens.indexOf(i), + s = c.idf(i), + l = 1, + u = new t.SortedSet(); + if (i !== e) { + var d = Math.max(3, i.length - e.length); + l = 1 / Math.log(d); + } + r > -1 && o.insert(r, a * s * l); + for ( + var h = c.tokenStore.get(i), + f = Object.keys(h), + p = f.length, + m = 0; + p > m; + m++ + ) + u.add(h[f[m]].ref); + return n.union(u); + }, new t.SortedSet()); + i.push(l); + }, this); + var a = i.reduce(function (t, e) { + return t.intersect(e); + }); + return a + .map(function (t) { + return { ref: t, score: o.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), + o = n.length, + i = new t.Vector(), + r = 0; + o > r; + r++ + ) { + var s = n.elements[r], + a = this.tokenStore.get(s)[e].tf, + c = this.idf(s); + i.insert(this.corpusTokens.indexOf(s), a * c); + } + return i; + }), + (t.Index.prototype.toJSON = function () { + return { + version: t.version, + fields: this._fields, + ref: this._ref, + 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, o) { + return (n[o] = t.SortedSet.load(e.store[o])), 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]", + o = "[aeiouy]", + i = n + "[^aeiouy]*", + r = o + "[aeiou]*", + s = "^(" + i + ")?" + r + i, + a = "^(" + i + ")?" + r + i + "(" + r + ")?$", + c = "^(" + i + ")?" + r + i + r + i, + l = "^(" + i + ")?" + o, + u = new RegExp(s), + d = new RegExp(c), + h = new RegExp(a), + f = new RegExp(l), + p = /^(.+?)(ss|i)es$/, + m = /^(.+?)([^s])s$/, + v = /^(.+?)eed$/, + g = /^(.+?)(ed|ing)$/, + y = /.$/, + w = /(at|bl|iz)$/, + S = new RegExp("([^aeiouylsz])\\1$"), + k = new RegExp("^" + i + o + "[^aeiouwxy]$"), + E = /^(.+?[^aeiou])y$/, + x = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/, + b = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/, + T = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/, + C = /^(.+?)(s|t)(ion)$/, + L = /^(.+?)e$/, + _ = /ll$/, + A = new RegExp("^" + i + o + "[^aeiouwxy]$"), + O = function (n) { + var o, i, r, s, a, c, l; + if (n.length < 3) return n; + if ( + ((r = n.substr(0, 1)), + "y" == r && (n = r.toUpperCase() + n.substr(1)), + (s = p), + (a = m), + s.test(n) + ? (n = n.replace(s, "$1$2")) + : a.test(n) && (n = n.replace(a, "$1$2")), + (s = v), + (a = g), + s.test(n)) + ) { + var O = s.exec(n); + (s = u), s.test(O[1]) && ((s = y), (n = n.replace(s, ""))); + } else if (a.test(n)) { + var O = a.exec(n); + (o = O[1]), + (a = f), + a.test(o) && + ((n = o), + (a = w), + (c = S), + (l = k), + a.test(n) + ? (n += "e") + : c.test(n) + ? ((s = y), (n = n.replace(s, ""))) + : l.test(n) && (n += "e")); + } + if (((s = E), s.test(n))) { + var O = s.exec(n); + (o = O[1]), (n = o + "i"); + } + if (((s = x), s.test(n))) { + var O = s.exec(n); + (o = O[1]), (i = O[2]), (s = u), s.test(o) && (n = o + t[i]); + } + if (((s = b), s.test(n))) { + var O = s.exec(n); + (o = O[1]), (i = O[2]), (s = u), s.test(o) && (n = o + e[i]); + } + if (((s = T), (a = C), s.test(n))) { + var O = s.exec(n); + (o = O[1]), (s = d), s.test(o) && (n = o); + } else if (a.test(n)) { + var O = a.exec(n); + (o = O[1] + O[2]), (a = d), a.test(o) && (n = o); + } + if (((s = L), s.test(n))) { + var O = s.exec(n); + (o = O[1]), + (s = d), + (a = h), + (c = A), + (s.test(o) || (a.test(o) && !c.test(o))) && (n = o); + } + return ( + (s = _), + (a = d), + s.test(n) && a.test(n) && ((s = y), (n = n.replace(s, ""))), + "y" == r && (n = r.toLowerCase() + n.substr(1)), + n + ); + }; + return O; + })()), + 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, + o = t.charAt(0), + i = t.slice(1); + return ( + o in n || (n[o] = { docs: {} }), + 0 === i.length + ? ((n[o].docs[e.ref] = e), void (this.length += 1)) + : this.add(i, e, n[o]) + ); + }), + (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, o = 0; o < t.length; o++) { + if (!(t.charAt(o) in n)) return; + n = n[t.charAt(o)]; + } + delete n.docs[e]; + } + }), + (t.TokenStore.prototype.expand = function (t, e) { + var n = this.getNode(t), + o = n.docs || {}, + e = e || []; + return ( + Object.keys(o).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; + }); + })(), + (String.prototype.truncate = function (t) { + if (this.length > t) { + for (; " " != this[t] && --t > 0;); + return this.substring(0, t) + "…"; + } + return this; + }), + (HTMLElement.prototype.wrap = function (t) { + t.length || (t = [t]); + for (var e = t.length - 1; e >= 0; e--) { + var n = e > 0 ? this.cloneNode(!0) : this, + o = t[e], + i = o.parentNode, + r = o.nextSibling; + n.appendChild(o), r ? i.insertBefore(n, r) : i.appendChild(n); + } + }), + document.addEventListener("DOMContentLoaded", function () { + "use strict"; + Modernizr.addTest("ios", function () { + return !!navigator.userAgent.match(/(iPad|iPhone|iPod)/g); + }), + Modernizr.addTest("standalone", function () { + return !!navigator.standalone; + }), + FastClick.attach(document.body); + var t = document.getElementById("toggle-search"), + e = (document.getElementById("reset-search"), + document.querySelector(".drawer")), + n = document.querySelectorAll(".anchor"), + o = document.querySelector(".search .field"), + i = document.querySelector(".query"), + r = document.querySelector(".results .meta"); + Array.prototype.forEach.call(n, function (t) { + t.querySelector("a").addEventListener("click", function () { + (document.getElementById("toggle-drawer").checked = !1), + document.body.classList.remove("toggle-drawer"); + }); + }); + var s = window.pageYOffset, + a = function () { + var t = window.pageYOffset + window.innerHeight, + n = Math.max(0, window.innerHeight - e.offsetHeight); + t > document.body.clientHeight - (96 - n) + ? "absolute" != e.style.position && + ((e.style.position = "absolute"), + (e.style.top = null), + (e.style.bottom = 0)) + : e.offsetHeight < window.innerHeight + ? "fixed" != e.style.position && + ((e.style.position = "fixed"), + (e.style.top = 0), + (e.style.bottom = null)) + : "fixed" != e.style.position + ? t > e.offsetTop + e.offsetHeight + ? ((e.style.position = "fixed"), + (e.style.top = null), + (e.style.bottom = "-96px")) + : window.pageYOffset < e.offsetTop && + ((e.style.position = "fixed"), + (e.style.top = 0), + (e.style.bottom = null)) + : window.pageYOffset > s + ? e.style.top && + ((e.style.position = "absolute"), + (e.style.top = Math.max(0, s) + "px"), + (e.style.bottom = null)) + : e.style.bottom && + ((e.style.position = "absolute"), + (e.style.top = t - e.offsetHeight + "px"), + (e.style.bottom = null)), + (s = Math.max(0, window.pageYOffset)); + }, + c = function () { + var t = document.querySelector(".main"); + window.removeEventListener("scroll", a), + matchMedia("only screen and (max-width: 959px)").matches + ? ((e.style.position = null), + (e.style.top = null), + (e.style.bottom = null)) + : e.offsetHeight + 96 < t.offsetHeight && + (window.addEventListener("scroll", a), a()); + }; + Modernizr.ios || (window.addEventListener("resize", c), c()); + var u = 0; + t.addEventListener("click", function (t) { + var e = document.body.classList, + n = !matchMedia("only screen and (min-width: 960px)").matches; + e.contains("locked") + ? (e.remove("locked"), + n && + setTimeout(function () { + window.scrollTo(0, u); + }, 100)) + : ((u = window.scrollY), + n && + setTimeout(function () { + window.scrollTo(0, 0); + }, 400), + setTimeout( + function () { + this.checked && + (n && e.add("locked"), + setTimeout(function () { + i.focus(); + }, 200)); + }.bind(this), + 450 + )); + }), + o.addEventListener("touchstart", function () { + i.focus(); + }), + window.addEventListener("keyup", function (e) { + var n = e.keyCode || e.which; + 27 == n && + (i.blur(), + document.body.classList.remove("toggle-search"), + document.body.classList.remove("locked"), + (t.checked = !1)); + }); + var d = document.getElementById("reset-search"); + d.addEventListener("click", function () { + for (var t = document.querySelector(".results .list"); t.firstChild;) + t.removeChild(t.firstChild); + var e = document.querySelector(".bar.search"); + e.classList.remove("non-empty"), + (r.innerHTML = ""), + (i.value = ""), + i.focus(); + }); + var h = document.querySelectorAll("h2"); + h = Array.prototype.map.call(h, function (t) { + return t.offsetTop; + }); + var f = null; + document.addEventListener("scroll", function () { + for ( + var t = window.scrollY + window.innerHeight / 3, + e = h.length - 1, + o = 0; + e > o; + o++ + ) + t < h[o + 1] && (e = o); + e != f && + ((f = e), + Array.prototype.forEach.call(n, function (t, e) { + var n = t.querySelector("a"); + (e != f || n.classList.add("current")) && + n.classList.remove("current"); + })); + }); + var p = document.querySelectorAll(".n + .p"); + Array.prototype.forEach.call(p, function (t) { + var e = t.innerText || t.textContent; + e && "(" == e[0] && t.previousSibling.classList.add("f"); + }); + var m = document.querySelectorAll("table"); + if ( + (Array.prototype.forEach.call(m, function (t) { + var e = document.createElement("div"); + e.classList.add("data"), e.wrap(t); + }), + Modernizr.ios) + ) { + var v = document.querySelectorAll(".scrollable, .standalone .article"); + Array.prototype.forEach.call(v, function (t) { + t.addEventListener("touchstart", function () { + var t = this.scrollTop; + 0 == t + ? (this.scrollTop = 1) + : t + this.offsetHeight == this.scrollHeight && + (this.scrollTop = t - 1); + }); + }); + } + var g = document.querySelectorAll(".project, .overlay, .header"); + Array.prototype.forEach.call(g, function (t) { + t.addEventListener("touchmove", function (t) { + t.preventDefault(); + }); + }); + var y = document.querySelectorAll(".toggle"); + Array.prototype.forEach.call(y, function (t) { + t.addEventListener("click", function () { + document.body.classList.toggle(this.id); + }); + }), + repo_id && + pegasus("https://api.github.com/repos/" + repo_id).then( + function (t, e) { + var n = t.stargazers_count; + n > 1e4 + ? (n = (n / 1e3).toFixed(0) + "k") + : n > 1e3 && (n = (n / 1e3).toFixed(1) + "k"); + var o = document.querySelector(".repo-stars .count"); + o.innerHTML = n; + }, + function (t, e) { + console.error(t, e.status); + } + ); + }), + "standalone" in window.navigator && window.navigator.standalone) +) { + var node, + remotes = !1; + document.addEventListener( + "click", + function (t) { + for (node = t.target; "A" !== node.nodeName && "HTML" !== node.nodeName;) + node = node.parentNode; + "href" in node && + -1 !== node.href.indexOf("http") && + (-1 !== node.href.indexOf(document.location.host) || remotes) && + (t.preventDefault(), (document.location.href = node.href)); + }, + !1 + ); +} diff --git a/docs/static/js/search.js b/docs/static/js/search.js new file mode 100644 index 00000000..8bcea296 --- /dev/null +++ b/docs/static/js/search.js @@ -0,0 +1,132 @@ +var summaryInclude = 100 + +var fuseOptions = { + shouldSort: true, + includeMatches: true, + threshold: 0.0, + tokenize: true, + location: 0, + distance: 100, + maxPatternLength: 32, + minMatchCharLength: 2, + keys: [ + { name: "title", weight: 0.8 }, + { name: "tags", weight: 0.3 }, + { name: "categories", weight: 0.3 }, + { name: "contents", weight: 0.7 } + ] +} + +var searchQuery = param("s") +if (searchQuery) { + $("#search-query").val(searchQuery) + executeSearch(searchQuery) +} else { + $("#search-string").replaceWith(searchQuery) + $("#search-results-length").replaceWith(0) +} + +function executeSearch(searchQuery) { + $.getJSON("/index.json", function(data) { + var pages = data + var fuse = new Fuse(pages, fuseOptions) + var result = fuse.search(searchQuery) + console.log({ matches: result }) + $("#search-string").replaceWith(searchQuery) + $("#search-results-length").replaceWith(result.length) + if (result.length > 0) { + populateResults(result) + } else { + $("#search-results").append("

No matches found

") + } + }) +} + +function populateResults(result) { + $.each(result, function(key, value) { + var contents = value.item.contents + var snippet = "" + var snippetHighlights = [] + var tags = [] + if (fuseOptions.tokenize) { + snippetHighlights.push(searchQuery) + } else { + $.each(value.matches, function(matchKey, mvalue) { + if (mvalue.key == "tags" || mvalue.key == "categories") { + snippetHighlights.push(mvalue.value) + } else if (mvalue.key == "contents") { + let startIdx = mvalue.indices[0][0] + let endIdx = mvalue.indices[0][1] + let start = 0 + if (startIdx - summaryInclude > 0) { + start = startIdx - summaryInclude + } + let end = contents.length + if (endIdx + summaryInclude < contents.length) { + endIdx + summaryInclude + } + snippet += contents.substring(start, end) + snippetHighlights.push( + mvalue.value.substring( + startIdx, + endIdx - startIdx + 1 + ) + ) + } + }) + } + + if (snippet.length < 1) { + snippet += contents.substring(0, summaryInclude * 2) + } + //pull template from hugo template definition + var templateDefinition = $("#search-result-template").html() + //replace values + var output = render(templateDefinition, { + key: key, + title: value.item.title, + link: value.item.permalink, + tags: value.item.tags, + categories: value.item.categories, + snippet: snippet + }) + $("#search-results").append(output) + + $.each(snippetHighlights, function(snipkey, snipvalue) { + $("#summary-" + key).mark(snipvalue) + }) + }) +} + +function param(name) { + return decodeURIComponent( + (location.search.split(name + "=")[1] || "").split("&")[0] + ).replace(/\+/g, " ") +} + +function render(templateString, data) { + var conditionalMatches, conditionalPattern, copy + conditionalPattern = /\$\{\s*isset ([a-zA-Z]*) \s*\}(.*)\$\{\s*end\s*}/g + //since loop below depends on re.lastInxdex, we use a copy to capture any manipulations whilst inside the loop + copy = templateString + while ( + (conditionalMatches = conditionalPattern.exec(templateString)) !== null + ) { + if (data[conditionalMatches[1]]) { + //valid key, remove conditionals, leave contents. + copy = copy.replace(conditionalMatches[0], conditionalMatches[2]) + } else { + //not valid, remove entire section + copy = copy.replace(conditionalMatches[0], "") + } + } + templateString = copy + //now any conditionals removed we can do simple substitution + var key, find, re + for (key in data) { + find = "\\$\\{\\s*" + key + "\\s*\\}" + re = new RegExp(find, "g") + templateString = templateString.replace(re, data[key]) + } + return templateString +} diff --git a/docs/static/stylesheets/application.css b/docs/static/stylesheets/application.css new file mode 100644 index 00000000..96ed4805 --- /dev/null +++ b/docs/static/stylesheets/application.css @@ -0,0 +1,1386 @@ +html { + box-sizing: border-box; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; +} +*, +:after, +:before { + box-sizing: inherit; + -moz-box-sizing: inherit; + -webkit-box-sizing: inherit; +} +html { + font-size: 62.5%; + -webkit-text-size-adjust: none; + -ms-text-size-adjust: none; + text-size-adjust: none; +} + +a, abbr, acronym, address, applet, article, aside, audio, b, big, blockquote, body, canvas, caption, center, cite, code, dd, del, details, dfn, div, dl, +dt, em, embed, fieldset, figcaption, figure, footer, form, h1, h2, h3, h4, h5, h6, header, hgroup, html, i, iframe, img, ins, kbd, label, legend, li, main, mark, menu, nav, object, ol, output, p, +pre, q, ruby, s, samp, section, small, span, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, time, tr, tt, u, ul, var, video { + margin: 0; + padding: 0; + border: 0; +} + +main { + display: block; +} +ul { + list-style: none; +} +table { + border-collapse: collapse; + border-spacing: 0; +} +td { + text-align: left; + font-weight: 400; + vertical-align: middle; +} +button { + outline: 0; + padding: 0; + background: transparent; + border: none; + font-size: inherit; +} +input { + -webkit-appearance: none; + -moz-appearance: none; + -ms-appearance: none; + -o-appearance: none; + appearance: none; + outline: none; + border: none; +} +a { + text-decoration: none; + color: inherit; +} +a, +button, +input, +label { + -webkit-tap-highlight-color: rgba(255, 255, 255, 0); + -webkit-tap-highlight-color: transparent; +} +h1, +h2, +h3, +h4, +h5, +h6 { + font-weight: inherit; +} +pre { + background: rgba(0, 0, 0, 0.05); +} +pre, +pre code { + color: rgba(0, 0, 0, 0.87); +} +.c, +.c1, +.cm, +.o { + color: rgba(0, 0, 0, 0.54); +} +.k, +.kn { + color: #a71d5d; +} +.kd, +.kt { + color: #0086b3; +} +.n.f, +.nf { + color: #795da3; +} +.nx { + color: #0086b3; +} +.s, +.s1 { + color: #183691; +} +.bp, +.mi { + color: #9575cd; +} +.icon { + font-family: Icon; + speak: none; + font-style: normal; + font-weight: 400; + font-variant: normal; + text-transform: none; + line-height: 1; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} +.icon-search:before { + content: "\e600"; +} +.icon-back:before { + content: "\e601"; +} +.icon-link:before { + content: "\e602"; +} +.icon-close:before { + content: "\e603"; +} +.icon-menu:before { + content: "\e604"; +} +.icon-forward:before { + content: "\e605"; +} +.icon-twitter:before { + content: "\e606"; +} +.icon-github:before { + content: "\e607"; +} +.icon-download:before { + content: "\e608"; +} +.icon-star:before { + content: "\e609"; +} +.icon-warning:before { + content: "\e610"; +} +.icon-note:before { + content: "\e611"; +} +a { + -webkit-transition: color 0.25s; + transition: color 0.25s; +} +.overlay { + -webkit-transition: opacity 0.25s, width 0s 0.25s, height 0s 0.25s; + transition: opacity 0.25s, width 0s 0.25s, height 0s 0.25s; +} +#toggle-drawer:checked ~ .overlay, +.toggle-drawer .overlay { + -webkit-transition: opacity 0.25s, width 0s, height 0s; + transition: opacity 0.25s, width 0s, height 0s; +} +.js .header { + -webkit-transition: background 0.6s, color 0.6s; + transition: background 0.6s, color 0.6s; +} +.js .header:before { + -webkit-transition: background 0.6s; + transition: background 0.6s; +} +.button .icon { + -webkit-transition: background 0.25s; + transition: background 0.25s; +} +body { + color: rgba(0, 0, 0, 0.87); +} +@supports (-webkit-appearance: none) { + body { + background: #e84e40; + } +} +.ios body { + background: #fff; +} +hr { + border: 0; + border-top: 1px solid rgba(0, 0, 0, 0.12); +} +.toggle-button { + cursor: pointer; + color: inherit; +} +.backdrop, +.backdrop-paper:after { + background: #fff; +} +.overlay { + background: rgba(0, 0, 0, 0.54); + opacity: 0; +} +#toggle-drawer:checked ~ .overlay, +.toggle-drawer .overlay { + opacity: 1; +} +.header { + box-shadow: 0 1.5px 3px rgba(0, 0, 0, 0.24), 0 3px 8px rgba(0, 0, 0, 0.05); + background: #e84e40; + color: #fff; +} +.ios.standalone .header:before { + background: rgba(0, 0, 0, 0.12); +} +.bar .path { + color: hsla(0, 0%, 100%, 0.7); +} +.button .icon { + border-radius: 100%; +} +.button .icon:active { + background: hsla(0, 0%, 100%, 0.12); +} +html { + height: 100%; +} +body { + position: relative; + min-height: 100%; +} +hr { + display: block; + height: 1px; + padding: 0; + margin: 0; +} +.locked { + height: 100%; + overflow: hidden; +} +.scrollable { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + overflow: auto; + -webkit-overflow-scrolling: touch; +} +.scrollable .wrapper { + height: 100%; +} +.ios .scrollable .wrapper { + margin-bottom: 2px; +} +.toggle { + display: none; +} +.toggle-button { + display: block; +} +.backdrop { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: -1; +} +.backdrop-paper { + max-width: 1200px; + height: 100%; + margin-left: auto; + margin-right: auto; +} +.backdrop-paper:after { + content: " "; + display: block; + height: 100%; + margin-left: 262px; +} +.overlay { + width: 0; + height: 0; + z-index: 3; +} +.header, +.overlay { + position: fixed; + top: 0; +} +.header { + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + left: 0; + z-index: 2; + height: 56px; + padding: 4px; + overflow: hidden; +} +.ios.standalone .header { + position: absolute; +} +.bar { + display: table; + max-width: 1184px; + margin-left: auto; + margin-right: auto; +} +.bar a { + display: block; +} +.no-js .bar .button-search { + display: none; +} +.bar .path .icon:before { + vertical-align: -1.5px; +} +.button { + display: table-cell; + vertical-align: top; + width: 1%; +} +.button button { + margin: 0; + padding: 0; +} +.button button:active:before { + position: relative; + top: 0; + left: 0; +} +.button .icon { + display: inline-block; + font-size: 24px; + padding: 8px; + margin: 4px; +} +.stretch { + display: table; + table-layout: fixed; + width: 100%; +} +.header .stretch { + padding: 0 20px; +} +.stretch .title { + display: table-cell; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} +.header .stretch .title { + font-size: 18px; + padding: 13px 0; +} +.main { + max-width: 1200px; + margin-left: auto; + margin-right: auto; +} +body, +input { + font-weight: 400; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} +.no-fontface body, +.no-fontface input, +body, +input { + font-family: Helvetica Neue, Helvetica, Arial, sans-serif; +} +.no-fontface code, +.no-fontface kbd, +.no-fontface pre, +code, +kbd, +pre { + font-family: Courier New, Courier, monospace; +} +#toggle-drawer:checked ~ .main .drawer, +.toggle-drawer .drawer { + -webkit-transform: translateZ(0); + transform: translateZ(0); +} +.no-csstransforms3d #toggle-drawer:checked ~ .main .drawer, +.no-csstransforms3d .toggle-drawer .drawer { + display: block; +} +.project { + -webkit-transition: none; + transition: none; +} +.project .logo img { + -webkit-transition: box-shadow 0.4s; + transition: box-shadow 0.4s; +} +.repo a { + -webkit-transition: box-shadow 0.4s, opacity 0.4s; + transition: box-shadow 0.4s, opacity 0.4s; +} +.drawer .toc a.current, +.drawer .toc a:focus, +.drawer .toc a:hover { + color: #e84e40; +} +.drawer .anchor a { + border-left: 2px solid #e84e40; +} +.drawer .section { + color: rgba(0, 0, 0, 0.54); +} +.ios.standalone .project:before { + background: rgba(0, 0, 0, 0.12); +} +.project .logo img { + background: #fff; + border-radius: 100%; +} +.project:focus .logo img, +.project:hover .logo img { + box-shadow: 0 4px 7px rgba(0, 0, 0, 0.23), 0 8px 25px rgba(0, 0, 0, 0.05); +} +.repo a { + background: #00bfa5; + color: #fff; + border-radius: 3px; +} +.repo a:focus, +.repo a:hover { + box-shadow: 0 4px 7px rgba(0, 0, 0, 0.23), 0 8px 25px rgba(0, 0, 0, 0.05); + opacity: 0.8; +} +.repo a .count { + background: rgba(0, 0, 0, 0.26); + color: #fff; + border-radius: 0 3px 3px 0; +} +.repo a .count:before { + border-width: 15px 5px 15px 0; + border-color: transparent rgba(0, 0, 0, 0.26); + border-style: solid; +} +.drawer { + width: 262px; + font-size: 13px; + line-height: 1em; +} +.ios .drawer { + overflow: scroll; + -webkit-overflow-scrolling: touch; +} +.drawer .toc li a { + display: block; + padding: 14.5px 24px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +.drawer .toc li.anchor a { + margin-left: 12px; + padding: 10px 24px 10px 12px; +} +.drawer .toc li ul { + margin-left: 12px; +} +.drawer .current + ul { + margin-bottom: 9px; +} +.drawer .section { + display: block; + padding: 14.5px 24px; +} +.drawer .scrollable { + top: 104px; + z-index: -1; +} +.drawer .scrollable .wrapper { + height: auto; + min-height: 100%; +} +.drawer .scrollable .wrapper hr { + margin: 12px 0; + margin-right: auto; +} +.drawer .scrollable .wrapper .toc { + margin: 12px 0; +} +.project { + display: block; +} +.project .banner { + display: table; + width: 100%; + height: 104px; + padding: 20px; +} +.project .logo { + display: table-cell; + width: 64px; + padding-right: 12px; +} +.project .logo img { + display: block; + width: 64px; + height: 64px; +} +.project .name { + display: table-cell; + padding-left: 4px; + font-size: 14px; + line-height: 1.25em; + vertical-align: middle; +} +.project .logo + .name { + font-size: 12px; +} +.repo { + margin: 24px 0; + text-align: center; +} +.repo li { + display: inline-block; + padding-right: 12px; + white-space: nowrap; +} +.repo li:last-child { + padding-right: 0; +} +.repo a { + display: inline-block; + padding: 0 10px 0 6px; + font-size: 12px; + line-height: 30px; + height: 30px; +} +.repo a .icon { + font-size: 18px; + vertical-align: -3px; +} +.repo a .count { + display: inline-block; + position: relative; + padding: 0 8px 0 4px; + margin: 0 -10px 0 8px; + font-size: 12px; +} +.repo a .count:before { + content: " "; + display: block; + position: absolute; + top: 0; + left: -5px; +} +.no-js .repo a .count { + display: none; +} +.drawer .toc li a { + font-weight: 700; +} +.drawer .toc li.anchor a { + font-weight: 400; +} +.drawer .section, +.repo a { + font-weight: 700; +} +.repo a { + text-transform: uppercase; +} +.repo a .count { + text-transform: none; + font-weight: 700; +} +pre span { + -webkit-transition: color 0.25s; + transition: color 0.25s; +} +.copyright a { + -webkit-transition: color 0.25s; + transition: color 0.25s; +} +.ios.standalone .article { + background: -webkit-linear-gradient(top, #fff 50%, #e84e40 0); + background: linear-gradient(180deg, #fff 50%, #e84e40 0); +} +.ios.standalone .article .wrapper { + background: -webkit-linear-gradient(top, #fff 50%, #fff 0); + background: linear-gradient(180deg, #fff 50%, #fff 0); +} +.article a, +.article h1, +.article h2 { + color: #e84e40; +} +.article code { + background: #eee; +} +.article kbd { + color: #555; + background-color: #fcfcfc; + border: 1px solid #ccc; + border-bottom-color: #bbb; + border-radius: 3px; + box-shadow: inset 0 -1px 0 #bbb; +} +.article h1 { + border-bottom: 1px solid rgba(0, 0, 0, 0.12); +} +.article a { + border-bottom: 1px dotted; +} +.article a:focus, +.article a:hover { + color: #00bfa5; +} +.article .headerlink { + color: rgba(0, 0, 0, 0.26); + border: none; +} +.article table { + box-shadow: 0 1.5px 3px rgba(0, 0, 0, 0.24), 0 3px 8px rgba(0, 0, 0, 0.05); + border-radius: 3px; +} +.article table th { + background: #ee7a70; + color: #fff; +} +.article table td { + border-top: 1px solid rgba(0, 0, 0, 0.05); +} +.article blockquote { + border-left: 2px solid rgba(0, 0, 0, 0.54); + color: rgba(0, 0, 0, 0.54); +} +.footer { + background: #e84e40; + color: #fff; +} +.footer a { + border: none; +} +.copyright { + color: rgba(0, 0, 0, 0.54); +} +.pagination a .button, +.pagination a .title { + color: #fff; +} +.pagination .direction { + color: hsla(0, 0%, 100%, 0.7); +} +.admonition { + background: #29b6f6; + color: #fff; +} +.admonition pre { + background: hsla(0, 0%, 100%, 0.3); +} +.admonition.warning { + background: #e84e40; +} +.admonition a, +.admonition a:hover { + color: #fff; +} +.article { + font-size: 14px; + line-height: 1.7em; +} +.article:after { + content: " "; + display: block; + clear: both; +} +.article .wrapper { + padding: 116px 16px 92px; +} +.ios.standalone .article { + position: absolute; + top: 56px; + right: 0; + bottom: 0; + left: 0; + overflow: auto; + -webkit-overflow-scrolling: touch; +} +.ios.standalone .article .wrapper { + position: relative; + min-height: 100%; + padding-top: 60px; + margin-bottom: 2px; +} +.article h1 { + font-size: 24px; + line-height: 1.333334em; + padding: 20px 0 42px; +} +.article h2 { + font-size: 20px; + line-height: 1.4em; + padding-top: 92px; + margin-top: -56px; +} +.ios.standalone .article h2 { + padding-top: 36px; + margin: 0; +} +.article h3, +.article h4 { + font-size: 14px; + padding-top: 76px; + margin-top: -56px; +} +.ios.standalone .article h3, +.ios.standalone .article h4 { + padding-top: 20px; + margin-top: 0; +} +.article .headerlink { + float: right; + margin-left: 20px; + font-size: 14px; +} +h1 .article .headerlink { + display: none; +} +.article ol, +.article p, +.article ul { + margin-top: 1.5em; +} +.article li, +.article li ol, +.article li ul { + margin-top: 0.75em; +} +.article li { + margin-left: 18px; +} +.article li p { + display: inline; +} +.article ul > li:before { + content: "\e602"; + display: block; + float: left; + font-family: Icon; + font-size: 16px; + width: 1.2em; + margin-left: -1.2em; + vertical-align: -0.1em; +} +.article p > code { + white-space: nowrap; + padding: 2px 4px; +} +.article kbd { + display: inline-block; + padding: 3px 5px; + line-height: 10px; +} +.article hr { + margin-top: 1.5em; +} +.article img { + max-width: 100%; +} +.article pre { + padding: 16px; + margin: 1.5em -16px 0; + line-height: 1.5em; + overflow: auto; + -webkit-overflow-scrolling: touch; +} +.article table { + margin: 3em 0 1.5em; + font-size: 13px; + overflow: hidden; +} +.no-js .article table { + display: inline-block; + max-width: 100%; + overflow: auto; + -webkit-overflow-scrolling: touch; +} +.article table th { + min-width: 100px; + font-size: 12px; + text-align: left; +} +.article table td, +.article table th { + padding: 12px 16px; + vertical-align: top; +} +.article blockquote { + padding-left: 16px; +} +.article .data { + margin: 1.5em -16px; + padding: 1.5em 0; + overflow: auto; + -webkit-overflow-scrolling: touch; + text-align: center; +} +.article .data table { + display: inline-block; + margin: 0 16px; + text-align: left; +} +.footer { + position: absolute; + bottom: 0; + left: 0; + right: 0; + padding: 0 4px; +} +.copyright { + margin: 1.5em 0; +} +.pagination { + max-width: 1184px; + height: 92px; + padding: 4px 0; + margin-left: auto; + margin-right: auto; + overflow: hidden; +} +.pagination a { + display: block; + height: 100%; +} +.pagination .next, +.pagination .previous { + position: relative; + float: left; + height: 100%; +} +.pagination .previous { + width: 25%; +} +.pagination .previous .direction, +.pagination .previous .stretch { + display: none; +} +.pagination .next { + width: 75%; + text-align: right; +} +.pagination .page { + display: table; + position: absolute; + bottom: 4px; +} +.pagination .direction { + display: block; + position: absolute; + bottom: 40px; + width: 100%; + font-size: 15px; + line-height: 20px; + padding: 0 52px; +} +.pagination .stretch { + padding: 0 4px; +} +.pagination .stretch .title { + font-size: 18px; + padding: 11px 0 13px; +} +.admonition { + margin: 20px -16px 0; + padding: 20px 16px; +} +.admonition > :first-child { + margin-top: 0; +} +.admonition .admonition-title { + font-size: 20px; +} +.admonition .admonition-title:before { + content: "\e611"; + display: block; + float: left; + font-family: Icon; + font-size: 24px; + vertical-align: -0.1em; + margin-right: 5px; +} +.admonition.warning .admonition-title:before { + content: "\e610"; +} +.article h3 { + font-weight: 700; +} +.article h4 { + font-weight: 400; + font-style: italic; +} +.article h2 a, +.article h3 a, +.article h4 a, +.article h5 a, +.article h6 a { + font-weight: 400; + font-style: normal; +} +.bar { + -webkit-transform: translateZ(0); + transform: translateZ(0); + -webkit-transition: opacity 0.2s cubic-bezier(0.75, 0, 0.25, 1), + -webkit-transform 0.4s cubic-bezier(0.75, 0, 0.25, 1); + transition: opacity 0.2s cubic-bezier(0.75, 0, 0.25, 1), + -webkit-transform 0.4s cubic-bezier(0.75, 0, 0.25, 1); + transition: opacity 0.2s cubic-bezier(0.75, 0, 0.25, 1), + transform 0.4s cubic-bezier(0.75, 0, 0.25, 1); + transition: opacity 0.2s cubic-bezier(0.75, 0, 0.25, 1), + transform 0.4s cubic-bezier(0.75, 0, 0.25, 1), + -webkit-transform 0.4s cubic-bezier(0.75, 0, 0.25, 1); +} +#toggle-search:checked ~ .header .bar, +.toggle-search .bar { + -webkit-transform: translate3d(0, -56px, 0); + transform: translate3d(0, -56px, 0); +} +.bar.search .button-reset { + -webkit-transform: scale(0.5); + transform: scale(0.5); + -webkit-transition: opacity 0.4s cubic-bezier(0.1, 0.7, 0.1, 1), + -webkit-transform 0.4s cubic-bezier(0.1, 0.7, 0.1, 1); + transition: opacity 0.4s cubic-bezier(0.1, 0.7, 0.1, 1), + -webkit-transform 0.4s cubic-bezier(0.1, 0.7, 0.1, 1); + transition: opacity 0.4s cubic-bezier(0.1, 0.7, 0.1, 1), + transform 0.4s cubic-bezier(0.1, 0.7, 0.1, 1); + transition: opacity 0.4s cubic-bezier(0.1, 0.7, 0.1, 1), + transform 0.4s cubic-bezier(0.1, 0.7, 0.1, 1), + -webkit-transform 0.4s cubic-bezier(0.1, 0.7, 0.1, 1); + opacity: 0; +} +.bar.search.non-empty .button-reset { + -webkit-transform: scale(1); + transform: scale(1); + opacity: 1; +} +.results { + -webkit-transition: opacity 0.3s 0.1s, width 0s 0.4s, height 0s 0.4s; + transition: opacity 0.3s 0.1s, width 0s 0.4s, height 0s 0.4s; +} +#toggle-search:checked ~ .main .results, +.toggle-search .results { + -webkit-transition: opacity 0.4s, width 0s, height 0s; + transition: opacity 0.4s, width 0s, height 0s; +} +.results .list a { + -webkit-transition: background 0.25s; + transition: background 0.25s; +} +.no-csstransforms3d .bar.default { + display: table; +} +.no-csstransforms3d .bar.search { + display: none; + margin-top: 0; +} +.no-csstransforms3d #toggle-search:checked ~ .header .bar.default, +.no-csstransforms3d .toggle-search .bar.default { + display: none; +} +.no-csstransforms3d #toggle-search:checked ~ .header .bar.search, +.no-csstransforms3d .toggle-search .bar.search { + display: table; +} +.bar.search { + opacity: 0; +} +.bar.search .query { + background: transparent; + color: rgba(0, 0, 0, 0.87); +} +.bar.search .query::-webkit-input-placeholder { + color: rgba(0, 0, 0, 0.26); +} +.bar.search .query:-moz-placeholder, +.bar.search .query::-moz-placeholder { + color: rgba(0, 0, 0, 0.26); +} +.bar.search .query:-ms-input-placeholder { + color: rgba(0, 0, 0, 0.26); +} +.bar.search .button .icon:active { + background: rgba(0, 0, 0, 0.12); +} +.results { + box-shadow: 0 4px 7px rgba(0, 0, 0, 0.23), 0 8px 25px rgba(0, 0, 0, 0.05); + background: #fff; + color: rgba(0, 0, 0, 0.87); + opacity: 0; +} +#toggle-search:checked ~ .main .results, +.toggle-search .results { + opacity: 1; +} +.results .meta { + background: #e84e40; + color: #fff; +} +.results .list a { + border-bottom: 1px solid rgba(0, 0, 0, 0.12); +} +.results .list a:last-child { + border-bottom: none; +} +.results .list a:active { + background: rgba(0, 0, 0, 0.12); +} +.result span { + color: rgba(0, 0, 0, 0.54); +} +#toggle-search:checked ~ .header, +.toggle-search .header { + background: #fff; + color: rgba(0, 0, 0, 0.54); +} +#toggle-search:checked ~ .header:before, +.toggle-search .header:before { + background: rgba(0, 0, 0, 0.54); +} +#toggle-search:checked ~ .header .bar.default, +.toggle-search .header .bar.default { + opacity: 0; +} +#toggle-search:checked ~ .header .bar.search, +.toggle-search .header .bar.search { + opacity: 1; +} +.bar.search { + margin-top: 8px; +} +.bar.search .query { + font-size: 18px; + padding: 13px 0; + margin: 0; + width: 100%; + height: 48px; +} +.bar.search .query::-ms-clear { + display: none; +} +.results { + position: fixed; + top: 0; + left: 0; + width: 0; + height: 100%; + z-index: 1; + overflow-y: scroll; + -webkit-overflow-scrolling: touch; +} +.results .scrollable { + top: 56px; +} +#toggle-search:checked ~ .main .results, +.toggle-search .results { + width: 100%; + overflow-y: visible; +} +.results .meta { + font-weight: 700; +} +.results .meta strong { + display: block; + font-size: 11px; + max-width: 1200px; + margin-left: auto; + margin-right: auto; + padding: 16px; +} +.results .list a { + display: block; +} +.result { + max-width: 1200px; + margin-left: auto; + margin-right: auto; + padding: 12px 16px 16px; +} +.result h1 { + line-height: 24px; +} +.result h1, +.result span { + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; +} +.result span { + font-size: 12px; +} +.no-csstransforms3d .results { + display: none; +} +.no-csstransforms3d #toggle-search:checked ~ .main .results, +.no-csstransforms3d .toggle-search .results { + display: block; + overflow: auto; +} +.meta { + text-transform: uppercase; + font-weight: 700; +} +@media only screen and (min-width: 960px) { + .backdrop { + background: #f2f2f2; + } + .backdrop-paper:after { + box-shadow: 0 1.5px 3px rgba(0, 0, 0, 0.24), 0 3px 8px rgba(0, 0, 0, 0.05); + } + .button-menu { + display: none; + } + .drawer { + float: left; + height: auto; + margin-bottom: 96px; + padding-top: 80px; + } + .drawer, + .drawer .scrollable { + position: static; + } + .article { + margin-left: 262px; + } + .footer { + z-index: 4; + } + .copyright { + margin-bottom: 64px; + } + .results { + height: auto; + top: 64px; + } + .results .scrollable { + position: static; + max-height: 413px; + } +} +@media only screen and (max-width: 959px) { + #toggle-drawer:checked ~ .overlay, + .toggle-drawer .overlay { + width: 100%; + height: 100%; + } + .drawer { + -webkit-transform: translate3d(-262px, 0, 0); + transform: translate3d(-262px, 0, 0); + -webkit-transition: -webkit-transform 0.25s cubic-bezier(0.4, 0, 0.2, 1); + transition: -webkit-transform 0.25s cubic-bezier(0.4, 0, 0.2, 1); + transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1); + transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), + -webkit-transform 0.25s cubic-bezier(0.4, 0, 0.2, 1); + } + .no-csstransforms3d .drawer { + display: none; + } + .drawer { + background: #fff; + } + .project { + box-shadow: 0 1.5px 3px rgba(0, 0, 0, 0.24), 0 3px 8px rgba(0, 0, 0, 0.05); + background: #e84e40; + color: #fff; + } + .drawer { + position: fixed; + z-index: 4; + } + #toggle-search:checked ~ .main .results, + .drawer, + .toggle-search .results { + height: 100%; + } +} +@media only screen and (min-width: 720px) { + .header { + height: 64px; + padding: 8px; + } + .header .stretch { + padding: 0 16px; + } + .header .stretch .title { + font-size: 20px; + padding: 12px 0; + } + .project .name { + margin: 26px 0 0 5px; + } + .article .wrapper { + padding: 128px 24px 96px; + } + .article .data { + margin: 1.5em -24px; + } + .article .data table { + margin: 0 24px; + } + .article h2 { + padding-top: 100px; + margin-top: -64px; + } + .ios.standalone .article h2 { + padding-top: 28px; + margin-top: 8px; + } + .article h3, + .article h4 { + padding-top: 84px; + margin-top: -64px; + } + .ios.standalone .article h3, + .ios.standalone .article h4 { + padding-top: 20px; + margin-top: 0; + } + .article pre { + padding: 1.5em 24px; + margin: 1.5em -24px 0; + } + .footer { + padding: 0 8px; + } + .pagination { + height: 96px; + padding: 8px 0; + } + .pagination .direction { + padding: 0 56px; + bottom: 40px; + } + .pagination .stretch { + padding: 0 8px; + } + .admonition { + margin: 20px -24px 0; + padding: 20px 24px; + } + .bar.search .query { + font-size: 20px; + padding: 12px 0; + } + .results .scrollable { + top: 64px; + } + .results .meta strong { + padding: 16px 24px; + } + .result { + padding: 16px 24px 20px; + } +} +@media only screen and (min-width: 1200px) { + .header { + width: 100%; + } + .drawer .scrollable .wrapper hr { + width: 48px; + } +} +@media only screen and (orientation: portrait) { + .ios.standalone .header { + height: 76px; + padding-top: 24px; + } + .ios.standalone .header:before { + content: " "; + position: absolute; + top: 0; + left: 0; + z-index: 3; + width: 100%; + height: 20px; + } + .ios.standalone .drawer .scrollable { + top: 124px; + } + .ios.standalone .project { + padding-top: 20px; + } + .ios.standalone .project:before { + content: " "; + position: absolute; + top: 0; + left: 0; + z-index: 3; + width: 100%; + height: 20px; + } + .ios.standalone .article { + position: absolute; + top: 76px; + right: 0; + bottom: 0; + left: 0; + } + .ios.standalone .results .scrollable { + top: 76px; + } +} +@media only screen and (orientation: portrait) and (min-width: 720px) { + .ios.standalone .header { + height: 84px; + padding-top: 28px; + } + .ios.standalone .results .scrollable { + top: 84px; + } +} +@media only screen and (max-width: 719px) { + .bar .path { + display: none; + } +} +@media only screen and (max-width: 479px) { + .button-github, + .button-twitter { + display: none; + } +} +@media only screen and (min-width: 720px) and (max-width: 959px) { + .header .stretch { + padding: 0 24px; + } +} +@media only screen and (min-width: 480px) { + .pagination .next, + .pagination .previous { + width: 50%; + } + .pagination .previous .direction { + display: block; + } + .pagination .previous .stretch { + display: table; + } +} +@media print { + .drawer, + .footer, + .header, + .headerlink { + display: none; + } + .article .wrapper { + padding-top: 0; + } + .article pre, + .article pre * { + color: rgba(0, 0, 0, 0.87) !important; + } + .article pre { + border: 1px solid rgba(0, 0, 0, 0.12); + } + .article table { + border-radius: none; + box-shadow: none; + } + .article table th { + color: #e84e40; + } +} diff --git a/docs/static/stylesheets/search.css b/docs/static/stylesheets/search.css new file mode 100644 index 00000000..ad9ef77c --- /dev/null +++ b/docs/static/stylesheets/search.css @@ -0,0 +1,22 @@ +#search-results cite a { + text-decoration: none; + border-bottom: 0px solid; + color: rgb(120, 133, 145); + font-style: normal; + font-size: 85%; +} + +#search-results h3 a { + text-decoration: none; + border-bottom: 0px solid; +} + +#search-results .search-result { + /* background-color: rgba(120, 133, 145, 0.1); */ + color: rgb(72, 66, 60); +} + +mark{ + background: rgb(255, 207, 155); + color: black; +} -- cgit v1.2.3