2023-05-25 10:46:07 +00:00
<!DOCTYPE html>
< html lang = "pir" dir = "rtl" >
< head >
< meta charset = "utf-8" >
< meta name = "viewport" content = "height=device-height, width=device-width, initial-scale=1.0, minimum-scale=1.0" >
2023-06-03 09:12:46 +00:00
< meta name = "generator" content = "Hugo 0.112.7" >
2023-05-29 11:49:37 +00:00
< meta name = "generator" content = "Relearn 5.15.2+tip" >
2023-05-25 10:46:07 +00:00
< meta name = "description" content = "Documentation for Hugo Relearn Theme" >
< meta name = "author" content = "Sören Weber" >
< title > Tab :: Cap' n Hugo Relearrrn Theme< / title >
< link href = "https://McShelby.github.io/hugo-theme-relearn/shortcodes/tab/index.html" rel = "alternate" hreflang = "x-default" >
< link href = "https://McShelby.github.io/hugo-theme-relearn/shortcodes/tab/index.html" rel = "alternate" hreflang = "en" >
< link href = "https://McShelby.github.io/hugo-theme-relearn/pir/shortcodes/tab/index.html" rel = "alternate" hreflang = "pir" >
< link href = "https://McShelby.github.io/hugo-theme-relearn/pir/shortcodes/tab/index.html" rel = "canonical" type = "text/html" title = "Tab :: Cap'n Hugo Relearrrn Theme" >
< link href = "../../../pir/shortcodes/tab/index.xml" rel = "alternate" type = "application/rss+xml" title = "Tab :: Cap'n Hugo Relearrrn Theme" >
2023-06-05 16:33:00 +00:00
< link href = "../../../images/logo.svg?1685982774" rel = "icon" type = "image/svg+xml" >
2023-05-25 10:46:07 +00:00
<!-- https://github.com/filamentgroup/loadCSS/blob/master/README.md#how - to - use -->
2023-06-05 16:33:00 +00:00
< link href = "../../../css/fontawesome-all.min.css?1685982776" rel = "stylesheet" media = "print" onload = "this.media='all';this.onload=null;" > < noscript > < link href = "../../../css/fontawesome-all.min.css?1685982776" rel = "stylesheet" > < / noscript >
< link href = "../../../css/nucleus.css?1685982776" rel = "stylesheet" >
< link href = "../../../css/auto-complete.css?1685982776" rel = "stylesheet" media = "print" onload = "this.media='all';this.onload=null;" > < noscript > < link href = "../../../css/auto-complete.css?1685982776" rel = "stylesheet" > < / noscript >
< link href = "../../../css/perfect-scrollbar.min.css?1685982776" rel = "stylesheet" >
< link href = "../../../css/fonts.css?1685982776" rel = "stylesheet" media = "print" onload = "this.media='all';this.onload=null;" > < noscript > < link href = "../../../css/fonts.css?1685982776" rel = "stylesheet" > < / noscript >
< link href = "../../../css/theme.css?1685982776" rel = "stylesheet" >
< link href = "../../../css/theme-auto.css?1685982776" rel = "stylesheet" id = "variant-style" >
< link href = "../../../css/variant.css?1685982776" rel = "stylesheet" >
< link href = "../../../css/print.css?1685982776" rel = "stylesheet" media = "print" >
< link href = "../../../css/format-print.css?1685982776" rel = "stylesheet" >
< link href = "../../../css/ie.css?1685982776" rel = "stylesheet" >
< script src = "../../../js/url.js?1685982776" > < / script >
< script src = "../../../js/variant.js?1685982776" > < / script >
2023-05-25 10:46:07 +00:00
< script >
// hack to let hugo tell us how to get to the root when using relativeURLs, it needs to be called *url= for it to do its magic:
// https://github.com/gohugoio/hugo/blob/145b3fcce35fbac25c7033c91c1b7ae6d1179da8/transform/urlreplacers/absurlreplacer.go#L72
window.index_js_url="../../../pir/index.search.js";
var root_url="../../../";
var baseUri=root_url.replace(/\/$/, '');
// translations
window.T_Copy_to_clipboard = 'Copy t\u0027 clipboard';
window.T_Copied_to_clipboard = 'Copied t\u0027 clipboard!';
window.T_Copy_link_to_clipboard = 'Copy link t\u0027 clipboard';
window.T_Link_copied_to_clipboard = 'Copied link t\u0027 clipboard!';
window.T_No_results_found = 'No rrresults found fer \u0022{0}\u0022';
window.T_N_results_found = '{1} rrresults found fer \u0022{0}\u0022';
// some further base stuff
var baseUriFull='https:\/\/McShelby.github.io\/hugo-theme-relearn/';
window.variants & & variants.init( [ 'auto', 'relearn-bright', 'relearn-light', 'relearn-dark', 'learn', 'neon', 'blue', 'green', 'red' ] );
< / script >
< style >
#body img.bg-white {
background-color: white;
}
< / style >
< / head >
< body class = "mobile-support print disableInlineCopyToClipboard" data-url = "../../../pir/shortcodes/tab/index.html" >
< div id = "body" class = "default-animation" >
< div id = "sidebar-overlay" > < / div >
< div id = "toc-overlay" > < / div >
< nav id = "topbar" class = "highlightable" >
< div >
< div id = "breadcrumbs" >
< span id = "sidebar-toggle-span" >
< a href = "#" id = "sidebar-toggle" class = "topbar-link" title = 'Menu (CTRL+ALT+n)' > < i class = "fas fa-bars fa-fw" > < / i > < / a >
< / span >
< ol class = "links" itemscope itemtype = "http://schema.org/BreadcrumbList" >
< li itemscope itemtype = "https://schema.org/ListItem" itemprop = "itemListElement" > < a itemprop = "item" href = "../../../pir/index.html" > < span itemprop = "name" > Cap' n Hugo Relearrrn Theme< / span > < / a > < meta itemprop = "position" content = "1" > > < / li >
< li itemscope itemtype = "https://schema.org/ListItem" itemprop = "itemListElement" > < a itemprop = "item" href = "../../../pir/shortcodes/index.html" > < span itemprop = "name" > Shorrrtcodes< / span > < / a > < meta itemprop = "position" content = "2" > > < / li >
< li itemscope itemtype = "https://schema.org/ListItem" itemprop = "itemListElement" > < span itemprop = "name" > Tab< / span > < meta itemprop = "position" content = "3" > < / li >
< / ol >
< / div >
< / div >
< / nav >
< main id = "body-inner" class = "highlightable default" tabindex = "-1" >
< div class = "flex-block-wrapper" >
< article class = "default" >
< header class = "headline" >
< / header >
< h1 id = "tab" > Tab< / h1 >
< p > Ye can use a < code > tab< / code > shortcode t' display a single tab.< / p >
< p > This be especially useful if ye want t' flag yer code example wit' an explicit language.< / p >
< p > If ye want multiple tabs grouped together ye can wrap yer tabs into th' < a href = "../../../shortcodes/tabs/" > < code > tabs< / code > shortcode< / a > .< / p >
2023-06-03 22:20:43 +00:00
2023-06-05 16:33:00 +00:00
< div class = "tab-panel" data-tab-group = "836abee9349fe52380ea8bc369dcbd5b" >
2023-05-25 10:46:07 +00:00
< div class = "tab-nav" >
< button
data-tab-item="c"
2023-06-05 16:33:00 +00:00
class="tab-nav-button tab-panel-style cstyle default active"
onclick="switchTab('836abee9349fe52380ea8bc369dcbd5b','c')"
2023-05-25 10:46:07 +00:00
>
2023-06-04 22:28:49 +00:00
< div > < div > c< / div > < / div >
< / button >
2023-05-25 10:46:07 +00:00
< / div >
2023-06-05 16:33:00 +00:00
< div class = "tab-content-container" >
2023-05-25 10:46:07 +00:00
< div
data-tab-item="c"
2023-06-05 16:33:00 +00:00
class="tab-content tab-panel-style cstyle default active">
< div class = "tab-content-text" >
2023-06-04 22:25:27 +00:00
2023-05-25 10:46:07 +00:00
< div class = "highlight" > < pre tabindex = "0" class = "chroma" > < code class = "language-python" data-lang = "python" > < span class = "line" > < span class = "cl" > < span class = "n" > printf< / span > < span class = "p" > (< / span > < span class = "s2" > " Hello World!" < / span > < span class = "p" > );< / span >
< / span > < / span > < / code > < / pre > < / div > < / div >
2023-06-05 16:33:00 +00:00
< / div >
2023-05-25 10:46:07 +00:00
< / div >
< / div >
< h2 id = "usage" > Usage< / h2 >
< p > While th' examples be us'n shorrrtcodes wit' named parameter ye be free t' also call this shortcode from yer own partials.< / p >
2023-06-05 16:33:00 +00:00
< div class = "tab-panel" data-tab-group = "shortcode-parameter" >
2023-05-25 10:46:07 +00:00
< div class = "tab-nav" >
< button
data-tab-item="shortcode"
2023-06-05 16:33:00 +00:00
class="tab-nav-button tab-panel-style cstyle default active"
2023-05-25 10:46:07 +00:00
onclick="switchTab('shortcode-parameter','shortcode')"
>
2023-06-04 22:28:49 +00:00
< div > < div > shortcode< / div > < / div >
< / button >
2023-05-25 10:46:07 +00:00
< button
data-tab-item="partial"
2023-06-05 16:33:00 +00:00
class="tab-nav-button tab-panel-style cstyle default"
2023-05-25 10:46:07 +00:00
onclick="switchTab('shortcode-parameter','partial')"
>
2023-06-04 22:28:49 +00:00
< div > < div > partial< / div > < / div >
< / button >
2023-05-25 10:46:07 +00:00
< / div >
2023-06-05 16:33:00 +00:00
< div class = "tab-content-container" >
2023-05-25 10:46:07 +00:00
< div
data-tab-item="shortcode"
2023-06-05 16:33:00 +00:00
class="tab-content tab-panel-style cstyle default active">
< div class = "tab-content-text" >
2023-06-04 22:25:27 +00:00
2023-05-25 10:46:07 +00:00
< div class = "highlight" > < pre tabindex = "0" class = "chroma" > < code class = "language-go" data-lang = "go" > < span class = "line" > < span class = "cl" > < span class = "p" > {{< / span > < span class = "o" > %< / span > < span class = "nx" > tab< / span > < span class = "nx" > name< / span > < span class = "p" > =< / span > < span class = "s" > " c" < / span > < span class = "o" > %< / span > < span class = "p" > }}< / span >
< / span > < / span > < span class = "line" > < span class = "cl" > < span class = "s" > ```c
< / span > < / span > < / span > < span class = "line" > < span class = "cl" > < span class = "s" > printf(" Hello World!" );
< / span > < / span > < / span > < span class = "line" > < span class = "cl" > < span class = "s" > ```< / span >
< / span > < / span > < span class = "line" > < span class = "cl" > < span class = "p" > {{< / span > < span class = "o" > %< / span > < span class = "o" > /< / span > < span class = "nx" > tab< / span > < span class = "o" > %< / span > < span class = "p" > }}< / span >
< / span > < / span > < / code > < / pre > < / div > < / div >
2023-06-05 16:33:00 +00:00
< / div >
2023-05-25 10:46:07 +00:00
< div
data-tab-item="partial"
2023-06-05 16:33:00 +00:00
class="tab-content tab-panel-style cstyle default">
< div class = "tab-content-text" >
2023-06-04 22:25:27 +00:00
2023-05-25 10:46:07 +00:00
< div class = "highlight" > < pre tabindex = "0" class = "chroma" > < code class = "language-go" data-lang = "go" > < span class = "line" > < span class = "cl" > < span class = "p" > {{< / span > < span class = "nx" > partial< / span > < span class = "s" > " shortcodes/tab.html" < / span > < span class = "p" > (< / span > < span class = "nx" > dict< / span >
< / span > < / span > < span class = "line" > < span class = "cl" > < span class = "s" > " context" < / span > < span class = "p" > .< / span >
< / span > < / span > < span class = "line" > < span class = "cl" > < span class = "s" > " name" < / span > < span class = "s" > " c" < / span >
2023-06-03 21:51:49 +00:00
< / span > < / span > < span class = "line" > < span class = "cl" > < span class = "s" > " content" < / span > < span class = "p" > (< / span > < span class = "s" > " ```c\nprintf(\" Hello World!\" )\n```" < / span > < span class = "p" > |< / span > < span class = "p" > .< / span > < span class = "nx" > RenderStr'n< / span > < span class = "p" > )< / span >
2023-05-25 10:46:07 +00:00
< / span > < / span > < span class = "line" > < span class = "cl" > < span class = "p" > )}}< / span >
< / span > < / span > < / code > < / pre > < / div > < / div >
2023-06-05 16:33:00 +00:00
< / div >
2023-05-25 10:46:07 +00:00
< / div >
< / div >
< h3 id = "parameter" > Parameter< / h3 >
< table >
< thead >
< tr >
< th style = "text-align:left" > Name< / th >
< th style = "text-align:left" > Default< / th >
< th style = "text-align:left" > Notes< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td style = "text-align:left" > < strong > name< / strong > < / td >
< td style = "text-align:left" > < em > < empty> < / em > < / td >
< td style = "text-align:left" > Arbitrary text fer th' name o' th' tab.< / td >
< / tr >
< tr >
< td style = "text-align:left" > < em > < strong > < content> < / strong > < / em > < / td >
< td style = "text-align:left" > < em > < empty> < / em > < / td >
< td style = "text-align:left" > Arbitrary text t' be displayed 'n th' tab.< / td >
< / tr >
< / tbody >
< / table >
< h2 id = "examples" > Examples< / h2 >
< h3 id = "code-with-collapsed-margins" > Code wit' collapsed margins< / h3 >
2023-06-03 22:20:43 +00:00
2023-06-05 16:33:00 +00:00
< div class = "tab-panel" data-tab-group = "b6237d844820a6bcbcab7aa437c73699" >
2023-05-25 10:46:07 +00:00
< div class = "tab-nav" >
< button
data-tab-item="Code"
2023-06-05 16:33:00 +00:00
class="tab-nav-button tab-panel-style cstyle default active"
onclick="switchTab('b6237d844820a6bcbcab7aa437c73699','Code')"
2023-05-25 10:46:07 +00:00
>
2023-06-04 22:28:49 +00:00
< div > < div > Code< / div > < / div >
< / button >
2023-05-25 10:46:07 +00:00
< / div >
2023-06-05 16:33:00 +00:00
< div class = "tab-content-container" >
2023-05-25 10:46:07 +00:00
< div
data-tab-item="Code"
2023-06-05 16:33:00 +00:00
class="tab-content tab-panel-style cstyle default active">
< div class = "tab-content-text" >
2023-06-04 22:25:27 +00:00
2023-05-25 10:46:07 +00:00
< div class = "highlight" > < pre tabindex = "0" class = "chroma" > < code class = "language-python" data-lang = "python" > < span class = "line" > < span class = "cl" > < span class = "n" > printf< / span > < span class = "p" > (< / span > < span class = "s2" > " Hello World!" < / span > < span class = "p" > );< / span >
< / span > < / span > < / code > < / pre > < / div > < / div >
2023-06-05 16:33:00 +00:00
< / div >
2023-05-25 10:46:07 +00:00
< / div >
< / div >
< h3 id = "mixed-content" > Mixed rrrambl'n< / h3 >
2023-06-03 22:20:43 +00:00
2023-06-05 16:33:00 +00:00
< div class = "tab-panel" data-tab-group = "c902d78baf8d4203bc4dabaa7b5937b7" >
2023-05-25 10:46:07 +00:00
< div class = "tab-nav" >
< button
data-tab-item="Mixed"
2023-06-05 16:33:00 +00:00
class="tab-nav-button tab-panel-style cstyle default active"
onclick="switchTab('c902d78baf8d4203bc4dabaa7b5937b7','Mixed')"
2023-05-25 10:46:07 +00:00
>
2023-06-04 22:28:49 +00:00
< div > < div > < em > < strong > Mixed< / strong > < / em > < / div > < / div >
< / button >
2023-05-25 10:46:07 +00:00
< / div >
2023-06-05 16:33:00 +00:00
< div class = "tab-content-container" >
2023-05-25 10:46:07 +00:00
< div
data-tab-item="Mixed"
2023-06-05 16:33:00 +00:00
class="tab-content tab-panel-style cstyle default active">
< div class = "tab-content-text" >
2023-06-04 22:25:27 +00:00
2023-05-25 10:46:07 +00:00
< p > A tab can not only contain code but arbitrary text. In this case text an' code will get a margin.< / p >
< div class = "highlight" > < pre tabindex = "0" class = "chroma" > < code class = "language-python" data-lang = "python" > < span class = "line" > < span class = "cl" > < span class = "n" > printf< / span > < span class = "p" > (< / span > < span class = "s2" > " Hello World!" < / span > < span class = "p" > );< / span >
< / span > < / span > < / code > < / pre > < / div > < / div >
2023-06-05 16:33:00 +00:00
< / div >
2023-05-25 10:46:07 +00:00
< / div >
< / div >
< footer class = "footline" >
2023-05-26 06:40:21 +00:00
2023-05-25 10:46:07 +00:00
< / footer >
< / article >
< / div >
< / main >
< / div >
2023-06-05 16:33:00 +00:00
< script src = "../../../js/clipboard.min.js?1685982776" defer > < / script >
< script src = "../../../js/perfect-scrollbar.min.js?1685982776" defer > < / script >
< script src = "../../../js/theme.js?1685982776" defer > < / script >
2023-05-25 10:46:07 +00:00
< / body >
< / html >