diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-04-02 08:53:34 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-04-02 08:53:34 +0200 |
commit | 558825cc201da2264be2e82d24fbf0d1105a0c2e (patch) | |
tree | 86c22851e65ec4b87d68a063e4772358a78e751b /docs/themes | |
parent | 10c33c17cdd66990b4b074a18213c47fc4eb956a (diff) | |
parent | ed8bf081fdbf336e026517b7e1b123c039014ab5 (diff) |
Merge commit 'ed8bf081fdbf336e026517b7e1b123c039014ab5'
Diffstat (limited to 'docs/themes')
-rw-r--r-- | docs/themes/gohugoioTheme/layouts/shortcodes/code-toggle.html | 24 | ||||
-rw-r--r-- | docs/themes/gohugoioTheme/src/css/_chroma.css | 124 | ||||
-rw-r--r-- | docs/themes/gohugoioTheme/src/css/_tabs.css | 30 | ||||
-rwxr-xr-x | docs/themes/gohugoioTheme/src/css/main.css | 1 | ||||
-rw-r--r-- | docs/themes/gohugoioTheme/src/js/clipboardjs.js | 3 | ||||
-rwxr-xr-x | docs/themes/gohugoioTheme/src/js/main.js | 2 | ||||
-rw-r--r-- | docs/themes/gohugoioTheme/src/js/tabs.js | 43 | ||||
-rw-r--r-- | docs/themes/gohugoioTheme/static/dist/app.bundle.js | 12 | ||||
-rw-r--r-- | docs/themes/gohugoioTheme/static/dist/main.css | 2 |
9 files changed, 170 insertions, 71 deletions
diff --git a/docs/themes/gohugoioTheme/layouts/shortcodes/code-toggle.html b/docs/themes/gohugoioTheme/layouts/shortcodes/code-toggle.html new file mode 100644 index 000000000..c695a7aae --- /dev/null +++ b/docs/themes/gohugoioTheme/layouts/shortcodes/code-toggle.html @@ -0,0 +1,24 @@ +{{ $langs := (slice "yaml" "toml" "json") }} +<div class="code relative" {{ with .Get "file" }}id="{{ . | urlize}}"{{ end }}> + <div class="code-nav flex flex-nowrap items-stretch"> + {{- with .Get "file" -}} + <div class="san-serif f6 dib lh-solid pl2 pv2 mr2">{{ . }}.</div> + {{- end -}} + {{ range $langs }} + <button data-toggle-tab="{{ . }}" class="tab-button {{ cond (eq . "yaml") "active" ""}} ba san-serif f6 dib lh-solid ph2 pv2">{{ . }}</button> + {{ end }} + </div> + <div class="tab-content"> + {{ range $langs }} + <div data-pane="{{ . }}" class="code-copy-content nt3 tab-pane {{ cond (eq . "yaml") "active" ""}}"> + {{ highlight ($.Inner | transform.Remarshal . | safeHTML) . ""}} + </div> + {{ if ne ($.Get "copy") "false" }} + <button class="needs-js copy copy-toggle bg-accent-color-dark f6 absolute top-0 right-0 lh-solid hover-bg-primary-color-dark bn white ph3 pv2" title="Copy this code to your clipboard." data-clipboard-action="copy" aria-label="copy button"> + </button> + {{/* Functionality located within filesaver.js The copy here is located in the css with .copy class so it can be replaced with JS on success */}} + {{end}} + {{ end }} + </div> + +</div> diff --git a/docs/themes/gohugoioTheme/src/css/_chroma.css b/docs/themes/gohugoioTheme/src/css/_chroma.css index b15e07558..d00ea65e6 100644 --- a/docs/themes/gohugoioTheme/src/css/_chroma.css +++ b/docs/themes/gohugoioTheme/src/css/_chroma.css @@ -1,67 +1,65 @@ -/* Background */ .chroma { background-color: #f0f0f0 } -/* Error */ .chroma .err { } -/* LineTableTD */ .chroma .lntd { ; vertical-align: top; padding: 0; margin: 0; border: 0; } -/* LineTable */ .chroma .lntable { ; border-spacing: 0; padding: 0; margin: 0; border: 0; width: 100%; overflow: auto; display: block; } -/* LineHighlight */ .chroma .hl { background-color: #ffffcc; display: block; width: 100% } -/* LineNumbersTable */ .chroma .lnt { ; margin-right: 0.4em; padding: 0 0.4em 0 0.4em; display: block; } -/* LineNumbers */ .chroma .ln { ; margin-right: 0.4em; padding: 0 0.4em 0 0.4em; } -/* Keyword */ .chroma .k { color: #007020; font-weight: bold } -/* KeywordConstant */ .chroma .kc { color: #007020; font-weight: bold } -/* KeywordDeclaration */ .chroma .kd { color: #007020; font-weight: bold } -/* KeywordNamespace */ .chroma .kn { color: #007020; font-weight: bold } -/* KeywordPseudo */ .chroma .kp { color: #007020 } -/* KeywordReserved */ .chroma .kr { color: #007020; font-weight: bold } -/* KeywordType */ .chroma .kt { color: #902000 } -/* NameAttribute */ .chroma .na { color: #4070a0 } -/* NameBuiltin */ .chroma .nb { color: #007020 } -/* NameClass */ .chroma .nc { color: #0e84b5; font-weight: bold } -/* NameConstant */ .chroma .no { color: #60add5 } -/* NameDecorator */ .chroma .nd { color: #555555; font-weight: bold } -/* NameEntity */ .chroma .ni { color: #d55537; font-weight: bold } -/* NameException */ .chroma .ne { color: #007020 } -/* NameFunction */ .chroma .nf { color: #06287e } -/* NameLabel */ .chroma .nl { color: #002070; font-weight: bold } -/* NameNamespace */ .chroma .nn { color: #0e84b5; font-weight: bold } -/* NameTag */ .chroma .nt { color: #062873; font-weight: bold } -/* NameVariable */ .chroma .nv { color: #bb60d5 } -/* LiteralString */ .chroma .s { color: #4070a0 } -/* LiteralStringAffix */ .chroma .sa { color: #4070a0 } -/* LiteralStringBacktick */ .chroma .sb { color: #4070a0 } -/* LiteralStringChar */ .chroma .sc { color: #4070a0 } -/* LiteralStringDelimiter */ .chroma .dl { color: #4070a0 } -/* LiteralStringDoc */ .chroma .sd { color: #4070a0; font-style: italic } -/* LiteralStringDouble */ .chroma .s2 { color: #4070a0 } -/* LiteralStringEscape */ .chroma .se { color: #4070a0; font-weight: bold } -/* LiteralStringHeredoc */ .chroma .sh { color: #4070a0 } -/* LiteralStringInterpol */ .chroma .si { color: #70a0d0; font-style: italic } -/* LiteralStringOther */ .chroma .sx { color: #c65d09 } -/* LiteralStringRegex */ .chroma .sr { color: #235388 } -/* LiteralStringSingle */ .chroma .s1 { color: #4070a0 } -/* LiteralStringSymbol */ .chroma .ss { color: #517918 } -/* LiteralNumber */ .chroma .m { color: #40a070 } -/* LiteralNumberBin */ .chroma .mb { color: #40a070 } -/* LiteralNumberFloat */ .chroma .mf { color: #40a070 } -/* LiteralNumberHex */ .chroma .mh { color: #40a070 } -/* LiteralNumberInteger */ .chroma .mi { color: #40a070 } -/* LiteralNumberIntegerLong */ .chroma .il { color: #40a070 } -/* LiteralNumberOct */ .chroma .mo { color: #40a070 } -/* Operator */ .chroma .o { color: #666666 } -/* OperatorWord */ .chroma .ow { color: #007020; font-weight: bold } -/* Comment */ .chroma .c { color: #60a0b0; font-style: italic } -/* CommentHashbang */ .chroma .ch { color: #60a0b0; font-style: italic } -/* CommentMultiline */ .chroma .cm { color: #60a0b0; font-style: italic } -/* CommentSingle */ .chroma .c1 { color: #60a0b0; font-style: italic } -/* CommentSpecial */ .chroma .cs { color: #60a0b0; background-color: #fff0f0 } -/* CommentPreproc */ .chroma .cp { color: #007020 } -/* CommentPreprocFile */ .chroma .cpf { color: #007020 } -/* GenericDeleted */ .chroma .gd { color: #a00000 } +/* Background */ .chroma { background-color: #ffffff } +/* Error */ .chroma .err { color: #a61717; background-color: #e3d2d2 } +/* LineTableTD */ .chroma .lntd { vertical-align: top; padding: 0; margin: 0; border: 0; } +/* LineTable */ .chroma .lntable { border-spacing: 0; padding: 0; margin: 0; border: 0; width: auto; overflow: auto; display: block; } +/* LineHighlight */ .chroma .hl { display: block; width: 100%;background-color: #ffffcc } +/* LineNumbersTable */ .chroma .lnt { margin-right: 0.4em; padding: 0 0.4em 0 0.4em; } +/* LineNumbers */ .chroma .ln { margin-right: 0.4em; padding: 0 0.4em 0 0.4em; } +/* Keyword */ .chroma .k { font-weight: bold } +/* KeywordConstant */ .chroma .kc { font-weight: bold } +/* KeywordDeclaration */ .chroma .kd { font-weight: bold } +/* KeywordNamespace */ .chroma .kn { font-weight: bold } +/* KeywordPseudo */ .chroma .kp { font-weight: bold } +/* KeywordReserved */ .chroma .kr { font-weight: bold } +/* KeywordType */ .chroma .kt { color: #445588; font-weight: bold } +/* NameAttribute */ .chroma .na { color: #008080 } +/* NameBuiltin */ .chroma .nb { color: #999999 } +/* NameClass */ .chroma .nc { color: #445588; font-weight: bold } +/* NameConstant */ .chroma .no { color: #008080 } +/* NameEntity */ .chroma .ni { color: #800080 } +/* NameException */ .chroma .ne { color: #990000; font-weight: bold } +/* NameFunction */ .chroma .nf { color: #990000; font-weight: bold } +/* NameNamespace */ .chroma .nn { color: #555555 } +/* NameTag */ .chroma .nt { color: #000080 } +/* NameVariable */ .chroma .nv { color: #008080 } +/* LiteralString */ .chroma .s { color: #bb8844 } +/* LiteralStringAffix */ .chroma .sa { color: #bb8844 } +/* LiteralStringBacktick */ .chroma .sb { color: #bb8844 } +/* LiteralStringChar */ .chroma .sc { color: #bb8844 } +/* LiteralStringDelimiter */ .chroma .dl { color: #bb8844 } +/* LiteralStringDoc */ .chroma .sd { color: #bb8844 } +/* LiteralStringDouble */ .chroma .s2 { color: #bb8844 } +/* LiteralStringEscape */ .chroma .se { color: #bb8844 } +/* LiteralStringHeredoc */ .chroma .sh { color: #bb8844 } +/* LiteralStringInterpol */ .chroma .si { color: #bb8844 } +/* LiteralStringOther */ .chroma .sx { color: #bb8844 } +/* LiteralStringRegex */ .chroma .sr { color: #808000 } +/* LiteralStringSingle */ .chroma .s1 { color: #bb8844 } +/* LiteralStringSymbol */ .chroma .ss { color: #bb8844 } +/* LiteralNumber */ .chroma .m { color: #009999 } +/* LiteralNumberBin */ .chroma .mb { color: #009999 } +/* LiteralNumberFloat */ .chroma .mf { color: #009999 } +/* LiteralNumberHex */ .chroma .mh { color: #009999 } +/* LiteralNumberInteger */ .chroma .mi { color: #009999 } +/* LiteralNumberIntegerLong */ .chroma .il { color: #009999 } +/* LiteralNumberOct */ .chroma .mo { color: #009999 } +/* Operator */ .chroma .o { font-weight: bold } +/* OperatorWord */ .chroma .ow { font-weight: bold } +/* Comment */ .chroma .c { color: #999988; font-style: italic } +/* CommentHashbang */ .chroma .ch { color: #999988; font-style: italic } +/* CommentMultiline */ .chroma .cm { color: #999988; font-style: italic } +/* CommentSingle */ .chroma .c1 { color: #999988; font-style: italic } +/* CommentSpecial */ .chroma .cs { color: #999999; font-weight: bold; font-style: italic } +/* CommentPreproc */ .chroma .cp { color: #999999; font-weight: bold } +/* CommentPreprocFile */ .chroma .cpf { color: #999999; font-weight: bold } +/* GenericDeleted */ .chroma .gd { color: #000000; background-color: #ffdddd } /* GenericEmph */ .chroma .ge { font-style: italic } -/* GenericError */ .chroma .gr { color: #ff0000 } -/* GenericHeading */ .chroma .gh { color: #000080; font-weight: bold } -/* GenericInserted */ .chroma .gi { color: #00a000 } +/* GenericError */ .chroma .gr { color: #aa0000 } +/* GenericHeading */ .chroma .gh { color: #999999 } +/* GenericInserted */ .chroma .gi { color: #000000; background-color: #ddffdd } /* GenericOutput */ .chroma .go { color: #888888 } -/* GenericPrompt */ .chroma .gp { color: #c65d09; font-weight: bold } +/* GenericPrompt */ .chroma .gp { color: #555555 } /* GenericStrong */ .chroma .gs { font-weight: bold } -/* GenericSubheading */ .chroma .gu { color: #800080; font-weight: bold } -/* GenericTraceback */ .chroma .gt { color: #0044dd } +/* GenericSubheading */ .chroma .gu { color: #aaaaaa } +/* GenericTraceback */ .chroma .gt { color: #aa0000 } /* TextWhitespace */ .chroma .w { color: #bbbbbb } diff --git a/docs/themes/gohugoioTheme/src/css/_tabs.css b/docs/themes/gohugoioTheme/src/css/_tabs.css new file mode 100644 index 000000000..4ed15b63d --- /dev/null +++ b/docs/themes/gohugoioTheme/src/css/_tabs.css @@ -0,0 +1,30 @@ +.tab-button{ + margin-bottom:1px; + position: relative; + z-index: 1; + color:#333; + border-color:#ccc; + outline: none; + background-color:white; +} +.tab-pane .chroma{ + background:none; + padding:0; +} +.tab-button.active{ + border-bottom-color:#f3f4f4; + background-color: #f4f4f4; +} +.tab-content .tab-pane{ + display: none; +} +.tab-content .tab-pane.active{ + display: block; +} +/* Treatment of copy buttons inside a tab module */ +.tab-content .copy, .tab-content .copied{ + display: none; +} +.tab-content .tab-pane.active + .copy, .tab-content .tab-pane.active + .copied{ + display: block; +}
\ No newline at end of file diff --git a/docs/themes/gohugoioTheme/src/css/main.css b/docs/themes/gohugoioTheme/src/css/main.css index db474cdfb..a3ad83a0a 100755 --- a/docs/themes/gohugoioTheme/src/css/main.css +++ b/docs/themes/gohugoioTheme/src/css/main.css @@ -13,6 +13,7 @@ @import '_algolia'; @import '_carousel'; @import '_code'; +@import '_tabs'; @import '_color-scheme'; @import '_columns'; @import '_content'; diff --git a/docs/themes/gohugoioTheme/src/js/clipboardjs.js b/docs/themes/gohugoioTheme/src/js/clipboardjs.js index f10f07c81..ffae31c7f 100644 --- a/docs/themes/gohugoioTheme/src/js/clipboardjs.js +++ b/docs/themes/gohugoioTheme/src/js/clipboardjs.js @@ -1,6 +1,9 @@ var Clipboard = require('clipboard/dist/clipboard.js'); new Clipboard('.copy', { target: function(trigger) { + if(trigger.classList.contains('copy-toggle')){ + return trigger.previousElementSibling; + } return trigger.nextElementSibling; } }).on('success', function(e) { diff --git a/docs/themes/gohugoioTheme/src/js/main.js b/docs/themes/gohugoioTheme/src/js/main.js index 4ed818478..b6ae53f3c 100755 --- a/docs/themes/gohugoioTheme/src/js/main.js +++ b/docs/themes/gohugoioTheme/src/js/main.js @@ -8,7 +8,7 @@ import './lazysizes.js' import './menutoggle.js' import './scrolldir.js' import './smoothscroll.js' - +import './tabs.js' import './nojs.js' diff --git a/docs/themes/gohugoioTheme/src/js/tabs.js b/docs/themes/gohugoioTheme/src/js/tabs.js new file mode 100644 index 000000000..dd90fdfa4 --- /dev/null +++ b/docs/themes/gohugoioTheme/src/js/tabs.js @@ -0,0 +1,43 @@ +/** + * Scripts which manages Code Toggle tabs. + */ +var i; +// store tabs variable +var allTabs = document.querySelectorAll("[data-toggle-tab]"); +var allPanes = document.querySelectorAll("[data-pane]"); + +function toggleTabs(event) { + + if(event.target){ + event.preventDefault(); + var clickedTab = event.currentTarget; + var targetKey = clickedTab.getAttribute("data-toggle-tab") + }else { + var targetKey = event + } + // We store the config language selected in users' localStorage + if(window.localStorage){ + window.localStorage.setItem("configLangPref", targetKey) + } + var selectedTabs = document.querySelectorAll("[data-toggle-tab='" + targetKey + "']"); + var selectedPanes = document.querySelectorAll("[data-pane='" + targetKey + "']"); + + for (var i = 0; i < allTabs.length; i++) { + allTabs[i].classList.remove("active"); + allPanes[i].classList.remove("active"); + } + + for (var i = 0; i < selectedTabs.length; i++) { + selectedTabs[i].classList.add("active"); + selectedPanes[i].classList.add("active"); + } + +} + +for (i = 0; i < allTabs.length; i++) { + allTabs[i].addEventListener("click", toggleTabs) +} +// Upon page load, if user has a prefered language in its localStorage, tabs are set to it. +if(window.localStorage.getItem('configLangPref')) { + toggleTabs(window.localStorage.getItem('configLangPref')) +} diff --git a/docs/themes/gohugoioTheme/static/dist/app.bundle.js b/docs/themes/gohugoioTheme/static/dist/app.bundle.js index 6c2fd668b..6391e71e9 100644 --- a/docs/themes/gohugoioTheme/static/dist/app.bundle.js +++ b/docs/themes/gohugoioTheme/static/dist/app.bundle.js @@ -1,22 +1,22 @@ -!function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=10)}([function(t,e,n){"use strict";var r=function(t){var e=document.createElement("a");return e.className="header-link",e.href="#"+t,e.innerHTML=' <svg class="fill-current o-60 hover-accent-color-light" height="22px" viewBox="0 0 24 24" width="22px" xmlns="http://www.w3.org/2000/svg"><path d="M0 0h24v24H0z" fill="none"/><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"/></svg>',e},i=function(t,e){for(var n=e.getElementsByTagName("h"+t),i=0;i<n.length;i++){var o=n[i];void 0!==o.id&&""!==o.id&&o.appendChild(r(o.id))}};document.onreadystatechange=function(){if("complete"===this.readyState){var t=document.getElementsByClassName("prose")[0];if(!t)return;for(var e=2;e<=4;e++)i(e,t)}}},function(t,e,n){"use strict";function r(t,e){t.setAttribute("class","copied bg-primary-color-dark f6 absolute top-0 right-0 lh-solid hover-bg-primary-color-dark bn white ph3 pv2"),t.setAttribute("aria-label",e)}function i(t,e){var n="cut"===e?"X":"C";return isMac?"Press ⌘-"+n:"Press Ctrl-"+n}new(n(11))(".copy",{target:function(t){return t.nextElementSibling}}).on("success",function(t){r(t.trigger,"Copied!"),t.clearSelection()}).on("error",function(t){r(t.trigger,i(t.action))})},function(t,e,n){"use strict";var r=function(){function t(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(r=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{!r&&a.return&&a.return()}finally{if(i)throw o}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=document.getElementById("prose");if(i){var o=i.getElementsByTagName("code"),s=!0,a=!1,u=void 0;try{for(var c,l=Object.entries(o)[Symbol.iterator]();!(s=(c=l.next()).done);s=!0){var h=c.value,f=r(h,2),p=(f[0],f[1]);p.scrollWidth-p.clientWidth>0&&p.parentNode.classList.add("expand")}}catch(t){a=!0,u=t}finally{try{!s&&l.return&&l.return()}finally{if(a)throw u}}}},function(t,e,n){"use strict";n(12)({apiKey:"167e7998590aebda7f9fedcf86bc4a55",indexName:"hugodocs",inputSelector:"#search-input",debug:!0})},function(t,e,n){"use strict";n(13),n(14)},function(t,e,n){"use strict";function r(){for(var t=this.dataset.target.split(" "),e=document.querySelector(".mobilemenu:not(.dn)"),n=document.querySelector(".desktopmenu:not(.dn)"),r=document.querySelector(".desktopmenu:not(.dn)"),i=0;i<t.length;i++){var o=document.querySelectorAll(t[i]);[].forEach.call(o,function(t){return t.classList.contains("dn")?t.classList.remove("dn"):t.classList.add("dn"),!1}),e&&e.classList.add("dn"),n&&n.classList.add("dn"),r&&r.classList.remove("db")}}for(var i=document.getElementsByClassName("js-toggle"),o=0;o<i.length;o++)i[o].addEventListener("click",r,!1)},function(t,e,n){"use strict";document.documentElement.className=document.documentElement.className.replace(/\bno-js\b/,"js")},function(t,e,n){"use strict";n(15)},function(t,e,n){"use strict";!function(){if("querySelector"in document&&"addEventListener"in window&&Array.prototype.forEach){var t=function(t,e){var n,r=window.pageYOffset,i=t.offsetTop,o=i-r,s=o/(e/16),a=function(){window.scrollBy(0,s),n()};n=s>=0?function(){var t=window.pageYOffset;(t>=i-s||window.innerHeight+t>=document.body.offsetHeight)&&clearInterval(u)}:function(){window.pageYOffset<=(i||0)&&clearInterval(u)};var u=setInterval(a,16)},e=document.querySelectorAll("#TableOfContents ul li a");[].forEach.call(e,function(e){e.addEventListener("click",function(n){n.preventDefault();var r=e.getAttribute("href"),i=document.querySelector(r),o=e.getAttribute("data-speed");i&&t(i,o||500)},!1)})}}()},function(t,e){},function(t,e,n){"use strict";var r=n(9);!function(t){t&&t.__esModule}(r);n(0),n(1),n(2),n(3),n(4),n(5),n(7),n(8),n(6)},function(t,e,n){var r,r;/*! +!function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=11)}([function(t,e,n){"use strict";var r=function(t){var e=document.createElement("a");return e.className="header-link",e.href="#"+t,e.innerHTML=' <svg class="fill-current o-60 hover-accent-color-light" height="22px" viewBox="0 0 24 24" width="22px" xmlns="http://www.w3.org/2000/svg"><path d="M0 0h24v24H0z" fill="none"/><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"/></svg>',e},i=function(t,e){for(var n=e.getElementsByTagName("h"+t),i=0;i<n.length;i++){var o=n[i];void 0!==o.id&&""!==o.id&&o.appendChild(r(o.id))}};document.onreadystatechange=function(){if("complete"===this.readyState){var t=document.getElementsByClassName("prose")[0];if(!t)return;for(var e=2;e<=4;e++)i(e,t)}}},function(t,e,n){"use strict";function r(t,e){t.setAttribute("class","copied bg-primary-color-dark f6 absolute top-0 right-0 lh-solid hover-bg-primary-color-dark bn white ph3 pv2"),t.setAttribute("aria-label",e)}function i(t,e){var n="cut"===e?"X":"C";return isMac?"Press ⌘-"+n:"Press Ctrl-"+n}new(n(12))(".copy",{target:function(t){return t.classList.contains("copy-toggle")?t.previousElementSibling:t.nextElementSibling}}).on("success",function(t){r(t.trigger,"Copied!"),t.clearSelection()}).on("error",function(t){r(t.trigger,i(t.action))})},function(t,e,n){"use strict";var r=function(){function t(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(r=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{!r&&a.return&&a.return()}finally{if(i)throw o}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=document.getElementById("prose");if(i){var o=i.getElementsByTagName("code"),s=!0,a=!1,u=void 0;try{for(var c,l=Object.entries(o)[Symbol.iterator]();!(s=(c=l.next()).done);s=!0){var h=c.value,f=r(h,2),p=(f[0],f[1]);p.scrollWidth-p.clientWidth>0&&p.parentNode.classList.add("expand")}}catch(t){a=!0,u=t}finally{try{!s&&l.return&&l.return()}finally{if(a)throw u}}}},function(t,e,n){"use strict";n(13)({apiKey:"167e7998590aebda7f9fedcf86bc4a55",indexName:"hugodocs",inputSelector:"#search-input",debug:!0})},function(t,e,n){"use strict";n(14),n(15)},function(t,e,n){"use strict";function r(){for(var t=this.dataset.target.split(" "),e=document.querySelector(".mobilemenu:not(.dn)"),n=document.querySelector(".desktopmenu:not(.dn)"),r=document.querySelector(".desktopmenu:not(.dn)"),i=0;i<t.length;i++){var o=document.querySelectorAll(t[i]);[].forEach.call(o,function(t){return t.classList.contains("dn")?t.classList.remove("dn"):t.classList.add("dn"),!1}),e&&e.classList.add("dn"),n&&n.classList.add("dn"),r&&r.classList.remove("db")}}for(var i=document.getElementsByClassName("js-toggle"),o=0;o<i.length;o++)i[o].addEventListener("click",r,!1)},function(t,e,n){"use strict";document.documentElement.className=document.documentElement.className.replace(/\bno-js\b/,"js")},function(t,e,n){"use strict";n(16)},function(t,e,n){"use strict";!function(){if("querySelector"in document&&"addEventListener"in window&&Array.prototype.forEach){var t=function(t,e){var n,r=window.pageYOffset,i=t.offsetTop,o=i-r,s=o/(e/16),a=function(){window.scrollBy(0,s),n()};n=s>=0?function(){var t=window.pageYOffset;(t>=i-s||window.innerHeight+t>=document.body.offsetHeight)&&clearInterval(u)}:function(){window.pageYOffset<=(i||0)&&clearInterval(u)};var u=setInterval(a,16)},e=document.querySelectorAll("#TableOfContents ul li a");[].forEach.call(e,function(e){e.addEventListener("click",function(n){n.preventDefault();var r=e.getAttribute("href"),i=document.querySelector(r),o=e.getAttribute("data-speed");i&&t(i,o||500)},!1)})}}()},function(t,e,n){"use strict";function r(t){if(t.target){t.preventDefault();var e=t.currentTarget,n=e.getAttribute("data-toggle-tab")}else var n=t;window.localStorage&&window.localStorage.setItem("configLangPref",n);for(var r=document.querySelectorAll("[data-toggle-tab='"+n+"']"),i=document.querySelectorAll("[data-pane='"+n+"']"),a=0;a<o.length;a++)o[a].classList.remove("active"),s[a].classList.remove("active");for(var a=0;a<r.length;a++)r[a].classList.add("active"),i[a].classList.add("active")}var i,o=document.querySelectorAll("[data-toggle-tab]"),s=document.querySelectorAll("[data-pane]");for(i=0;i<o.length;i++)o[i].addEventListener("click",r);window.localStorage.getItem("configLangPref")&&r(window.localStorage.getItem("configLangPref"))},function(t,e){},function(t,e,n){"use strict";var r=n(10);!function(t){t&&t.__esModule}(r);n(0),n(1),n(2),n(3),n(4),n(5),n(7),n(8),n(9),n(6)},function(t,e,n){var r,r;/*! * clipboard.js v1.7.1 * https://zenorocha.github.io/clipboard.js * * Licensed MIT © Zeno Rocha */ -!function(e){t.exports=e()}(function(){var t;return function t(e,n,i){function o(a,u){if(!n[a]){if(!e[a]){var c="function"==typeof r&&r;if(!u&&c)return r(a,!0);if(s)return s(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var h=n[a]={exports:{}};e[a][0].call(h.exports,function(t){var n=e[a][1][t];return o(n||t)},h,h.exports,t,e,n,i)}return n[a].exports}for(var s="function"==typeof r&&r,a=0;a<i.length;a++)o(i[a]);return o}({1:[function(t,e,n){function r(t,e){for(;t&&t.nodeType!==i;){if("function"==typeof t.matches&&t.matches(e))return t;t=t.parentNode}}var i=9;if("undefined"!=typeof Element&&!Element.prototype.matches){var o=Element.prototype;o.matches=o.matchesSelector||o.mozMatchesSelector||o.msMatchesSelector||o.oMatchesSelector||o.webkitMatchesSelector}e.exports=r},{}],2:[function(t,e,n){function r(t,e,n,r,o){var s=i.apply(this,arguments);return t.addEventListener(n,s,o),{destroy:function(){t.removeEventListener(n,s,o)}}}function i(t,e,n,r){return function(n){n.delegateTarget=o(n.target,e),n.delegateTarget&&r.call(t,n)}}var o=t("./closest");e.exports=r},{"./closest":1}],3:[function(t,e,n){n.node=function(t){return void 0!==t&&t instanceof HTMLElement&&1===t.nodeType},n.nodeList=function(t){var e=Object.prototype.toString.call(t);return void 0!==t&&("[object NodeList]"===e||"[object HTMLCollection]"===e)&&"length"in t&&(0===t.length||n.node(t[0]))},n.string=function(t){return"string"==typeof t||t instanceof String},n.fn=function(t){return"[object Function]"===Object.prototype.toString.call(t)}},{}],4:[function(t,e,n){function r(t,e,n){if(!t&&!e&&!n)throw new Error("Missing required arguments");if(!a.string(e))throw new TypeError("Second argument must be a String");if(!a.fn(n))throw new TypeError("Third argument must be a Function");if(a.node(t))return i(t,e,n);if(a.nodeList(t))return o(t,e,n);if(a.string(t))return s(t,e,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function i(t,e,n){return t.addEventListener(e,n),{destroy:function(){t.removeEventListener(e,n)}}}function o(t,e,n){return Array.prototype.forEach.call(t,function(t){t.addEventListener(e,n)}),{destroy:function(){Array.prototype.forEach.call(t,function(t){t.removeEventListener(e,n)})}}}function s(t,e,n){return u(document.body,t,e,n)}var a=t("./is"),u=t("delegate");e.exports=r},{"./is":3,delegate:2}],5:[function(t,e,n){function r(t){var e;if("SELECT"===t.nodeName)t.focus(),e=t.value;else if("INPUT"===t.nodeName||"TEXTAREA"===t.nodeName){var n=t.hasAttribute("readonly");n||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),n||t.removeAttribute("readonly"),e=t.value}else{t.hasAttribute("contenteditable")&&t.focus();var r=window.getSelection(),i=document.createRange();i.selectNodeContents(t),r.removeAllRanges(),r.addRange(i),e=r.toString()}return e}e.exports=r},{}],6:[function(t,e,n){function r(){}r.prototype={on:function(t,e,n){var r=this.e||(this.e={});return(r[t]||(r[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){function r(){i.off(t,r),e.apply(n,arguments)}var i=this;return r._=e,this.on(t,r,n)},emit:function(t){var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),r=0,i=n.length;for(r;r<i;r++)n[r].fn.apply(n[r].ctx,e);return this},off:function(t,e){var n=this.e||(this.e={}),r=n[t],i=[];if(r&&e)for(var o=0,s=r.length;o<s;o++)r[o].fn!==e&&r[o].fn._!==e&&i.push(r[o]);return i.length?n[t]=i:delete n[t],this}},e.exports=r},{}],7:[function(e,n,r){!function(i,o){if("function"==typeof t&&t.amd)t(["module","select"],o);else if(void 0!==r)o(n,e("select"));else{var s={exports:{}};o(s,i.select),i.clipboardAction=s.exports}}(this,function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var r=function(t){return t&&t.__esModule?t:{default:t}}(e),i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),s=function(){function t(e){n(this,t),this.resolveOptions(e),this.initSelection()}return o(t,[{key:"resolveOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action=t.action,this.container=t.container,this.emitter=t.emitter,this.target=t.target,this.text=t.text,this.trigger=t.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var t=this,e="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return t.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[e?"right":"left"]="-9999px";var n=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=n+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=(0,r.default)(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=(0,r.default)(this.target),this.copyText()}},{key:"copyText",value:function(){var t=void 0;try{t=document.execCommand(this.action)}catch(e){t=!1}this.handleResult(t)}},{key:"handleResult",value:function(t){this.emitter.emit(t?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=t,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(t){if(void 0!==t){if(!t||"object"!==(void 0===t?"undefined":i(t))||1!==t.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&t.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(t.hasAttribute("readonly")||t.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=t}},get:function(){return this._target}}]),t}();t.exports=s})},{select:5}],8:[function(e,n,r){!function(i,o){if("function"==typeof t&&t.amd)t(["module","./clipboard-action","tiny-emitter","good-listener"],o);else if(void 0!==r)o(n,e("./clipboard-action"),e("tiny-emitter"),e("good-listener"));else{var s={exports:{}};o(s,i.clipboardAction,i.tinyEmitter,i.goodListener),i.clipboard=s.exports}}(this,function(t,e,n,r){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function u(t,e){var n="data-clipboard-"+t;if(e.hasAttribute(n))return e.getAttribute(n)}var c=i(e),l=i(n),h=i(r),f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},p=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),d=function(t){function e(t,n){o(this,e);var r=s(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return r.resolveOptions(n),r.listenClick(t),r}return a(e,t),p(e,[{key:"resolveOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof t.action?t.action:this.defaultAction,this.target="function"==typeof t.target?t.target:this.defaultTarget,this.text="function"==typeof t.text?t.text:this.defaultText,this.container="object"===f(t.container)?t.container:document.body}},{key:"listenClick",value:function(t){var e=this;this.listener=(0,h.default)(t,"click",function(t){return e.onClick(t)})}},{key:"onClick",value:function(t){var e=t.delegateTarget||t.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new c.default({action:this.action(e),target:this.target(e),text:this.text(e),container:this.container,trigger:e,emitter:this})}},{key:"defaultAction",value:function(t){return u("action",t)}},{key:"defaultTarget",value:function(t){var e=u("target",t);if(e)return document.querySelector(e)}},{key:"defaultText",value:function(t){return u("text",t)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],e="string"==typeof t?[t]:t,n=!!document.queryCommandSupported;return e.forEach(function(t){n=n&&!!document.queryCommandSupported(t)}),n}}]),e}(l.default);t.exports=d})},{"./clipboard-action":7,"good-listener":4,"tiny-emitter":6}]},{},[8])(8)})},function(t,e,n){/*! docsearch 2.5.2 | © Algolia | github.com/algolia/docsearch */ -!function(e,n){t.exports=n()}("undefined"!=typeof self&&self,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=21)}([function(t,e,n){"use strict";function r(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var i=n(1);t.exports={isArray:null,isFunction:null,isObject:null,bind:null,each:null,map:null,mixin:null,isMsie:function(){return!!/(msie|trident)/i.test(navigator.userAgent)&&navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]},escapeRegExChars:function(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isNumber:function(t){return"number"==typeof t},toStr:function(t){return void 0===t||null===t?"":t+""},cloneDeep:function(t){var e |