From 0e6864f5aad8072fbdcecaad48c0151d231b1d25 Mon Sep 17 00:00:00 2001 From: Alex Shpak Date: Wed, 22 May 2019 14:37:31 +0200 Subject: [PATCH] #39, Add expand and tabs shortcodes --- assets/_markdown.scss | 2 +- assets/_shortcode.scss | 52 +++++++++++++++++ assets/book.scss | 1 + exampleSite/content/_index.md | 2 +- exampleSite/content/docs/shortcodes.md | 57 +++++++++++++++++++ exampleSite/content/menu/index.md | 3 +- ...s_48b060fe05b0a273d182ef83c0605941.content | 2 +- ...scss_48b060fe05b0a273d182ef83c0605941.json | 2 +- layouts/shortcodes/expand.html | 12 ++++ layouts/shortcodes/tab.html | 12 ++++ layouts/shortcodes/tabs.html | 19 +++++++ 11 files changed, 159 insertions(+), 5 deletions(-) create mode 100644 assets/_shortcode.scss create mode 100644 exampleSite/content/docs/shortcodes.md create mode 100644 layouts/shortcodes/expand.html create mode 100644 layouts/shortcodes/tab.html create mode 100644 layouts/shortcodes/tabs.html diff --git a/assets/_markdown.scss b/assets/_markdown.scss index 0d4ecc8..2844d22 100644 --- a/assets/_markdown.scss +++ b/assets/_markdown.scss @@ -10,7 +10,7 @@ $block-border-radius: 0.15rem; line-height: 1.25; // remove padding at the beginning of page - &:first-child { + &> :first-child { margin-top: 0; line-height: 1em; } diff --git a/assets/_shortcode.scss b/assets/_shortcode.scss new file mode 100644 index 0000000..3174bc4 --- /dev/null +++ b/assets/_shortcode.scss @@ -0,0 +1,52 @@ +@import "variables"; + +.markdown-inner { + :first-child { + margin-top: 0; + } + :last-child { + margin-bottom: 0; + } +} + +.book-expand { + border: 1px solid $gray-200; + + .book-expand-head { + background: $gray-100; + padding: $padding-8 $padding-16; + cursor: pointer; + } + + .book-expand-content { + display: none; + padding: $padding-16; + } + + input[type="checkbox"]:checked + .book-expand-content { + display: block; + } +} + +.book-tabs { + border: 1px solid $gray-200; + + .book-tabs-head { + border-bottom: $padding-1 solid $gray-100; + + label { + display: inline-block; + padding: $padding-8 $padding-16; + cursor: pointer; + } + } + + .book-tabs-content { + padding: $padding-16; + display: none; + } + + input[type="radio"]:checked + .book-tabs-content { + display: block; + } +} diff --git a/assets/book.scss b/assets/book.scss index 350088d..433970f 100644 --- a/assets/book.scss +++ b/assets/book.scss @@ -1,6 +1,7 @@ @import "normalize"; @import "variables"; @import "markdown"; +@import "shortcode"; @import "utils"; html { diff --git a/exampleSite/content/_index.md b/exampleSite/content/_index.md index 772bbe8..a984a44 100644 --- a/exampleSite/content/_index.md +++ b/exampleSite/content/_index.md @@ -72,4 +72,4 @@ at ademptae, mira. Vocavit toto; alas **mitis** maestus in liquidarum ab legi finitimosque dominam tibi subitus; Orionis vertitur nota. Currere alti etiam seroque cernitis -innumeris miraturus amplectique collo sustinet quemque! Litora ante turba? \ No newline at end of file +innumeris miraturus amplectique collo sustinet quemque! Litora ante turba? diff --git a/exampleSite/content/docs/shortcodes.md b/exampleSite/content/docs/shortcodes.md new file mode 100644 index 0000000..f610a6d --- /dev/null +++ b/exampleSite/content/docs/shortcodes.md @@ -0,0 +1,57 @@ +# Expand shortcode + +## Default + +{{< expand >}} +## Markdown content + +Some text +{{< /expand >}} + +## Custom label + +{{< expand "Custom Label" "..." >}} +## Markdown content + +Some text +{{< /expand >}} + +# Tabs + +{{< tabs "uniqueid" >}} +{{< tab "MacOS" >}} + +# MacOS + +This is tab **MacOS** content. + +Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat +stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa +protulit, sed sed aere valvis inhaesuro Pallas animam: qui _quid_, ignes. +Miseratus fonte Ditis conubia. +{{< /tab >}} + +{{< tab "Linux" >}} + +# Linux + +This is tab **Linux** content. + +Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat +stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa +protulit, sed sed aere valvis inhaesuro Pallas animam: qui _quid_, ignes. +Miseratus fonte Ditis conubia. +{{< /tab >}} + +{{< tab "Windows" >}} + +# Windows + +This is tab **Windows** content. + +Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat +stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa +protulit, sed sed aere valvis inhaesuro Pallas animam: qui _quid_, ignes. +Miseratus fonte Ditis conubia. +{{< /tab >}} +{{< /tabs >}} diff --git a/exampleSite/content/menu/index.md b/exampleSite/content/menu/index.md index cc8634d..3b535a9 100644 --- a/exampleSite/content/menu/index.md +++ b/exampleSite/content/menu/index.md @@ -5,7 +5,8 @@ headless: true - [**Introduction**]({{< relref "/" >}}) - [Examples]({{< relref "/docs/examples.md" >}}) - [With Table of contents]({{< relref "/docs/with-toc.md" >}}) - - [Without Table of Contents]({{< relref "/docs/without-toc.md" >}}) + - [Without Table of Contents]({{< relref "/docs/without-toc.md" >}}) + - [Shortcodes]({{< relref "/docs/shortcodes.md" >}}) - **More Examples** - [Server]({{< relref "/docs/server.md" >}}) - [Client]({{< relref "/docs/client.md" >}}) diff --git a/exampleSite/resources/_gen/assets/scss/book.scss_48b060fe05b0a273d182ef83c0605941.content b/exampleSite/resources/_gen/assets/scss/book.scss_48b060fe05b0a273d182ef83c0605941.content index b4f6fb8..bdde83f 100644 --- a/exampleSite/resources/_gen/assets/scss/book.scss_48b060fe05b0a273d182ef83c0605941.content +++ b/exampleSite/resources/_gen/assets/scss/book.scss_48b060fe05b0a273d182ef83c0605941.content @@ -1 +1 @@ -/*!normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css*/html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}.markdown{line-height:1.7}.markdown h1,.markdown h2,.markdown h3,.markdown h4,.markdown h5{font-weight:400;line-height:1.25}.markdown h1:first-child,.markdown h2:first-child,.markdown h3:first-child,.markdown h4:first-child,.markdown h5:first-child{margin-top:0;line-height:1em}.markdown b,.markdown optgroup,.markdown strong{font-weight:700}.markdown a{text-decoration:none}.markdown a:hover{text-decoration:underline}.markdown code{font-family:oxygen mono,monospace;padding:0 .25rem;background:#f8f9fa;border-radius:.15rem}.markdown pre{padding:1rem;background:#f8f9fa;border-radius:.15rem;font-size:.875rem;overflow-x:auto}.markdown pre code{padding:0;background:0 0}.markdown blockquote{border-left:2px solid #dee2e6;margin:0;padding:1px 1rem}.markdown blockquote :first-child{margin-top:0}.markdown blockquote :last-child{margin-bottom:0}.markdown table{border-spacing:0;border-collapse:collapse}.markdown table tr th,.markdown table tr td{padding:.5rem 1rem;line-height:1;border:1px solid #e9ecef}.markdown table tr:nth-child(2n){background:#f8f9fa}.flex{display:flex}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.align-center{align-items:center}.mx-auto{margin:0 auto}.mr-auto{margin-right:auto}.hide{display:none}html{font-size:16px;letter-spacing:.33px;scroll-behavior:smooth}html,body{min-width:20rem;overflow-x:hidden}body{color:#343a40;background:#fff;font-family:sans-serif;font-weight:400;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;box-sizing:border-box}body *{box-sizing:inherit}h1,h2,h3,h4,h5{font-weight:400}a{text-decoration:none;color:#004ed0}a:visited{color:#8440f1}img{vertical-align:middle}aside nav ul{padding:0;margin:0;list-style:none}aside nav ul li{margin:1em 0}aside nav ul a{display:block}aside nav ul a:hover{opacity:.5}aside nav ul ul{padding-left:1rem}ul.pagination{display:flex;justify-content:center}ul.pagination .page-item a{padding:1rem}.container{max-width:80rem;margin:0 auto}.book-brand{margin-top:0}.book-menu{flex:0 0 16rem;font-size:.875rem}.book-menu nav{width:16rem;padding:1rem;position:fixed;top:0;bottom:0;overflow-x:hidden;overflow-y:auto}.book-menu a{color:#343a40}.book-menu a.active{color:#004ed0}.book-section-flat{margin-bottom:2rem}.book-section-flat>a,.book-section-flat>span{font-weight:600}.book-section-flat>ul{padding-left:0}.book-page{min-width:20rem;flex-grow:1;padding:1rem}.book-header{margin-bottom:1rem;display:none}.book-toc{flex:0 0 14rem;font-size:.75rem}.book-toc nav{width:14rem;padding:1rem;position:fixed;top:0;bottom:0;overflow-x:hidden;overflow-y:auto}.book-toc nav>ul>li{margin:0}.book-git-footer{display:flex;margin-top:1rem;font-size:.875rem;align-items:baseline}.book-git-footer img{width:.875rem;vertical-align:bottom}.book-footer{display:flex;margin-top:1rem;font-size:.875rem;align-items:baseline}.book-footer img{width:.875rem;vertical-align:bottom}.book-posts{min-width:20rem;max-width:41rem;flex-grow:1;padding:1rem}.book-posts article{padding-bottom:1rem}.book-home{padding:1rem}aside nav,.book-page,.book-posts,.markdown{transition:.2s ease-in-out;transition-property:transform,margin-left,opacity;will-change:transform,margin-left}@media screen and (max-width:55rem){.book-toc{display:none}}@media screen and (max-width:41rem){.book-menu{margin-left:-16rem}.book-header{display:flex}#menu-control:checked+main .book-menu nav,#menu-control:checked+main .book-page,#menu-control:checked+main .book-posts{transform:translateX(16rem)}#menu-control:checked+main .book-header label{transform:rotate(90deg)}#menu-control:checked+main .markdown{opacity:.25}}@media screen and (min-width:80rem){.book-page,.book-posts,.book-menu nav,.book-toc nav{padding:2rem 1rem}}@font-face{font-family:oxygen;font-style:normal;font-weight:300;font-display:swap;src:url(/fonts/oxygen-v8-latin-300.eot);src:local("Oxygen Light"),local(Oxygen-Light),url(/fonts/oxygen-v8-latin-300.eot?#iefix) format("embedded-opentype"),url(/fonts/oxygen-v8-latin-300.woff2) format("woff2"),url(/fonts/oxygen-v8-latin-300.woff) format("woff"),url(/fonts/oxygen-v8-latin-300.ttf) format("truetype"),url(/fonts/oxygen-v8-latin-300.svg#Oxygen) format("svg")}@font-face{font-family:oxygen;font-style:normal;font-weight:400;font-display:swap;src:url(/fonts/oxygen-v8-latin-regular.eot);src:local("Oxygen Regular"),local(Oxygen-Regular),url(/fonts/oxygen-v8-latin-regular.eot?#iefix) format("embedded-opentype"),url(/fonts/oxygen-v8-latin-regular.woff2) format("woff2"),url(/fonts/oxygen-v8-latin-regular.woff) format("woff"),url(/fonts/oxygen-v8-latin-regular.ttf) format("truetype"),url(/fonts/oxygen-v8-latin-regular.svg#Oxygen) format("svg")}@font-face{font-family:oxygen;font-style:normal;font-weight:700;font-display:swap;src:url(/fonts/oxygen-v8-latin-700.eot);src:local("Oxygen Bold"),local(Oxygen-Bold),url(/fonts/oxygen-v8-latin-700.eot?#iefix) format("embedded-opentype"),url(/fonts/oxygen-v8-latin-700.woff2) format("woff2"),url(/fonts/oxygen-v8-latin-700.woff) format("woff"),url(/fonts/oxygen-v8-latin-700.ttf) format("truetype"),url(/fonts/oxygen-v8-latin-700.svg#Oxygen) format("svg")}@font-face{font-family:oxygen mono;font-style:normal;font-weight:400;font-display:swap;src:url(/fonts/oxygen-mono-v6-latin-regular.eot);src:local("Oxygen Mono"),local(OxygenMono-Regular),url(/fonts/oxygen-mono-v6-latin-regular.eot?#iefix) format("embedded-opentype"),url(/fonts/oxygen-mono-v6-latin-regular.woff2) format("woff2"),url(/fonts/oxygen-mono-v6-latin-regular.woff) format("woff"),url(/fonts/oxygen-mono-v6-latin-regular.ttf) format("truetype"),url(/fonts/oxygen-mono-v6-latin-regular.svg#OxygenMono) format("svg")}body{font-family:oxygen,sans-serif} \ No newline at end of file +/*!normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css*/html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}.markdown{line-height:1.7}.markdown h1,.markdown h2,.markdown h3,.markdown h4,.markdown h5{font-weight:400;line-height:1.25}.markdown h1>:first-child,.markdown h2>:first-child,.markdown h3>:first-child,.markdown h4>:first-child,.markdown h5>:first-child{margin-top:0;line-height:1em}.markdown b,.markdown optgroup,.markdown strong{font-weight:700}.markdown a{text-decoration:none}.markdown a:hover{text-decoration:underline}.markdown code{font-family:oxygen mono,monospace;padding:0 .25rem;background:#f8f9fa;border-radius:.15rem}.markdown pre{padding:1rem;background:#f8f9fa;border-radius:.15rem;font-size:.875rem;overflow-x:auto}.markdown pre code{padding:0;background:0 0}.markdown blockquote{border-left:2px solid #dee2e6;margin:0;padding:1px 1rem}.markdown blockquote :first-child{margin-top:0}.markdown blockquote :last-child{margin-bottom:0}.markdown table{border-spacing:0;border-collapse:collapse}.markdown table tr th,.markdown table tr td{padding:.5rem 1rem;line-height:1;border:1px solid #e9ecef}.markdown table tr:nth-child(2n){background:#f8f9fa}.markdown-inner :first-child{margin-top:0}.markdown-inner :last-child{margin-bottom:0}.book-expand{border:1px solid #e9ecef}.book-expand .book-expand-head{background:#f8f9fa;padding:.5rem 1rem;cursor:pointer}.book-expand .book-expand-content{display:none;padding:1rem}.book-expand input[type=checkbox]:checked+.book-expand-content{display:block}.book-tabs{border:1px solid #e9ecef}.book-tabs .book-tabs-head{border-bottom:1px solid #f8f9fa}.book-tabs .book-tabs-head label{display:inline-block;padding:.5rem 1rem;cursor:pointer}.book-tabs .book-tabs-content{padding:1rem;display:none}.book-tabs input[type=radio]:checked+.book-tabs-content{display:block}.flex{display:flex}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.align-center{align-items:center}.mx-auto{margin:0 auto}.mr-auto{margin-right:auto}.hide{display:none}html{font-size:16px;letter-spacing:.33px;scroll-behavior:smooth}html,body{min-width:20rem;overflow-x:hidden}body{color:#343a40;background:#fff;font-family:sans-serif;font-weight:400;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;box-sizing:border-box}body *{box-sizing:inherit}h1,h2,h3,h4,h5{font-weight:400}a{text-decoration:none;color:#004ed0}a:visited{color:#8440f1}img{vertical-align:middle}aside nav ul{padding:0;margin:0;list-style:none}aside nav ul li{margin:1em 0}aside nav ul a{display:block}aside nav ul a:hover{opacity:.5}aside nav ul ul{padding-left:1rem}ul.pagination{display:flex;justify-content:center}ul.pagination .page-item a{padding:1rem}.container{max-width:80rem;margin:0 auto}.book-brand{margin-top:0}.book-menu{flex:0 0 16rem;font-size:.875rem}.book-menu nav{width:16rem;padding:1rem;position:fixed;top:0;bottom:0;overflow-x:hidden;overflow-y:auto}.book-menu a{color:#343a40}.book-menu a.active{color:#004ed0}.book-section-flat{margin-bottom:2rem}.book-section-flat>a,.book-section-flat>span{font-weight:600}.book-section-flat>ul{padding-left:0}.book-page{min-width:20rem;flex-grow:1;padding:1rem}.book-header{margin-bottom:1rem;display:none}.book-toc{flex:0 0 14rem;font-size:.75rem}.book-toc nav{width:14rem;padding:1rem;position:fixed;top:0;bottom:0;overflow-x:hidden;overflow-y:auto}.book-toc nav>ul>li{margin:0}.book-git-footer{display:flex;margin-top:1rem;font-size:.875rem;align-items:baseline}.book-git-footer img{width:.875rem;vertical-align:bottom}.book-footer{display:flex;margin-top:1rem;font-size:.875rem;align-items:baseline}.book-footer img{width:.875rem;vertical-align:bottom}.book-posts{min-width:20rem;max-width:41rem;flex-grow:1;padding:1rem}.book-posts article{padding-bottom:1rem}.book-home{padding:1rem}aside nav,.book-page,.book-posts,.markdown{transition:.2s ease-in-out;transition-property:transform,margin-left,opacity;will-change:transform,margin-left}@media screen and (max-width:55rem){.book-toc{display:none}}@media screen and (max-width:41rem){.book-menu{margin-left:-16rem}.book-header{display:flex}#menu-control:checked+main .book-menu nav,#menu-control:checked+main .book-page,#menu-control:checked+main .book-posts{transform:translateX(16rem)}#menu-control:checked+main .book-header label{transform:rotate(90deg)}#menu-control:checked+main .markdown{opacity:.25}}@media screen and (min-width:80rem){.book-page,.book-posts,.book-menu nav,.book-toc nav{padding:2rem 1rem}}@font-face{font-family:oxygen;font-style:normal;font-weight:300;font-display:swap;src:url(/fonts/oxygen-v8-latin-300.eot);src:local("Oxygen Light"),local(Oxygen-Light),url(/fonts/oxygen-v8-latin-300.eot?#iefix) format("embedded-opentype"),url(/fonts/oxygen-v8-latin-300.woff2) format("woff2"),url(/fonts/oxygen-v8-latin-300.woff) format("woff"),url(/fonts/oxygen-v8-latin-300.ttf) format("truetype"),url(/fonts/oxygen-v8-latin-300.svg#Oxygen) format("svg")}@font-face{font-family:oxygen;font-style:normal;font-weight:400;font-display:swap;src:url(/fonts/oxygen-v8-latin-regular.eot);src:local("Oxygen Regular"),local(Oxygen-Regular),url(/fonts/oxygen-v8-latin-regular.eot?#iefix) format("embedded-opentype"),url(/fonts/oxygen-v8-latin-regular.woff2) format("woff2"),url(/fonts/oxygen-v8-latin-regular.woff) format("woff"),url(/fonts/oxygen-v8-latin-regular.ttf) format("truetype"),url(/fonts/oxygen-v8-latin-regular.svg#Oxygen) format("svg")}@font-face{font-family:oxygen;font-style:normal;font-weight:700;font-display:swap;src:url(/fonts/oxygen-v8-latin-700.eot);src:local("Oxygen Bold"),local(Oxygen-Bold),url(/fonts/oxygen-v8-latin-700.eot?#iefix) format("embedded-opentype"),url(/fonts/oxygen-v8-latin-700.woff2) format("woff2"),url(/fonts/oxygen-v8-latin-700.woff) format("woff"),url(/fonts/oxygen-v8-latin-700.ttf) format("truetype"),url(/fonts/oxygen-v8-latin-700.svg#Oxygen) format("svg")}@font-face{font-family:oxygen mono;font-style:normal;font-weight:400;font-display:swap;src:url(/fonts/oxygen-mono-v6-latin-regular.eot);src:local("Oxygen Mono"),local(OxygenMono-Regular),url(/fonts/oxygen-mono-v6-latin-regular.eot?#iefix) format("embedded-opentype"),url(/fonts/oxygen-mono-v6-latin-regular.woff2) format("woff2"),url(/fonts/oxygen-mono-v6-latin-regular.woff) format("woff"),url(/fonts/oxygen-mono-v6-latin-regular.ttf) format("truetype"),url(/fonts/oxygen-mono-v6-latin-regular.svg#OxygenMono) format("svg")}body{font-family:oxygen,sans-serif} \ No newline at end of file diff --git a/exampleSite/resources/_gen/assets/scss/book.scss_48b060fe05b0a273d182ef83c0605941.json b/exampleSite/resources/_gen/assets/scss/book.scss_48b060fe05b0a273d182ef83c0605941.json index 55a9707..7f3600e 100644 --- a/exampleSite/resources/_gen/assets/scss/book.scss_48b060fe05b0a273d182ef83c0605941.json +++ b/exampleSite/resources/_gen/assets/scss/book.scss_48b060fe05b0a273d182ef83c0605941.json @@ -1 +1 @@ -{"Target":"book.min.a7f2160cdf1e5775f3754e8d34cce9f404c64bff092efe992263805e4efeec6c.css","MediaType":"text/css","Data":{"Integrity":"sha256-p/IWDN8eV3XzdU6NNMzp9ATGS/8JLv6ZImOAXk7+7Gw="}} \ No newline at end of file +{"Target":"book.min.bb64fbdb003b80d0a1548f9da7bfa22acc94fbb994c7df89c380263c0f5fbf14.css","MediaType":"text/css","Data":{"Integrity":"sha256-u2T72wA7gNChVI+dp7+iKsyU+7mUx9+Jw4AmPA9fvxQ="}} \ No newline at end of file diff --git a/layouts/shortcodes/expand.html b/layouts/shortcodes/expand.html new file mode 100644 index 0000000..049fdd1 --- /dev/null +++ b/layouts/shortcodes/expand.html @@ -0,0 +1,12 @@ +
+ +
diff --git a/layouts/shortcodes/tab.html b/layouts/shortcodes/tab.html new file mode 100644 index 0000000..24520e7 --- /dev/null +++ b/layouts/shortcodes/tab.html @@ -0,0 +1,12 @@ +{{ if .Parent }} + {{ $name := .Get 0 }} + {{ $group := printf "tabs-%s" (.Parent.Get 0) }} + + {{ if not (.Parent.Scratch.Get $group) }} + {{ .Parent.Scratch.Set $group slice }} + {{ end }} + + {{ .Parent.Scratch.Add $group (dict "Name" $name "Content" .Inner) }} +{{ else }} + {{- errorf "%q: tab shortcode must be inside tabs shortcode" .Page.Path -}} +{{ end}} diff --git a/layouts/shortcodes/tabs.html b/layouts/shortcodes/tabs.html new file mode 100644 index 0000000..65c1f02 --- /dev/null +++ b/layouts/shortcodes/tabs.html @@ -0,0 +1,19 @@ +{{ if .Inner }}{{ end }} +{{ $id := .Get 0 }} +{{ $group := printf "tabs-%s" $id }} + +
+
+ {{ range $index, $tab := .Scratch.Get $group}} + + {{ end }} +
+ {{ range $index, $tab := .Scratch.Get $group}} + +
+ {{ .Content | markdownify }} +
+ {{ end }} +