diff --git a/COMMUNITY-FEATURES.md b/COMMUNITY-FEATURES.md new file mode 100644 index 0000000..230cda2 --- /dev/null +++ b/COMMUNITY-FEATURES.md @@ -0,0 +1,21 @@ +# Community features + + + +- **Social media icons** (https://github.com/...) + - This is the biggest missing feature of the theme. But now it will help your audience reach you over the internet. + - John, a javascript developer. diff --git a/README.md b/README.md index 9a7fd19..c19a7e8 100644 --- a/README.md +++ b/README.md @@ -9,24 +9,25 @@ --- - [Terminal](#terminal) - - [DEMO - https://hugo-terminal.now.sh/](#demo---httpshugo-terminalnowsh) + - [DEMO - https://hugo-terminal.now.sh/](#demo---httpshugo-terminalnowsh) - [Features](#features) - [Built-in shortcodes](#built-in-shortcodes) - [Code highlighting](#code-highlighting) - [How to start](#how-to-start) + - [How to run your site](#how-to-run-your-site) - [How to configure](#how-to-configure) - [Post archetype](#post-archetype) - [Add-ons](#add-ons) - - [How to run your site](#how-to-run-your-site) - - [How to edit the theme](#how-to-edit-the-theme) - - [How to contribute](#how-to-contribute) + - [How to (safely) edit the theme ](#how-to-safely-edit-the-theme-a-idhow-to-edit-) + - [Found a bug? ](#found-a-bug-a-idbug-) + - [New cool idea or feature? ](#new-cool-idea-or-feature-a-idfeature-) - [Terminal theme user?](#terminal-theme-user) - [Sponsoring](#sponsoring) - [License](#license) ## Features -- **5 duetone themes**, depending on your preferences (orange is default, red, blue, green, pink) +- **5 duotone themes**, depending on your preferences (orange is default, red, blue, green, pink) - [**Fira Code**](https://github.com/tonsky/FiraCode) as default monospaced font. It's gorgeous! - **really nice duotone**, custom syntax highlighting based on [**PrismJS**](https://prismjs.com) - fully responsive @@ -40,7 +41,7 @@ - **`code`** (prop required: **`language`**; props optional: **`title`**, **`id`**, **`expand`** (default "△"), **`collapse`** (default "▽"), **`isCollapsed`**) - eg: ```go - {{< code language="CSS" title="Really cool snippet" id="1" expand="Show" collapse="Hide" isCollapsed="true" >}} + {{< code language="css" title="Really cool snippet" id="1" expand="Show" collapse="Hide" isCollapsed="true" >}} pre { background: #1a1a1d; padding: 20px; @@ -91,6 +92,18 @@ If you don't want to make any radical changes, it's the best option, because you $ git submodule add https://github.com/panr/hugo-theme-terminal.git themes/terminal ``` +⚠️ **The theme needs at least Hugo version 0.74.x**. + +## How to run your site + +If you installed all needed `npm` dependencies, then you can run: + +``` +$ hugo server -t terminal +``` + +and go to `localhost:1313` in your browser. From now on all the changes you make will go live, so you don't need to refresh your browser every single time. + ## How to configure The theme doesn't require any advanced configuration. Just copy: @@ -166,37 +179,60 @@ See the basic `post` file params supported by the theme — https://github.com/p - **Extended Head** — please take a look at `layouts/partials/extended_head.html` https://github.com/panr/hugo-theme-terminal/blob/master/layouts/partials/extended_head.html - **Extended Footer** — please take a look at `layouts/partials/extended_footer.html` https://github.com/panr/hugo-theme-terminal/blob/master/layouts/partials/extended_footer.html -## How to run your site +## How to (safely) edit the theme -From your Hugo root directory run: +If you have to override only some of the styles, you can do this easily by adding `static/style.css` in your root directory and point things you want to change. -``` -$ hugo server -t terminal +To change something directly in the theme, you have to go to `themes/terminal` and modify the files. + +First, you need to install Node dependencies. To do so, go to the theme directory (from your Hugo root directory): + +```bash + $ cd themes/terminal ``` -and go to `localhost:1313` in your browser. From now on all the changes you make will go live, so you don't need to refresh your browser every single time. + then run: -## How to edit the theme + ```bash + $ npm install + $ npm i yarn + $ yarn + ``` -If you have to override some of the styles, **you can do this easily** by adding `static/style.css` in your root directory and point things you want to change. +After you modified the files you can run webpack in watch mode: -Otherwise, if you really want to edit the theme, you need to install Node dependencies. To do so, go to the theme directory (from your Hugo root directory): - -``` -$ cd themes/terminal +```bash +$ yarn dev ``` -and then run: +or rebuild theme -``` -$ npm install -$ npm i yarn -$ yarn +```bash +$ yarn build ``` -## How to contribute +To see the changes (remember to restart `hugo server`). -If you spot any bugs, please use [Issue Tracker](https://github.com/panr/hugo-theme-terminal/issues) or if you want to add a new feature directly please create a new [Pull Request](https://github.com/panr/hugo-theme-terminal/pulls). +## Found a bug? + +If you spot any bugs, please use [Issue Tracker](https://github.com/panr/hugo-theme-terminal/issues) or create a new [Pull Request](https://github.com/panr/hugo-theme-terminal/pulls) to fix the issue. + +## New cool idea or feature? + +The theme is in constant development since 2019 and has got many cool features that helped many of you and made the theme better. But there were also many features that I wasn't sure about because I want to keep the theme as simple as possible. + +So, let's say you have an idea of how to extend the theme. That's cool and you're welcome to do that, just follow these steps: + +- fork the theme +- implement the feature +- write an instruction how to use the feature +- give a working example of the implementation for other users +- add info about your work to `COMMUNITY-FEATURES.md` +- make a PR with edited `COMMUNITY-FEATURES.md` + +This will help keeping the theme close to its roots, and also allow anyone who wishes to improve it and match their needs, to do whatever they want. + +Sounds OK? Cool, let's rock! 🤘 ## Terminal theme user? @@ -210,6 +246,6 @@ If you like my work and want to support the development of the project, now you ## License -Copyright © 2019 Radosław Kozieł ([@panr](https://twitter.com/panr)) +Copyright © 2019-2020 Radosław Kozieł ([@panr](https://twitter.com/panr)) The theme is released under the MIT License. Check the [original theme license](https://github.com/panr/hugo-theme-terminal/blob/master/LICENSE.md) for additional licensing information. diff --git a/USERS.md b/USERS.md index e330530..11d3ccc 100644 --- a/USERS.md +++ b/USERS.md @@ -30,10 +30,22 @@ - https://m47r1x.github.io **Neo** (Citizen of Zion) - https://bgameiro.me/ **Bernardo Gameiro** (Engineer Physicist student) - https://return-to-libc.com/ **elraro** (Cyber Security Specialist) +- https://pablart.com/ **Pablo Diaz-Gutierrez** (Software Engineer, General Tinkerer) +- https://waterloos.niflheimr.blue/ **niflheimr1011** (Aspiring Software Engineer) +- https://monocle.rpod.club/ **classx** (DevOps Engineer) +- https://wjdevschool.com/ **Wojciech Bogócki** (Making Things & Teaching / W&J Dev School) +- https://waterloos.niflheimr.blue/ **cindrmon** (Aspiring Software Engineer and Student) +- https://dongzhi.me **Joe** (Software Developer) +- https://isaes.com.tr/ **Isa Es** (Software Engineer) +- https://conight.com **Conight Wang** (Software Engineer) +- https://blog.m5e.de/ **Christoph Miksche** (Software Developer) +- https://mpostument.com/ **Maksym Postument** (DevOps Engineer) +- https://mathiejosh.xyz **Josh Mathie** (Electrical Engineering Technology Student/Sales and Engineering Tech) +- https://yuji.ne.jp/ **YUJI** (Student & Software Developer) + --> diff --git a/source/css/buttons.css b/assets/css/buttons.css similarity index 100% rename from source/css/buttons.css rename to assets/css/buttons.css diff --git a/source/css/code.css b/assets/css/code.css similarity index 100% rename from source/css/code.css rename to assets/css/code.css diff --git a/source/css/color/blue.css b/assets/css/color/blue.css similarity index 100% rename from source/css/color/blue.css rename to assets/css/color/blue.css diff --git a/source/css/color/green.css b/assets/css/color/green.css similarity index 100% rename from source/css/color/green.css rename to assets/css/color/green.css diff --git a/source/css/color/pink.css b/assets/css/color/pink.css similarity index 100% rename from source/css/color/pink.css rename to assets/css/color/pink.css diff --git a/source/css/color/red.css b/assets/css/color/red.css similarity index 100% rename from source/css/color/red.css rename to assets/css/color/red.css diff --git a/source/css/font.css b/assets/css/font.css similarity index 76% rename from source/css/font.css rename to assets/css/font.css index 6a9eaaa..6bc5f52 100644 --- a/source/css/font.css +++ b/assets/css/font.css @@ -1,13 +1,17 @@ @font-face { + font-display: swap; font-family: 'Fira Code'; font-style: normal; font-weight: 400; src: url("../fonts/FiraCode-Regular.woff") format("woff"); + font-display: swap; } @font-face { + font-display: swap; font-family: 'Fira Code'; font-style: normal; font-weight: 800; src: url("../fonts/FiraCode-Bold.woff") format("woff"); + font-display: swap; } diff --git a/source/css/footer.css b/assets/css/footer.css similarity index 100% rename from source/css/footer.css rename to assets/css/footer.css diff --git a/source/css/header.css b/assets/css/header.css similarity index 100% rename from source/css/header.css rename to assets/css/header.css diff --git a/source/css/logo.css b/assets/css/logo.css similarity index 100% rename from source/css/logo.css rename to assets/css/logo.css diff --git a/source/css/main.css b/assets/css/main.css similarity index 79% rename from source/css/main.css rename to assets/css/main.css index 3aaefa9..6c8ba5b 100644 --- a/source/css/main.css +++ b/assets/css/main.css @@ -29,7 +29,6 @@ body { } } - .headings--one-size { h1, h2, @@ -59,6 +58,11 @@ body { a { color: inherit; + + /* Waiting for a better times... */ + /* &:has(code) { + text-decoration-color: var(--accent); + } */ } img { @@ -123,7 +127,7 @@ figure { } } -code { +code, kbd { font-family: 'Fira Code', Monaco, Consolas, Ubuntu Mono, monospace; font-feature-settings: normal; background: color-mod(var(--accent) a(20%)); @@ -131,6 +135,12 @@ code { padding: 1px 6px; margin: 0 2px; font-size: .95rem; + + code, kbd { + background: transparent; + padding: 0; + margin: 0; + } } pre { @@ -183,13 +193,38 @@ blockquote { position: relative; } - p:before { + p:first-of-type:before { content: '>'; display: block; position: absolute; left: -25px; color: var(--accent); } + + &.twitter-tweet { + position: relative; + background: color-mod(var(--accent) a(10%)); + font: inherit; + color: inherit; + border: 1px solid var(--accent); + padding-top: 60px; + + p:before { + content: ''; + } + + &:before { + content: '> From Twitter:'; + position: absolute; + top: 20px; + color: var(--accent); + font-weight: bold; + } + + a { + color: var(--accent); + } + } } table { @@ -224,10 +259,33 @@ ol { } } +ol { + list-style: none; + counter-reset: li; + + li { + counter-increment: li; + } + + li:before { + content: counter(li); + position: absolute; + right: calc(100% + 10px); + color: var(--accent); + display: inline-block; + text-align: right; + } +} + ol ol { list-style-type: lower-alpha; } +mark { + background: var(--accent); + color: var(--background); +} + .container { display: flex; flex-direction: column; diff --git a/source/css/pagination.css b/assets/css/pagination.css similarity index 100% rename from source/css/pagination.css rename to assets/css/pagination.css diff --git a/source/css/post.css b/assets/css/post.css similarity index 85% rename from source/css/post.css rename to assets/css/post.css index 19859ff..37155bc 100644 --- a/source/css/post.css +++ b/assets/css/post.css @@ -1,3 +1,20 @@ +.index-content { + margin-top: 20px; +} + +.framed { + border: 1px solid var(--accent); + padding: 20px; + + *:first-child { + margin-top: 0; + } + + *:last-child { + margin-bottom: 0; + } +} + .posts { width: 100%; } @@ -74,7 +91,7 @@ ul { list-style: none; - li:before { + li:not(:empty):before { content: '-'; position: absolute; left: -20px; @@ -109,3 +126,7 @@ h1:hover a, h2:hover a, h3:hover a, h4:hover a { visibility: visible; } + +.footnotes { + color: color-mod(var(--color) alpha(50%)); +} diff --git a/source/css/prism.css b/assets/css/prism.css similarity index 99% rename from source/css/prism.css rename to assets/css/prism.css index 0660522..d33f506 100644 --- a/source/css/prism.css +++ b/assets/css/prism.css @@ -45,6 +45,7 @@ pre[class*="language-"] { white-space: normal; } + .token.important, .token.bold { font-weight: bold; diff --git a/assets/css/style.css b/assets/css/style.css new file mode 100644 index 0000000..8f649da --- /dev/null +++ b/assets/css/style.css @@ -0,0 +1,16 @@ +@import 'variables.css'; + +@import 'font.css'; +@import 'buttons.css'; + +@import 'header.css'; +@import 'logo.css'; +@import 'main.css'; +@import 'post.css'; +@import 'pagination.css'; +@import 'footer.css'; + +@import 'prism.css'; +@import 'syntax.css'; +@import 'code.css'; +@import 'terms.css'; diff --git a/source/css/syntax.css b/assets/css/syntax.css similarity index 97% rename from source/css/syntax.css rename to assets/css/syntax.css index e1435f3..c094ad1 100644 --- a/source/css/syntax.css +++ b/assets/css/syntax.css @@ -14,7 +14,8 @@ code.language-scss, .token.statement, .token.regex, .token.atrule, -.token.number { +.token.number, +.token.inserted { color: var(--accent); } @@ -30,6 +31,7 @@ code.language-scss, .token.property, .token.function, +.token.deleted, code.language-javascript, code.language-html, .command-line-prompt > span:before { diff --git a/source/css/terms.css b/assets/css/terms.css similarity index 100% rename from source/css/terms.css rename to assets/css/terms.css diff --git a/source/css/variables.css b/assets/css/variables.css similarity index 78% rename from source/css/variables.css rename to assets/css/variables.css index 32f7495..33fd8d8 100644 --- a/source/css/variables.css +++ b/assets/css/variables.css @@ -9,5 +9,5 @@ --tabletWidth: (max-width: 900px); } -@custom-media --phone (width < 684px); -@custom-media --tablet (width < 900px); +@custom-media --phone (max-width: 684px); +@custom-media --tablet (max-width: 900px); diff --git a/source/fonts/FiraCode-Bold.woff b/assets/fonts/FiraCode-Bold.woff similarity index 100% rename from source/fonts/FiraCode-Bold.woff rename to assets/fonts/FiraCode-Bold.woff diff --git a/source/fonts/FiraCode-Regular.woff b/assets/fonts/FiraCode-Regular.woff similarity index 100% rename from source/fonts/FiraCode-Regular.woff rename to assets/fonts/FiraCode-Regular.woff diff --git a/assets/js/languageSelector.js b/assets/js/languageSelector.js new file mode 100644 index 0000000..23c9acb --- /dev/null +++ b/assets/js/languageSelector.js @@ -0,0 +1,23 @@ +const mobileQuery = getComputedStyle(document.body).getPropertyValue("--phoneWidth"); +const isMobile = () => window.matchMedia(mobileQuery).matches; + +const languageSelector = document.querySelector(".language-selector-current"); +const moreLanguagesContainer = document.querySelector(".language-selector__more"); + +document.body.addEventListener("click", () => { + if ( + !isMobile() && + moreLanguagesContainer && + !moreLanguagesContainer.classList.contains("hidden") + ) { + moreLanguagesContainer.classList.add("hidden"); + } +}); + +languageSelector && + languageSelector.addEventListener("click", (e) => { + if (!isMobile()) { + e.stopPropagation(); + moreLanguagesContainer.classList.toggle("hidden"); + } + }); diff --git a/source/js/menu.js b/assets/js/menu.js similarity index 100% rename from source/js/menu.js rename to assets/js/menu.js diff --git a/assets/js/prism.js b/assets/js/prism.js new file mode 100644 index 0000000..dcb04c7 --- /dev/null +++ b/assets/js/prism.js @@ -0,0 +1,75 @@ +/* PrismJS 1.22.0 +https://prismjs.com/download.html#themes=prism-tomorrow&languages=markup+css+clike+javascript+actionscript+apacheconf+applescript+bash+c+csharp+cpp+coffeescript+csp+css-extras+diff+django+docker+elixir+elm+erlang+fsharp+flow+git+go+graphql+haml+handlebars+haskell+http+java+json+kotlin+latex+less+makefile+markdown+markup-templating+objectivec+ocaml+perl+php+php-extras+powershell+processing+pug+python+r+jsx+tsx+reason+ruby+rust+sass+scss+scheme+sql+stylus+swift+textile+toml+twig+typescript+vim+visual-basic+wasm+yaml&plugins=line-highlight+line-numbers+jsonp-highlight+command-line+toolbar+copy-to-clipboard */ +var _self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(u){var c=/\blang(?:uage)?-([\w-]+)\b/i,n=0,M={manual:u.Prism&&u.Prism.manual,disableWorkerMessageHandler:u.Prism&&u.Prism.disableWorkerMessageHandler,util:{encode:function e(n){return n instanceof W?new W(n.type,e(n.content),n.alias):Array.isArray(n)?n.map(e):n.replace(/&/g,"&").replace(/=l.reach);k+=y.value.length,y=y.next){var b=y.value;if(t.length>n.length)return;if(!(b instanceof W)){var x=1;if(h&&y!=t.tail.prev){m.lastIndex=k;var w=m.exec(n);if(!w)break;var A=w.index+(f&&w[1]?w[1].length:0),P=w.index+w[0].length,S=k;for(S+=y.value.length;S<=A;)y=y.next,S+=y.value.length;if(S-=y.value.length,k=S,y.value instanceof W)continue;for(var E=y;E!==t.tail&&(S
l.reach&&(l.reach=j);var C=y.prev;L&&(C=I(t,C,L),k+=L.length),z(t,C,x);var _=new W(o,g?M.tokenize(O,g):O,v,O);y=I(t,C,_),N&&I(t,y,N),1
",document.body.appendChild(e),t=38===e.offsetHeight,document.body.removeChild(e)}return t},l=!0,a=0;Prism.hooks.add("before-sanity-check",function(e){var t=e.element.parentNode,n=t&&t.getAttribute("data-line");if(t&&n&&/pre/i.test(t.nodeName)){var i=0;g(".line-highlight",t).forEach(function(e){i+=e.textContent.length,e.parentNode.removeChild(e)}),i&&/^( \n)+$/.test(e.code.slice(-i))&&(e.code=e.code.slice(0,-i))}}),Prism.hooks.add("complete",function e(t){var n=t.element.parentNode,i=n&&n.getAttribute("data-line");if(n&&i&&/pre/i.test(n.nodeName)){clearTimeout(a);var r=Prism.plugins.lineNumbers,o=t.plugins&&t.plugins.lineNumbers;if(b(n,"line-numbers")&&r&&!o)Prism.hooks.add("line-numbers",e);else u(n,i)(),a=setTimeout(c,1)}}),window.addEventListener("hashchange",c),window.addEventListener("resize",function(){g("pre[data-line]").map(function(e){return u(e)}).forEach(v)})}function g(e,t){return Array.prototype.slice.call((t||document).querySelectorAll(e))}function b(e,t){return t=" "+t+" ",-1<(" "+e.className+" ").replace(/[\n\t]/g," ").indexOf(t)}function v(e){e()}function u(u,e,c){var t=(e="string"==typeof e?e:u.getAttribute("data-line")).replace(/\s+/g,"").split(",").filter(Boolean),d=+u.getAttribute("data-line-offset")||0,f=(s()?parseInt:parseFloat)(getComputedStyle(u).lineHeight),m=b(u,"line-numbers"),p=m?u:u.querySelector("code")||u,h=[];t.forEach(function(e){var t=e.split("-"),n=+t[0],i=+t[1]||n,r=u.querySelector('.line-highlight[data-range="'+e+'"]')||document.createElement("div");if(h.push(function(){r.setAttribute("aria-hidden","true"),r.setAttribute("data-range",e),r.className=(c||"")+" line-highlight"}),m&&Prism.plugins.lineNumbers){var o=Prism.plugins.lineNumbers.getLine(u,n),a=Prism.plugins.lineNumbers.getLine(u,i);if(o){var s=o.offsetTop+"px";h.push(function(){r.style.top=s})}if(a){var l=a.offsetTop-o.offsetTop+a.offsetHeight+"px";h.push(function(){r.style.height=l})}}else h.push(function(){r.setAttribute("data-start",n),n span",u).forEach(function(e,t){var n=t+a;e.onclick=function(){var e=i+"."+n;l=!1,location.hash=e,setTimeout(function(){l=!0},1)}})}}return function(){h.forEach(v)}}function c(){var e=location.hash.slice(1);g(".temporary.line-highlight").forEach(function(e){e.parentNode.removeChild(e)});var t=(e.match(/\.([\d,-]+)$/)||[,""])[1];if(t&&!document.getElementById(e)){var n=e.slice(0,e.lastIndexOf(".")),i=document.getElementById(n);if(i)i.hasAttribute("data-line")||i.setAttribute("data-line",""),u(i,t,"temporary ")(),l&&document.querySelector(".temporary.line-highlight").scrollIntoView()}}}();
+!function(){if("undefined"!=typeof self&&self.Prism&&self.document){var o="line-numbers",a=/\n(?!$)/g,e=Prism.plugins.lineNumbers={getLine:function(e,n){if("PRE"===e.tagName&&e.classList.contains(o)){var t=e.querySelector(".line-numbers-rows"),i=parseInt(e.getAttribute("data-start"),10)||1,r=i+(t.children.length-1);n");(i=document.createElement("span")).setAttribute("aria-hidden","true"),i.className="line-numbers-rows",i.innerHTML=l,t.hasAttribute("data-start")&&(t.style.counterReset="linenumber "+(parseInt(t.getAttribute("data-start"),10)-1)),e.element.appendChild(i),u([t]),Prism.hooks.run("line-numbers",e)}}}),Prism.hooks.add("line-numbers",function(e){e.plugins=e.plugins||{},e.plugins.lineNumbers=!0})}function u(e){if(0!=(e=e.filter(function(e){var n=t(e)["white-space"];return"pre-wrap"===n||"pre-line"===n})).length){var n=e.map(function(e){var n=e.querySelector("code"),t=e.querySelector(".line-numbers-rows");if(n&&t){var i=e.querySelector(".line-numbers-sizer"),r=n.textContent.split(a);i||((i=document.createElement("span")).className="line-numbers-sizer",n.appendChild(i)),i.innerHTML="0",i.style.display="block";var s=i.getBoundingClientRect().height;return i.innerHTML="",{element:e,lines:r,lineHeights:[],oneLinerHeight:s,sizer:i}}}).filter(Boolean);n.forEach(function(e){var i=e.sizer,n=e.lines,r=e.lineHeights,s=e.oneLinerHeight;r[n.length-1]=void 0,n.forEach(function(e,n){if(e&&1
+ {{ .Title | markdownify }}
+
+
+
+ {{ if .Params.tags }}
+
+ {{ end }}
+
+ {{ if .Params.Cover }}
+
+ {{ end }}
+
+
- {{ .Title | markdownify }}
-
-
- {{ if .Params.tags }}
-
- {{ end }}
-
- {{ with .Params.Cover }}
-
- {{ end }}
-
-
- {{ .Title | markdownify }}
-
{{ end }}
- {{ partial "pagination.html" . }}
-
+ {{ .Title | markdownify }}
+
+
+
+ {{ if .Params.tags }}
+
+ {{ end }}
+
+ {{ if .Params.Cover }}
+
+ {{ end }}
+
+
+ {{ if .Params.Cover }}
+
{{ end }}
{{ if .Params.Toc }}
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
index 46159eb..0d1a38d 100644
--- a/layouts/partials/footer.html
+++ b/layouts/partials/footer.html
@@ -3,10 +3,10 @@
{{ if $.Site.Copyright }}
@@ -48,13 +48,13 @@
diff --git a/layouts/shortcodes/code.html b/layouts/shortcodes/code.html
index cb11b37..8bab825 100644
--- a/layouts/shortcodes/code.html
+++ b/layouts/shortcodes/code.html
@@ -8,7 +8,7 @@
{{ if .Get "title" }}{{ .Get "title" | markdownify }}{{ end }}
-
- {{ range $.Site.Home.AllTranslations }}
-
+ {{ .Inner }}
{{ .Inner | string }}
{{ if .Get "caption" }}
-
{{ else }}
diff --git a/package.json b/package.json
index fc5670a..690eca5 100644
--- a/package.json
+++ b/package.json
@@ -1,18 +1,18 @@
{
"name": "terminal",
- "version": "1.0.0",
+ "version": "2.1.0",
"main": "index.js",
"author": "Radosław Kozieł <@panr> {{ $inner }}
",document.body.appendChild(e),t=38===e.offsetHeight,document.body.removeChild(e)}return t},l=0;Prism.hooks.add("before-sanity-check",function(e){var t=e.element.parentNode,n=t&&t.getAttribute("data-line");if(t&&n&&/pre/i.test(t.nodeName)){var i=0;r(".line-highlight",t).forEach(function(e){i+=e.textContent.length,e.parentNode.removeChild(e)}),i&&/^( \n)+$/.test(e.code.slice(-i))&&(e.code=e.code.slice(0,-i))}}),Prism.hooks.add("complete",function e(t){var n=t.element.parentNode,i=n&&n.getAttribute("data-line");if(n&&i&&/pre/i.test(n.nodeName)){clearTimeout(l);var r=Prism.plugins.lineNumbers,o=t.plugins&&t.plugins.lineNumbers;g(n,"line-numbers")&&r&&!o?Prism.hooks.add("line-numbers",e):(a(n,i),l=setTimeout(s,1))}}),window.addEventListener("hashchange",s),window.addEventListener("resize",function(){var e=document.querySelectorAll("pre[data-line]");Array.prototype.forEach.call(e,function(e){a(e)})})}function r(e,t){return Array.prototype.slice.call((t||document).querySelectorAll(e))}function g(e,t){return t=" "+t+" ",-1<(" "+e.className+" ").replace(/[\n\t]/g," ").indexOf(t)}function a(e,t,n){for(var i,r=(t="string"==typeof t?t:e.getAttribute("data-line")).replace(/\s+/g,"").split(","),o=+e.getAttribute("data-line-offset")||0,l=(h()?parseInt:parseFloat)(getComputedStyle(e).lineHeight),a=g(e,"line-numbers"),s=0;i=r[s++];){var d=i.split("-"),u=+d[0],c=+d[1]||u,m=e.querySelector('.line-highlight[data-range="'+i+'"]')||document.createElement("div");if(m.setAttribute("aria-hidden","true"),m.setAttribute("data-range",i),m.className=(n||"")+" line-highlight",a&&Prism.plugins.lineNumbers){var p=Prism.plugins.lineNumbers.getLine(e,u),f=Prism.plugins.lineNumbers.getLine(e,c);p&&(m.style.top=p.offsetTop+"px"),f&&(m.style.height=f.offsetTop-p.offsetTop+f.offsetHeight+"px")}else m.setAttribute("data-start",u),u
\", document.body.appendChild(e), t = 38 === e.offsetHeight, document.body.removeChild(e);\n }\n\n return t;\n },\n l = 0;\n\n Prism.hooks.add(\"before-sanity-check\", function (e) {\n var t = e.element.parentNode,\n n = t && t.getAttribute(\"data-line\");\n\n if (t && n && /pre/i.test(t.nodeName)) {\n var i = 0;\n r(\".line-highlight\", t).forEach(function (e) {\n i += e.textContent.length, e.parentNode.removeChild(e);\n }), i && /^( \\n)+$/.test(e.code.slice(-i)) && (e.code = e.code.slice(0, -i));\n }\n }), Prism.hooks.add(\"complete\", function e(t) {\n var n = t.element.parentNode,\n i = n && n.getAttribute(\"data-line\");\n\n if (n && i && /pre/i.test(n.nodeName)) {\n clearTimeout(l);\n var r = Prism.plugins.lineNumbers,\n o = t.plugins && t.plugins.lineNumbers;\n g(n, \"line-numbers\") && r && !o ? Prism.hooks.add(\"line-numbers\", e) : (a(n, i), l = setTimeout(s, 1));\n }\n }), window.addEventListener(\"hashchange\", s), window.addEventListener(\"resize\", function () {\n var e = document.querySelectorAll(\"pre[data-line]\");\n Array.prototype.forEach.call(e, function (e) {\n a(e);\n });\n });\n }\n\n function r(e, t) {\n return Array.prototype.slice.call((t || document).querySelectorAll(e));\n }\n\n function g(e, t) {\n return t = \" \" + t + \" \", -1 < (\" \" + e.className + \" \").replace(/[\\n\\t]/g, \" \").indexOf(t);\n }\n\n function a(e, t, n) {\n for (var i, r = (t = \"string\" == typeof t ? t : e.getAttribute(\"data-line\")).replace(/\\s+/g, \"\").split(\",\"), o = +e.getAttribute(\"data-line-offset\") || 0, l = (h() ? parseInt : parseFloat)(getComputedStyle(e).lineHeight), a = g(e, \"line-numbers\"), s = 0; i = r[s++];) {\n var d = i.split(\"-\"),\n u = +d[0],\n c = +d[1] || u,\n m = e.querySelector('.line-highlight[data-range=\"' + i + '\"]') || document.createElement(\"div\");\n\n if (m.setAttribute(\"aria-hidden\", \"true\"), m.setAttribute(\"data-range\", i), m.className = (n || \"\") + \" line-highlight\", a && Prism.plugins.lineNumbers) {\n var p = Prism.plugins.lineNumbers.getLine(e, u),\n f = Prism.plugins.lineNumbers.getLine(e, c);\n p && (m.style.top = p.offsetTop + \"px\"), f && (m.style.height = f.offsetTop - p.offsetTop + f.offsetHeight + \"px\");\n } else m.setAttribute(\"data-start\", u), u < c && m.setAttribute(\"data-end\", c), m.style.top = (u - o - 1) * l + \"px\", m.textContent = new Array(c - u + 2).join(\" \\n\");\n\n a ? e.appendChild(m) : (e.querySelector(\"code\") || e).appendChild(m);\n }\n }\n\n function s() {\n var e = location.hash.slice(1);\n r(\".temporary.line-highlight\").forEach(function (e) {\n e.parentNode.removeChild(e);\n });\n var t = (e.match(/\\.([\\d,-]+)$/) || [, \"\"])[1];\n\n if (t && !document.getElementById(e)) {\n var n = e.slice(0, e.lastIndexOf(\".\")),\n i = document.getElementById(n);\n i && (i.hasAttribute(\"data-line\") || i.setAttribute(\"data-line\", \"\"), a(i, t, \"temporary \"), document.querySelector(\".temporary.line-highlight\").scrollIntoView());\n }\n }\n}();\n!function () {\n if (\"undefined\" != typeof self && self.Prism && self.document) {\n var l = \"line-numbers\",\n c = /\\n(?!$)/g,\n m = function m(e) {\n var t = a(e)[\"white-space\"];\n\n if (\"pre-wrap\" === t || \"pre-line\" === t) {\n var n = e.querySelector(\"code\"),\n r = e.querySelector(\".line-numbers-rows\"),\n s = e.querySelector(\".line-numbers-sizer\"),\n i = n.textContent.split(c);\n s || ((s = document.createElement(\"span\")).className = \"line-numbers-sizer\", n.appendChild(s)), s.style.display = \"block\", i.forEach(function (e, t) {\n s.textContent = e || \"\\n\";\n var n = s.getBoundingClientRect().height;\n r.children[t].style.height = n + \"px\";\n }), s.textContent = \"\", s.style.display = \"none\";\n }\n },\n a = function a(e) {\n return e ? window.getComputedStyle ? getComputedStyle(e) : e.currentStyle || null : null;\n };\n\n window.addEventListener(\"resize\", function () {\n Array.prototype.forEach.call(document.querySelectorAll(\"pre.\" + l), m);\n }), Prism.hooks.add(\"complete\", function (e) {\n if (e.code) {\n var t = e.element,\n n = t.parentNode;\n\n if (n && /pre/i.test(n.nodeName) && !t.querySelector(\".line-numbers-rows\")) {\n for (var r = !1, s = /(?:^|\\s)line-numbers(?:\\s|$)/, i = t; i; i = i.parentNode) {\n if (s.test(i.className)) {\n r = !0;\n break;\n }\n }\n\n if (r) {\n t.className = t.className.replace(s, \" \"), s.test(n.className) || (n.className += \" line-numbers\");\n var l,\n a = e.code.match(c),\n o = a ? a.length + 1 : 1,\n u = new Array(o + 1).join(\"\");\n (l = document.createElement(\"span\")).setAttribute(\"aria-hidden\", \"true\"), l.className = \"line-numbers-rows\", l.innerHTML = u, n.hasAttribute(\"data-start\") && (n.style.counterReset = \"linenumber \" + (parseInt(n.getAttribute(\"data-start\"), 10) - 1)), e.element.appendChild(l), m(n), Prism.hooks.run(\"line-numbers\", e);\n }\n }\n }\n }), Prism.hooks.add(\"line-numbers\", function (e) {\n e.plugins = e.plugins || {}, e.plugins.lineNumbers = !0;\n }), Prism.plugins.lineNumbers = {\n getLine: function getLine(e, t) {\n if (\"PRE\" === e.tagName && e.classList.contains(l)) {\n var n = e.querySelector(\".line-numbers-rows\"),\n r = parseInt(e.getAttribute(\"data-start\"), 10) || 1,\n s = r + (n.children.length - 1);\n t < r && (t = r), s < t && (t = s);\n var i = t - r;\n return n.children[i];\n }\n }\n };\n }\n}();\n!function () {\n if (\"undefined\" != typeof self && self.Prism && self.document) {\n var r = [],\n i = {},\n n = function n() {};\n\n Prism.plugins.toolbar = {};\n\n var t = Prism.plugins.toolbar.registerButton = function (t, n) {\n var e;\n e = \"function\" == typeof n ? n : function (t) {\n var e;\n return \"function\" == typeof n.onClick ? ((e = document.createElement(\"button\")).type = \"button\", e.addEventListener(\"click\", function () {\n n.onClick.call(this, t);\n })) : \"string\" == typeof n.url ? (e = document.createElement(\"a\")).href = n.url : e = document.createElement(\"span\"), e.textContent = n.text, e;\n }, r.push(i[t] = e);\n },\n e = Prism.plugins.toolbar.hook = function (a) {\n var t = a.element.parentNode;\n\n if (t && /pre/i.test(t.nodeName) && !t.parentNode.classList.contains(\"code-toolbar\")) {\n var e = document.createElement(\"div\");\n e.classList.add(\"code-toolbar\"), t.parentNode.insertBefore(e, t), e.appendChild(t);\n var o = document.createElement(\"div\");\n o.classList.add(\"toolbar\"), document.body.hasAttribute(\"data-toolbar-order\") && (r = document.body.getAttribute(\"data-toolbar-order\").split(\",\").map(function (t) {\n return i[t] || n;\n })), r.forEach(function (t) {\n var e = t(a);\n\n if (e) {\n var n = document.createElement(\"div\");\n n.classList.add(\"toolbar-item\"), n.appendChild(e), o.appendChild(n);\n }\n }), e.appendChild(o);\n }\n };\n\n t(\"label\", function (t) {\n var e = t.element.parentNode;\n\n if (e && /pre/i.test(e.nodeName) && e.hasAttribute(\"data-label\")) {\n var n,\n a,\n o = e.getAttribute(\"data-label\");\n\n try {\n a = document.querySelector(\"template#\" + o);\n } catch (t) {}\n\n return a ? n = a.content : (e.hasAttribute(\"data-url\") ? (n = document.createElement(\"a\")).href = e.getAttribute(\"data-url\") : n = document.createElement(\"span\"), n.textContent = o), n;\n }\n }), Prism.hooks.add(\"complete\", e);\n }\n}();\n!function () {\n if (self.Prism && self.document && document.querySelectorAll && [].filter) {\n var d = [];\n t(function (t, e) {\n if (t && t.meta && t.data) {\n if (t.meta.status && 400 <= t.meta.status) return \"Error: \" + (t.data.message || t.meta.status);\n if (\"string\" == typeof t.data.content) return \"function\" == typeof atob ? atob(t.data.content.replace(/\\s/g, \"\")) : \"Your browser cannot decode base64\";\n }\n\n return null;\n }, \"github\"), t(function (t, e) {\n if (t && t.meta && t.data && t.data.files) {\n if (t.meta.status && 400 <= t.meta.status) return \"Error: \" + (t.data.message || t.meta.status);\n var n = t.data.files,\n a = e.getAttribute(\"data-filename\");\n if (null == a) for (var r in n) {\n if (n.hasOwnProperty(r)) {\n a = r;\n break;\n }\n }\n return void 0 !== n[a] ? n[a].content : \"Error: unknown or missing gist file \" + a;\n }\n\n return null;\n }, \"gist\"), t(function (t, e) {\n return t && t.node && \"string\" == typeof t.data ? t.data : null;\n }, \"bitbucket\");\n var s = 0,\n l = \"Loading…\";\n Prism.plugins.jsonphighlight = {\n registerAdapter: t,\n removeAdapter: function removeAdapter(t) {\n if (\"string\" == typeof t && (t = n(t)), \"function\" == typeof t) {\n var e = d.map(function (t) {\n return t.adapter;\n }).indexOf(t);\n 0 <= e && d.splice(e, 1);\n }\n },\n highlight: e\n }, e();\n }\n\n function t(t, e) {\n e = e || t.name, \"function\" != typeof t || n(t) || n(e) || d.push({\n adapter: t,\n name: e\n });\n }\n\n function n(t) {\n if (\"function\" == typeof t) {\n for (var e = 0; n = d[e++];) {\n if (n.adapter.valueOf() === t.valueOf()) return n.adapter;\n }\n } else if (\"string\" == typeof t) {\n var n;\n\n for (e = 0; n = d[e++];) {\n if (n.name === t) return n.adapter;\n }\n }\n\n return null;\n }\n\n function e() {\n Array.prototype.slice.call(document.querySelectorAll(\"pre[data-jsonp]\")).forEach(function (a) {\n a.textContent = \"\";\n var r = document.createElement(\"code\");\n r.textContent = l, a.appendChild(r);\n var t = a.getAttribute(\"data-adapter\"),\n o = null;\n\n if (t) {\n if (\"function\" != typeof window[t]) return void (r.textContent = \"JSONP adapter function '\" + t + \"' doesn't exist\");\n o = window[t];\n }\n\n var i = \"prismjsonp\" + s++,\n e = document.createElement(\"a\"),\n n = e.href = a.getAttribute(\"data-jsonp\");\n e.href += (e.search ? \"&\" : \"?\") + (a.getAttribute(\"data-callback\") || \"callback\") + \"=\" + i;\n var u = setTimeout(function () {\n r.textContent === l && (r.textContent = \"Timeout loading '\" + n + \"'\");\n }, 5e3),\n f = document.createElement(\"script\");\n f.src = e.href, window[i] = function (t) {\n document.head.removeChild(f), clearTimeout(u), delete window[i];\n var e = \"\";\n if (o) e = o(t, a);else for (var n in d) {\n if (null !== (e = d[n].adapter(t, a))) break;\n }\n null === e ? r.textContent = \"Cannot parse response (perhaps you need an adapter function?)\" : (r.textContent = e, Prism.highlightElement(r));\n }, document.head.appendChild(f);\n });\n }\n}();\n!function () {\n if (\"undefined\" != typeof self && self.Prism && self.document) {\n var u = /(?:^|\\s)command-line(?:\\s|$)/;\n Prism.hooks.add(\"before-highlight\", function (e) {\n var t = e.vars = e.vars || {},\n a = t[\"command-line\"] = t[\"command-line\"] || {};\n\n if (!a.complete && e.code) {\n var n = e.element.parentNode;\n if (n && /pre/i.test(n.nodeName) && (u.test(n.className) || u.test(e.element.className))) {\n if (e.element.querySelector(\".command-line-prompt\")) a.complete = !0;else {\n var r = e.code.split(\"\\n\");\n a.numberOfLines = r.length;\n var s = a.outputLines = [],\n o = n.getAttribute(\"data-output\"),\n i = n.getAttribute(\"data-filter-output\");\n\n if (o || \"\" === o) {\n o = o.split(\",\");\n\n for (var l = 0; l < o.length; l++) {\n var m = o[l].split(\"-\"),\n p = parseInt(m[0], 10),\n d = 2 === m.length ? parseInt(m[1], 10) : p;\n\n if (!isNaN(p) && !isNaN(d)) {\n p < 1 && (p = 1), d > r.length && (d = r.length), d--;\n\n for (var c = --p; c <= d; c++) {\n s[c] = r[c], r[c] = \"\";\n }\n }\n }\n } else if (i) for (l = 0; l < r.length; l++) {\n 0 === r[l].indexOf(i) && (s[l] = r[l].slice(i.length), r[l] = \"\");\n }\n\n e.code = r.join(\"\\n\");\n }\n } else a.complete = !0;\n } else a.complete = !0;\n }), Prism.hooks.add(\"before-insert\", function (e) {\n var t = e.vars = e.vars || {},\n a = t[\"command-line\"] = t[\"command-line\"] || {};\n\n if (!a.complete) {\n for (var n = e.highlightedCode.split(\"\\n\"), r = 0; r < a.outputLines.length; r++) {\n a.outputLines.hasOwnProperty(r) && (n[r] = a.outputLines[r]);\n }\n\n e.highlightedCode = n.join(\"\\n\");\n }\n }), Prism.hooks.add(\"complete\", function (e) {\n var t = e.vars = e.vars || {},\n a = t[\"command-line\"] = t[\"command-line\"] || {};\n\n if (!a.complete) {\n var n = e.element.parentNode;\n u.test(e.element.className) && (e.element.className = e.element.className.replace(u, \" \")), u.test(n.className) || (n.className += \" command-line\");\n\n var r = function r(e, t) {\n return (n.getAttribute(e) || t).replace(/\"/g, \""\");\n },\n s = new Array(a.numberOfLines + 1),\n o = r(\"data-prompt\", \"\");\n\n if (\"\" !== o) s = s.join('');else {\n var i = r(\"data-user\", \"user\"),\n l = r(\"data-host\", \"localhost\");\n s = s.join('');\n }\n var m = document.createElement(\"span\");\n m.className = \"command-line-prompt\", m.innerHTML = s;\n\n for (var p = 0; p < a.outputLines.length; p++) {\n if (a.outputLines.hasOwnProperty(p)) {\n var d = m.children[p];\n d.removeAttribute(\"data-user\"), d.removeAttribute(\"data-host\"), d.removeAttribute(\"data-prompt\");\n }\n }\n\n e.element.insertBefore(m, e.element.firstChild), a.complete = !0;\n }\n });\n }\n}();\n!function () {\n if (\"undefined\" != typeof self && self.Prism && self.document) if (Prism.plugins.toolbar) {\n var r = window.ClipboardJS || void 0;\n r || \"function\" != \"function\" || (r = __webpack_require__(/*! clipboard */ \"./node_modules/clipboard/dist/clipboard.js\"));\n var i = [];\n\n if (!r) {\n var o = document.createElement(\"script\"),\n e = document.querySelector(\"head\");\n o.onload = function () {\n if (r = window.ClipboardJS) for (; i.length;) {\n i.pop()();\n }\n }, o.src = \"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.0/clipboard.min.js\", e.appendChild(o);\n }\n\n Prism.plugins.toolbar.registerButton(\"copy-to-clipboard\", function (e) {\n var t = document.createElement(\"a\");\n return t.textContent = \"Copy\", r ? o() : i.push(o), t;\n\n function o() {\n var o = new r(t, {\n text: function text() {\n return e.code;\n }\n });\n o.on(\"success\", function () {\n t.textContent = \"Copied!\", n();\n }), o.on(\"error\", function () {\n t.textContent = \"Press Ctrl+C to copy\", n();\n });\n }\n\n function n() {\n setTimeout(function () {\n t.textContent = \"Copy\";\n }, 5e3);\n }\n });\n } else console.warn(\"Copy to Clipboard plugin loaded before Toolbar plugin.\");\n}();\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node_modules/webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./source/js/prism.js?");
-
-/***/ })
-
-/******/ });
\ No newline at end of file
+!function(n){var a={};function r(e){if(a[e])return a[e].exports;var t=a[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,r),t.l=!0,t.exports}r.m=n,r.c=a,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)r.d(n,a,function(e){return t[e]}.bind(null,a));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=2)}([,,function(we,e,ke){(function(e){var t,n,a,r,i,h,o,s,l,d,u,c,p,g,f,m,b,y,v,w,k=function(d){var u=/\blang(?:uage)?-([\w-]+)\b/i,t=0,N={manual:d.Prism&&d.Prism.manual,disableWorkerMessageHandler:d.Prism&&d.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof O?new O(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&").replace(/=o.reach);v+=y.value.length,y=y.next){var w=y.value;if(n.length>t.length)return;if(!(w instanceof O)){var k,S,E,x,A,_=1;if(f&&y!=n.tail.prev){if(h.lastIndex=v,!(I=h.exec(t)))break;var T=I.index+(g&&I[1]?I[1].length:0),C=I.index+I[0].length,R=v;for(R+=y.value.length;R<=T;)R+=(y=y.next).value.length;if(v=R-=y.value.length,y.value instanceof O)continue;for(var L=y;L!==n.tail&&(R span",d).forEach(function(e,t){var n=t+r;e.onclick=function(){var e=a+"."+n;P=!1,location.hash=e,setTimeout(function(){P=!0},1)}}))}return function(){m.forEach(pe)}}function fe(){var e=location.hash.slice(1);ue(".temporary.line-highlight").forEach(function(e){e.parentNode.removeChild(e)});var t,n,a=(e.match(/\.([\d,-]+)$/)||[,""])[1];a&&!document.getElementById(e)&&(t=e.slice(0,e.lastIndexOf(".")),(n=document.getElementById(t))&&(n.hasAttribute("data-line")||n.setAttribute("data-line",""),ge(n,a,"temporary ")(),P&&document.querySelector(".temporary.line-highlight").scrollIntoView()))}function me(e){var t;0!=(e=e.filter(function(e){var t=q(e)["white-space"];return"pre-wrap"===t||"pre-line"===t})).length&&((t=e.map(function(e){var t=e.querySelector("code"),n=e.querySelector(".line-numbers-rows");if(t&&n){var a=e.querySelector(".line-numbers-sizer"),r=t.textContent.split($);a||((a=document.createElement("span")).className="line-numbers-sizer",t.appendChild(a)),a.innerHTML="0",a.style.display="block";var i=a.getBoundingClientRect().height;return a.innerHTML="",{element:e,lines:r,lineHeights:[],oneLinerHeight:i,sizer:a}}}).filter(Boolean)).forEach(function(e){var a=e.sizer,t=e.lines,r=e.lineHeights,i=e.oneLinerHeight;r[t.length-1]=void 0,t.forEach(function(e,t){var n;e&&1
",document.body.appendChild(e),F=38===e.offsetHeight,document.body.removeChild(e)),F},P=!0,B=0,k.hooks.add("before-sanity-check",function(e){var t,n=e.element.parentNode,a=n&&n.getAttribute("data-line");n&&a&&/pre/i.test(n.nodeName)&&(t=0,ue(".line-highlight",n).forEach(function(e){t+=e.textContent.length,e.parentNode.removeChild(e)}),t&&/^( \n)+$/.test(e.code.slice(-t))&&(e.code=e.code.slice(0,-t)))}),k.hooks.add("complete",function e(t){var n,a,r=t.element.parentNode,i=r&&r.getAttribute("data-line");r&&i&&/pre/i.test(r.nodeName)&&(clearTimeout(B),n=k.plugins.lineNumbers,a=t.plugins&&t.plugins.lineNumbers,ce(r,"line-numbers")&&n&&!a?k.hooks.add("line-numbers",e):(ge(r,i)(),B=setTimeout(fe,1)))}),window.addEventListener("hashchange",fe),window.addEventListener("resize",function(){ue("pre[data-line]").map(function(e){return ge(e)}).forEach(pe)})),"undefined"!=typeof self&&self.Prism&&self.document&&(M="line-numbers",$=/\n(?!$)/g,z=k.plugins.lineNumbers={getLine:function(e,t){if("PRE"===e.tagName&&e.classList.contains(M)){var n=e.querySelector(".line-numbers-rows"),a=parseInt(e.getAttribute("data-start"),10)||1,r=a+(n.children.length-1);t"),(a=document.createElement("span")).setAttribute("aria-hidden","true"),a.className="line-numbers-rows",a.innerHTML=o,n.hasAttribute("data-start")&&(n.style.counterReset="linenumber "+(parseInt(n.getAttribute("data-start"),10)-1)),e.element.appendChild(a),me([n]),k.hooks.run("line-numbers",e))}),k.hooks.add("line-numbers",function(e){e.plugins=e.plugins||{},e.plugins.lineNumbers=!0})),"undefined"!=typeof self&&self.Prism&&self.document&&(j=[],be(function(e,t){if(e&&e.meta&&e.data){if(e.meta.status&&400<=e.meta.status)return"Error: "+(e.data.message||e.meta.status);if("string"==typeof e.data.content)return"function"==typeof atob?atob(e.data.content.replace(/\s/g,"")):"Your browser cannot decode base64"}return null},"github"),be(function(e,t){if(e&&e.meta&&e.data&&e.data.files){if(e.meta.status&&400<=e.meta.status)return"Error: "+(e.data.message||e.meta.status);var n=e.data.files,a=t.getAttribute("data-filename");if(null==a)for(var r in n)if(n.hasOwnProperty(r)){a=r;break}return void 0!==n[a]?n[a].content:"Error: unknown or missing gist file "+a}return null},"gist"),be(function(e,t){return e&&e.node&&"string"==typeof e.data?e.data:null},"bitbucket"),G=0,W="failed",K="pre[data-jsonp]:not(["+(H="data-jsonp-status")+'="loaded"]):not(['+H+'="'+(Z="loading")+'"])',k.hooks.add("before-highlightall",function(e){e.selector+=", "+K}),k.hooks.add("before-sanity-check",function(e){var r=e.element;if(r.matches(K)){e.code="",r.setAttribute(H,Z);var i=r.appendChild(document.createElement("CODE"));i.textContent="Loading…";var t=e.language;i.className="language-"+t;var n=k.plugins.autoloader;n&&n.loadLanguages(t);var a=r.getAttribute("data-adapter"),o=null;if(a){if("function"!=typeof window[a])return r.setAttribute(H,W),void(i.textContent='✖ Error: JSONP adapter function "'+a+"\" doesn't exist");o=window[a]}var s="prismjsonp"+G++,l=document.createElement("a"),d=l.href=r.getAttribute("data-jsonp");l.href+=(l.search?"&":"?")+(r.getAttribute("data-callback")||"callback")+"="+s;var u=setTimeout(function(){r.setAttribute(H,W),i.textContent="✖ Error: Timeout loading "+d},k.plugins.jsonphighlight.timeout),c=document.createElement("script");c.src=l.href,window[s]=function(e){document.head.removeChild(c),clearTimeout(u),delete window[s];var t=null;if(o)t=o(e,r);else for(var n=0,a=j.length;ni.length&&(a=i.length),a--;for(var r=--n;r<=a;r++)o[r]=i[r],i[r]=""}});else if(s)for(var l=0;l