mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 15:57:57 +00:00
6903 lines
451 KiB
HTML
6903 lines
451 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="en" dir="ltr">
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<meta name="viewport" content="height=device-height, width=device-width, initial-scale=1.0, minimum-scale=1.0">
|
||
<meta name="generator" content="Hugo 0.125.3">
|
||
<meta name="generator" content="Relearn 5.27.0+tip">
|
||
<meta name="description" content="Documentation for Hugo Relearn Theme">
|
||
<meta name="author" content="Sören Weber">
|
||
<meta name="twitter:card" content="summary_large_image">
|
||
<meta name="twitter:image" content="https://mcshelby.github.io/hugo-theme-relearn/images/hero.png">
|
||
<meta name="twitter:title" content="Shortcodes :: Hugo Relearn Theme">
|
||
<meta name="twitter:description" content="Documentation for Hugo Relearn Theme">
|
||
<meta property="og:url" content="https://mcshelby.github.io/hugo-theme-relearn/shortcodes/index.html">
|
||
<meta property="og:site_name" content="Hugo Relearn Theme">
|
||
<meta property="og:title" content="Shortcodes :: Hugo Relearn Theme">
|
||
<meta property="og:description" content="Hugo uses Markdown for its simple content format. However, there are a lot of things that Markdown doesn’t support well. You could use pure HTML to expand possibilities.
|
||
But this happens to be a bad idea. Everyone uses Markdown because it&rsquo;s pure and simple to read even non-rendered. You should avoid HTML to keep it as simple as possible.
|
||
To avoid this limitations, Hugo created shortcodes. A shortcode is a simple snippet inside a page.">
|
||
<meta property="og:locale" content="en">
|
||
<meta property="og:type" content="website">
|
||
<meta property="og:image" content="https://mcshelby.github.io/hugo-theme-relearn/images/hero.png">
|
||
<title>Shortcodes :: Hugo Relearn Theme</title>
|
||
<link href="https://mcshelby.github.io/hugo-theme-relearn/shortcodes/index.html" rel="alternate" hreflang="x-default">
|
||
<link href="https://mcshelby.github.io/hugo-theme-relearn/shortcodes/index.html" rel="alternate" hreflang="en">
|
||
<link href="https://mcshelby.github.io/hugo-theme-relearn/pir/shortcodes/index.html" rel="alternate" hreflang="art-pir">
|
||
<link href="https://mcshelby.github.io/hugo-theme-relearn/shortcodes/index.html" rel="canonical" type="text/html" title="Shortcodes :: Hugo Relearn Theme">
|
||
<link href="/hugo-theme-relearn/shortcodes/index.xml" rel="alternate" type="application/rss+xml" title="Shortcodes :: Hugo Relearn Theme">
|
||
<link href="/hugo-theme-relearn/images/logo.svg?1713902893" rel="icon" type="image/svg+xml">
|
||
<!-- https://github.com/filamentgroup/loadCSS/blob/master/README.md#how-to-use -->
|
||
<link href="/hugo-theme-relearn/css/fontawesome-all.min.css?1713902894" rel="stylesheet" media="print" onload="this.media='all';this.onload=null;"><noscript><link href="/hugo-theme-relearn/css/fontawesome-all.min.css?1713902894" rel="stylesheet"></noscript>
|
||
<link href="/hugo-theme-relearn/css/nucleus.css?1713902894" rel="stylesheet">
|
||
<link href="/hugo-theme-relearn/css/auto-complete.css?1713902894" rel="stylesheet" media="print" onload="this.media='all';this.onload=null;"><noscript><link href="/hugo-theme-relearn/css/auto-complete.css?1713902894" rel="stylesheet"></noscript>
|
||
<link href="/hugo-theme-relearn/css/perfect-scrollbar.min.css?1713902894" rel="stylesheet">
|
||
<link href="/hugo-theme-relearn/css/fonts.css?1713902894" rel="stylesheet" media="print" onload="this.media='all';this.onload=null;"><noscript><link href="/hugo-theme-relearn/css/fonts.css?1713902894" rel="stylesheet"></noscript>
|
||
<link href="/hugo-theme-relearn/css/theme.css?1713902894" rel="stylesheet">
|
||
<link href="/hugo-theme-relearn/css/theme-relearn-auto.css?1713902894" rel="stylesheet" id="R-variant-style">
|
||
<link href="/hugo-theme-relearn/css/chroma-relearn-auto.css?1713902894" rel="stylesheet" id="R-variant-chroma-style">
|
||
<link href="/hugo-theme-relearn/css/variant.css?1713902894" rel="stylesheet">
|
||
<link href="/hugo-theme-relearn/css/print.css?1713902894" rel="stylesheet" media="print">
|
||
<link href="/hugo-theme-relearn/css/format-print.css?1713902894" rel="stylesheet">
|
||
<script src="/hugo-theme-relearn/js/variant.js?1713902894"></script>
|
||
<script>
|
||
window.relearn = window.relearn || {};
|
||
window.relearn.relBasePath='..';
|
||
window.relearn.relBaseUri='..\/..';
|
||
window.relearn.absBaseUri='https:\/\/mcshelby.github.io\/hugo-theme-relearn';
|
||
window.index_js_url="/hugo-theme-relearn/index.search.js";
|
||
// variant stuff
|
||
window.variants && variants.init( [ 'relearn-auto', 'relearn-light', 'relearn-dark', 'relearn-bright', 'zen-auto', 'zen-light', 'zen-dark', 'retro-auto', 'neon', 'learn', 'blue', 'green', 'red' ] );
|
||
// translations
|
||
window.T_Copy_to_clipboard = `Copy to clipboard`;
|
||
window.T_Copied_to_clipboard = `Copied to clipboard!`;
|
||
window.T_Copy_link_to_clipboard = `Copy link to clipboard`;
|
||
window.T_Link_copied_to_clipboard = `Copied link to clipboard!`;
|
||
window.T_Reset_view = `Reset view`;
|
||
window.T_View_reset = `View reset!`;
|
||
window.T_No_results_found = `No results found for "{0}"`;
|
||
window.T_N_results_found = `{1} results found for "{0}"`;
|
||
</script>
|
||
<style>
|
||
#R-body img.bg-white {
|
||
background-color: white;
|
||
}
|
||
</style>
|
||
</head>
|
||
<body class="mobile-support print disableInlineCopyToClipboard" data-url="/hugo-theme-relearn/shortcodes/index.html">
|
||
<div id="R-body" class="default-animation">
|
||
<div id="R-body-overlay"></div>
|
||
<nav id="R-topbar">
|
||
<div class="topbar-wrapper">
|
||
<div class="topbar-sidebar-divider"></div>
|
||
<div class="topbar-area topbar-area-start" data-area="start">
|
||
<div class="topbar-button topbar-button-sidebar" data-content-empty="disable" data-width-s="show" data-width-m="hide" data-width-l="hide"><button class="topbar-control" onclick="toggleNav()" type="button" title="Menu (CTRL+ALT+n)"><i class="fa-fw fas fa-bars"></i></button>
|
||
</div>
|
||
</div>
|
||
<ol class="topbar-breadcrumbs breadcrumbs highlightable" itemscope itemtype="http://schema.org/BreadcrumbList"><li
|
||
itemscope itemtype="https://schema.org/ListItem" itemprop="itemListElement"><span itemprop="name">Shortcodes</span><meta itemprop="position" content="1"></li>
|
||
</ol>
|
||
<div class="topbar-area topbar-area-end" data-area="end">
|
||
<div class="topbar-button topbar-button-prev" data-content-empty="disable" data-width-s="show" data-width-m="show" data-width-l="show"><a class="topbar-control" href="/hugo-theme-relearn/cont/taxonomy/index.html" title="Taxonomy (🡐)"><i class="fa-fw fas fa-chevron-left"></i></a>
|
||
</div>
|
||
<div class="topbar-button topbar-button-next" data-content-empty="disable" data-width-s="show" data-width-m="show" data-width-l="show"><a class="topbar-control" href="/hugo-theme-relearn/shortcodes/badge/index.html" title="Badge (🡒)"><i class="fa-fw fas fa-chevron-right"></i></a>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</nav>
|
||
<div id="R-main-overlay"></div>
|
||
<main id="R-body-inner" class="highlightable chapter narrow" tabindex="-1">
|
||
<div class="flex-block-wrapper">
|
||
<article class="chapter">
|
||
<header class="headline">
|
||
</header>
|
||
<div class="article-subheading">Chapter 3</div>
|
||
|
||
<h1 id="shortcodes">Shortcodes</h1>
|
||
|
||
<p>Hugo uses Markdown for its simple content format. However, there are a lot of things that Markdown doesn’t support well. You could use pure HTML to expand possibilities.</p>
|
||
<p>But this happens to be a bad idea. Everyone uses Markdown because it’s pure and simple to read even non-rendered. You should avoid HTML to keep it as simple as possible.</p>
|
||
<p>To avoid this limitations, Hugo created <a href="https://gohugo.io/extras/shortcodes/" rel="external" target="_self">shortcodes</a>. A shortcode is a simple snippet inside a page.</p>
|
||
<p>The Relearn theme provides multiple shortcodes on top of existing ones.</p>
|
||
|
||
<div class="children children-h2 children-sort-">
|
||
|
||
<h2><a href="/hugo-theme-relearn/shortcodes/badge/index.html">Badge</a></h2><p>Marker badges to display in your text</p>
|
||
<h2><a href="/hugo-theme-relearn/shortcodes/button/index.html">Button</a></h2><p>Clickable buttons</p>
|
||
<h2><a href="/hugo-theme-relearn/shortcodes/children/index.html">Children</a></h2><p>List the child pages of a page</p>
|
||
<h2><a href="/hugo-theme-relearn/shortcodes/expand/index.html">Expand</a></h2><p>Expandable/collapsible sections of text</p>
|
||
<h2><a href="/hugo-theme-relearn/shortcodes/highlight/index.html">Highlight</a></h2><p>Render code with a syntax highlighter</p>
|
||
<h2><a href="/hugo-theme-relearn/shortcodes/icon/index.html">Icon</a></h2><p>Nice icons for your page</p>
|
||
<h2><a href="/hugo-theme-relearn/shortcodes/include/index.html">Include</a></h2><p>Displays content from other files</p>
|
||
<h2><a href="/hugo-theme-relearn/shortcodes/math/index.html">Math</a></h2><p>Beautiful math and chemical formulae</p>
|
||
<h2><a href="/hugo-theme-relearn/shortcodes/mermaid/index.html">Mermaid</a></h2><p>Generate diagrams and flowcharts from text</p>
|
||
<h2><a href="/hugo-theme-relearn/shortcodes/notice/index.html">Notice</a></h2><p>Disclaimers to help you structure your page</p>
|
||
<h2><a href="/hugo-theme-relearn/shortcodes/openapi/index.html">OpenAPI</a></h2><p>UI for your OpenAPI / Swagger specifications</p>
|
||
<h2><a href="/hugo-theme-relearn/shortcodes/resources/index.html">Resources</a></h2><p>List resources contained in a page bundle</p>
|
||
<h2><a href="/hugo-theme-relearn/shortcodes/siteparam/index.html">SiteParam</a></h2><p>Get value of site params</p>
|
||
<h2><a href="/hugo-theme-relearn/shortcodes/tab/index.html">Tab</a></h2><p>Show content in a single tab</p>
|
||
<h2><a href="/hugo-theme-relearn/shortcodes/tabs/index.html">Tabs</a></h2><p>Show content in tabbed views</p>
|
||
</div>
|
||
|
||
<footer class="footline">
|
||
</footer>
|
||
</article>
|
||
|
||
<section>
|
||
<h1 class="a11y-only">Subsections of Shortcodes</h1>
|
||
<article class="default">
|
||
<header class="headline">
|
||
</header>
|
||
|
||
<h1 id="badge">Badge</h1>
|
||
|
||
<p>The <code>badge</code> shortcode displays little markers in your text with adjustable color, title and icon.</p>
|
||
<p><span class="badge cstyle default"><span class="badge-content">Important</span></span>
|
||
<span class="badge cstyle primary badge-with-title"><span class="badge-title">Version</span><span class="badge-content">6.6.6</span></span>
|
||
<span class="badge cstyle red badge-with-title"><span class="badge-title"><i class="fa-fw fas fa-angle-double-up"></i></span><span class="badge-content">Captain</span></span>
|
||
<span class="badge cstyle info badge-with-title"><span class="badge-title"><i class="fa-fw fas fa-info-circle"></i> Info</span><span class="badge-content">New</span></span>
|
||
<span class="badge cstyle default badge-with-title"><span class="badge-title"><i class="fa-fw fab fa-hackerrank"></i></span><span class="badge-content" style="background-color: fuchsia;">Awesome</span></span></p>
|
||
<h2 id="usage">Usage</h2>
|
||
<p>While the examples are using shortcodes with named parameter you are free to also call this shortcode from your own partials.</p>
|
||
|
||
<div class="tab-panel" data-tab-group="shortcode-parameter">
|
||
<div class="tab-nav">
|
||
<div class="tab-nav-title">​</div>
|
||
<button
|
||
data-tab-item="shortcode"
|
||
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
|
||
onclick="switchTab('shortcode-parameter','shortcode')"
|
||
>
|
||
<span class="tab-nav-text">shortcode</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="partial"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('shortcode-parameter','partial')"
|
||
>
|
||
<span class="tab-nav-text">partial</span>
|
||
</button>
|
||
</div>
|
||
<div class="tab-content-container">
|
||
<div
|
||
data-tab-item="shortcode"
|
||
class="tab-content tab-panel-style cstyle initial active">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><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">badge</span> <span class="o">%</span><span class="p">}}</span><span class="nx">Important</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">badge</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="nx">badge</span> <span class="nx">style</span><span class="p">=</span><span class="s">"primary"</span> <span class="nx">title</span><span class="p">=</span><span class="s">"Version"</span> <span class="o">%</span><span class="p">}}</span><span class="mf">6.6.6</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">badge</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="nx">badge</span> <span class="nx">style</span><span class="p">=</span><span class="s">"red"</span> <span class="nx">icon</span><span class="p">=</span><span class="s">"angle-double-up"</span> <span class="o">%</span><span class="p">}}</span><span class="nx">Captain</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">badge</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="nx">badge</span> <span class="nx">style</span><span class="p">=</span><span class="s">"info"</span> <span class="o">%</span><span class="p">}}</span><span class="nx">New</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">badge</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="nx">badge</span> <span class="nx">color</span><span class="p">=</span><span class="s">"fuchsia"</span> <span class="nx">icon</span><span class="p">=</span><span class="s">"fa-fw fab fa-hackerrank"</span> <span class="o">%</span><span class="p">}}</span><span class="nx">Awesome</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">badge</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div></div>
|
||
</div>
|
||
<div
|
||
data-tab-item="partial"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><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/badge.html"</span> <span class="p">(</span><span class="nx">dict</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"page"</span> <span class="p">.</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"content"</span> <span class="s">"Important"</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">)}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span> <span class="nx">partial</span> <span class="s">"shortcodes/badge.html"</span> <span class="p">(</span><span class="nx">dict</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"page"</span> <span class="p">.</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"style"</span> <span class="s">"primary"</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"title"</span> <span class="s">"Version"</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"content"</span> <span class="s">"6.6.6"</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">)}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span> <span class="nx">partial</span> <span class="s">"shortcodes/badge.html"</span> <span class="p">(</span><span class="nx">dict</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"page"</span> <span class="p">.</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"style"</span> <span class="s">"red"</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"icon"</span> <span class="s">"angle-double-up"</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"content"</span> <span class="s">"Captain"</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">)}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span> <span class="nx">partial</span> <span class="s">"shortcodes/badge.html"</span> <span class="p">(</span><span class="nx">dict</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"page"</span> <span class="p">.</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"style"</span> <span class="s">"info"</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"content"</span> <span class="s">"New"</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">)}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span> <span class="nx">partial</span> <span class="s">"shortcodes/badge.html"</span> <span class="p">(</span><span class="nx">dict</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"page"</span> <span class="p">.</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"color"</span> <span class="s">"fuchsia"</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"icon"</span> <span class="s">"fab fa-hackerrank"</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"content"</span> <span class="s">"Awesome"</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">)}}</span></span></span></code></pre></div></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<h3 id="parameter">Parameter</h3>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Name</th>
|
||
<th>Default</th>
|
||
<th>Notes</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td><strong>style</strong></td>
|
||
<td><code>default</code></td>
|
||
<td>The style scheme used for the badge.<br><br>- by severity: <code>info</code>, <code>note</code>, <code>tip</code>, <code>warning</code><br>- by brand color: <code>primary</code>, <code>secondary</code>, <code>accent</code><br>- by color: <code>blue</code>, <code>green</code>, <code>grey</code>, <code>orange</code>, <code>red</code><br>- by special color: <code>default</code>, <code>transparent</code>, <code>code</code></td>
|
||
</tr>
|
||
<tr>
|
||
<td><strong>color</strong></td>
|
||
<td>see notes</td>
|
||
<td>The <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/color_value" rel="external" target="_self">CSS color value</a> to be used. If not set, the chosen color depends on the <strong>style</strong>. Any given value will overwrite the default.<br><br>- for severity styles: a nice matching color for the severity<br>- for all other styles: the corresponding color</td>
|
||
</tr>
|
||
<tr>
|
||
<td><strong>title</strong></td>
|
||
<td>see notes</td>
|
||
<td>Arbitrary text for the badge title. Depending on the <strong>style</strong> there may be a default title. Any given value will overwrite the default.<br><br>- for severity styles: the matching title for the severity<br>- for all other styles: <em><empty></em><br><br>If you want no title for a severity style, you have to set this parameter to <code>" "</code> (a non empty string filled with spaces)</td>
|
||
</tr>
|
||
<tr>
|
||
<td><strong>icon</strong></td>
|
||
<td>see notes</td>
|
||
<td><a href="/hugo-theme-relearn/shortcodes/icon/index.html#finding-an-icon">Font Awesome icon name</a> set to the left of the title. Depending on the <strong>style</strong> there may be a default icon. Any given value will overwrite the default.<br><br>- for severity styles: a nice matching icon for the severity<br>- for all other styles: <em><empty></em><br><br>If you want no icon for a severity style, you have to set this parameter to <code>" "</code> (a non empty string filled with spaces)</td>
|
||
</tr>
|
||
<tr>
|
||
<td><em><strong><content></strong></em></td>
|
||
<td><em><empty></em></td>
|
||
<td>Arbitrary text for the badge.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h2 id="examples">Examples</h2>
|
||
<h3 id="style">Style</h3>
|
||
<h4 id="by-severity">By Severity</h4>
|
||
<div class="highlight wrap-code"><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">badge</span> <span class="nx">style</span><span class="p">=</span><span class="s">"info"</span> <span class="o">%</span><span class="p">}}</span><span class="nx">New</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">badge</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="nx">badge</span> <span class="nx">style</span><span class="p">=</span><span class="s">"note"</span> <span class="o">%</span><span class="p">}}</span><span class="nx">Change</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">badge</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="nx">badge</span> <span class="nx">style</span><span class="p">=</span><span class="s">"tip"</span> <span class="o">%</span><span class="p">}}</span><span class="nx">Optional</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">badge</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="nx">badge</span> <span class="nx">style</span><span class="p">=</span><span class="s">"warning"</span> <span class="o">%</span><span class="p">}}</span><span class="nx">Breaking</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">badge</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div><p><span class="badge cstyle info badge-with-title"><span class="badge-title"><i class="fa-fw fas fa-info-circle"></i> Info</span><span class="badge-content">New</span></span>
|
||
<span class="badge cstyle note badge-with-title"><span class="badge-title"><i class="fa-fw fas fa-exclamation-circle"></i> Note</span><span class="badge-content">Change</span></span>
|
||
<span class="badge cstyle tip badge-with-title"><span class="badge-title"><i class="fa-fw fas fa-lightbulb"></i> Tip</span><span class="badge-content">Optional</span></span>
|
||
<span class="badge cstyle warning badge-with-title"><span class="badge-title"><i class="fa-fw fas fa-exclamation-triangle"></i> Warning</span><span class="badge-content">Breaking</span></span></p>
|
||
<h4 id="by-brand-colors">By Brand Colors</h4>
|
||
<div class="highlight wrap-code"><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">badge</span> <span class="nx">style</span><span class="p">=</span><span class="s">"primary"</span> <span class="nx">icon</span><span class="p">=</span><span class="s">"bullhorn"</span> <span class="nx">title</span><span class="p">=</span><span class="s">"Announcement"</span> <span class="o">%</span><span class="p">}}</span><span class="nx">Mandatory</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">badge</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="nx">badge</span> <span class="nx">style</span><span class="p">=</span><span class="s">"secondary"</span> <span class="nx">icon</span><span class="p">=</span><span class="s">"bullhorn"</span> <span class="nx">title</span><span class="p">=</span><span class="s">"Announcement"</span> <span class="o">%</span><span class="p">}}</span><span class="nx">Optional</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">badge</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="nx">badge</span> <span class="nx">style</span><span class="p">=</span><span class="s">"accent"</span> <span class="nx">icon</span><span class="p">=</span><span class="s">"bullhorn"</span> <span class="nx">title</span><span class="p">=</span><span class="s">"Announcement"</span> <span class="o">%</span><span class="p">}}</span><span class="nx">Special</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">badge</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div><p><span class="badge cstyle primary badge-with-title"><span class="badge-title"><i class="fa-fw fas fa-bullhorn"></i> Announcement</span><span class="badge-content">Mandatory</span></span>
|
||
<span class="badge cstyle secondary badge-with-title"><span class="badge-title"><i class="fa-fw fas fa-bullhorn"></i> Announcement</span><span class="badge-content">Optional</span></span>
|
||
<span class="badge cstyle accent badge-with-title"><span class="badge-title"><i class="fa-fw fas fa-bullhorn"></i> Announcement</span><span class="badge-content">Special</span></span></p>
|
||
<h4 id="by-color">By Color</h4>
|
||
<div class="highlight wrap-code"><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">badge</span> <span class="nx">style</span><span class="p">=</span><span class="s">"blue"</span> <span class="nx">icon</span><span class="p">=</span><span class="s">"palette"</span> <span class="nx">title</span><span class="p">=</span><span class="s">"Color"</span> <span class="o">%</span><span class="p">}}</span><span class="nx">Blue</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">badge</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="nx">badge</span> <span class="nx">style</span><span class="p">=</span><span class="s">"green"</span> <span class="nx">icon</span><span class="p">=</span><span class="s">"palette"</span> <span class="nx">title</span><span class="p">=</span><span class="s">"Color"</span> <span class="o">%</span><span class="p">}}</span><span class="nx">Green</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">badge</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="nx">badge</span> <span class="nx">style</span><span class="p">=</span><span class="s">"grey"</span> <span class="nx">icon</span><span class="p">=</span><span class="s">"palette"</span> <span class="nx">title</span><span class="p">=</span><span class="s">"Color"</span> <span class="o">%</span><span class="p">}}</span><span class="nx">Grey</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">badge</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="nx">badge</span> <span class="nx">style</span><span class="p">=</span><span class="s">"orange"</span> <span class="nx">icon</span><span class="p">=</span><span class="s">"palette"</span> <span class="nx">title</span><span class="p">=</span><span class="s">"Color"</span> <span class="o">%</span><span class="p">}}</span><span class="nx">Orange</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">badge</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="nx">badge</span> <span class="nx">style</span><span class="p">=</span><span class="s">"red"</span> <span class="nx">icon</span><span class="p">=</span><span class="s">"palette"</span> <span class="nx">title</span><span class="p">=</span><span class="s">"Color"</span> <span class="o">%</span><span class="p">}}</span><span class="nx">Red</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">badge</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div><p><span class="badge cstyle blue badge-with-title"><span class="badge-title"><i class="fa-fw fas fa-palette"></i> Color</span><span class="badge-content">Blue</span></span>
|
||
<span class="badge cstyle green badge-with-title"><span class="badge-title"><i class="fa-fw fas fa-palette"></i> Color</span><span class="badge-content">Green</span></span>
|
||
<span class="badge cstyle grey badge-with-title"><span class="badge-title"><i class="fa-fw fas fa-palette"></i> Color</span><span class="badge-content">Grey</span></span>
|
||
<span class="badge cstyle orange badge-with-title"><span class="badge-title"><i class="fa-fw fas fa-palette"></i> Color</span><span class="badge-content">Orange</span></span>
|
||
<span class="badge cstyle red badge-with-title"><span class="badge-title"><i class="fa-fw fas fa-palette"></i> Color</span><span class="badge-content">Red</span></span></p>
|
||
<h4 id="by-special-color">By Special Color</h4>
|
||
<div class="highlight wrap-code"><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">badge</span> <span class="nx">style</span><span class="p">=</span><span class="s">"default"</span> <span class="nx">icon</span><span class="p">=</span><span class="s">"palette"</span> <span class="nx">title</span><span class="p">=</span><span class="s">"Color"</span> <span class="o">%</span><span class="p">}}</span><span class="nx">Default</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">badge</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="nx">badge</span> <span class="nx">style</span><span class="p">=</span><span class="s">"transparent"</span> <span class="nx">icon</span><span class="p">=</span><span class="s">"palette"</span> <span class="nx">title</span><span class="p">=</span><span class="s">"Color"</span> <span class="o">%</span><span class="p">}}</span><span class="nx">Transparent</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">badge</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div><p><span class="badge cstyle default badge-with-title"><span class="badge-title"><i class="fa-fw fas fa-palette"></i> Color</span><span class="badge-content">Default</span></span>
|
||
<span class="badge cstyle transparent badge-with-title"><span class="badge-title"><i class="fa-fw fas fa-palette"></i> Color</span><span class="badge-content">Transparent</span></span></p>
|
||
<h3 id="variants">Variants</h3>
|
||
<h4 id="without-icon-and-title-text">Without Icon and Title Text</h4>
|
||
<div class="highlight wrap-code"><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">badge</span> <span class="o">%</span><span class="p">}}</span><span class="mf">6.6.6</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">badge</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="nx">badge</span> <span class="nx">style</span><span class="p">=</span><span class="s">"info"</span> <span class="nx">icon</span><span class="p">=</span><span class="s">" "</span> <span class="nx">title</span><span class="p">=</span><span class="s">" "</span> <span class="o">%</span><span class="p">}}</span><span class="nx">Awesome</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">badge</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="nx">badge</span> <span class="nx">style</span><span class="p">=</span><span class="s">"red"</span> <span class="o">%</span><span class="p">}}</span><span class="nx">Captain</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">badge</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div><p><span class="badge cstyle default"><span class="badge-content">6.6.6</span></span>
|
||
<span class="badge cstyle info"><span class="badge-content">Awesome</span></span>
|
||
<span class="badge cstyle red"><span class="badge-content">Captain</span></span></p>
|
||
<h4 id="without-icon">Without Icon</h4>
|
||
<div class="highlight wrap-code"><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">badge</span> <span class="nx">title</span><span class="p">=</span><span class="s">"Version"</span> <span class="o">%</span><span class="p">}}</span><span class="mf">6.6.6</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">badge</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="nx">badge</span> <span class="nx">style</span><span class="p">=</span><span class="s">"info"</span> <span class="nx">icon</span><span class="p">=</span><span class="s">" "</span> <span class="o">%</span><span class="p">}}</span><span class="nx">Awesome</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">badge</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="nx">badge</span> <span class="nx">style</span><span class="p">=</span><span class="s">"red"</span> <span class="nx">title</span><span class="p">=</span><span class="s">"Rank"</span> <span class="o">%</span><span class="p">}}</span><span class="nx">Captain</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">badge</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div><p><span class="badge cstyle default badge-with-title"><span class="badge-title">Version</span><span class="badge-content">6.6.6</span></span>
|
||
<span class="badge cstyle info badge-with-title"><span class="badge-title">Info</span><span class="badge-content">Awesome</span></span>
|
||
<span class="badge cstyle red badge-with-title"><span class="badge-title">Rank</span><span class="badge-content">Captain</span></span></p>
|
||
<h4 id="without-title-text">Without Title Text</h4>
|
||
<div class="highlight wrap-code"><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">badge</span> <span class="nx">icon</span><span class="p">=</span><span class="s">"star"</span> <span class="o">%</span><span class="p">}}</span><span class="mf">6.6.6</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">badge</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="nx">badge</span> <span class="nx">style</span><span class="p">=</span><span class="s">"info"</span> <span class="nx">title</span><span class="p">=</span><span class="s">" "</span> <span class="o">%</span><span class="p">}}</span><span class="nx">Awesome</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">badge</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="nx">badge</span> <span class="nx">style</span><span class="p">=</span><span class="s">"red"</span> <span class="nx">icon</span><span class="p">=</span><span class="s">"angle-double-up"</span> <span class="o">%</span><span class="p">}}</span><span class="nx">Captain</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">badge</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div><p><span class="badge cstyle default badge-with-title"><span class="badge-title"><i class="fa-fw fas fa-star"></i></span><span class="badge-content">6.6.6</span></span>
|
||
<span class="badge cstyle info badge-with-title"><span class="badge-title"><i class="fa-fw fas fa-info-circle"></i></span><span class="badge-content">Awesome</span></span>
|
||
<span class="badge cstyle red badge-with-title"><span class="badge-title"><i class="fa-fw fas fa-angle-double-up"></i></span><span class="badge-content">Captain</span></span></p>
|
||
<h4 id="all-set">All Set</h4>
|
||
<div class="highlight wrap-code"><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">badge</span> <span class="nx">icon</span><span class="p">=</span><span class="s">"star"</span> <span class="nx">title</span><span class="p">=</span><span class="s">"Version"</span> <span class="o">%</span><span class="p">}}</span><span class="mf">6.6.6</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">badge</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="nx">badge</span> <span class="nx">style</span><span class="p">=</span><span class="s">"info"</span> <span class="o">%</span><span class="p">}}</span><span class="nx">Awesome</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">badge</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="nx">badge</span> <span class="nx">style</span><span class="p">=</span><span class="s">"red"</span> <span class="nx">icon</span><span class="p">=</span><span class="s">"angle-double-up"</span> <span class="nx">title</span><span class="p">=</span><span class="s">"Rank"</span> <span class="o">%</span><span class="p">}}</span><span class="nx">Captain</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">badge</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div><p><span class="badge cstyle default badge-with-title"><span class="badge-title"><i class="fa-fw fas fa-star"></i> Version</span><span class="badge-content">6.6.6</span></span>
|
||
<span class="badge cstyle info badge-with-title"><span class="badge-title"><i class="fa-fw fas fa-info-circle"></i> Info</span><span class="badge-content">Awesome</span></span>
|
||
<span class="badge cstyle red badge-with-title"><span class="badge-title"><i class="fa-fw fas fa-angle-double-up"></i> Rank</span><span class="badge-content">Captain</span></span></p>
|
||
<h4 id="override-for-severity">Override for Severity</h4>
|
||
<div class="highlight wrap-code"><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">badge</span> <span class="nx">style</span><span class="p">=</span><span class="s">"info"</span> <span class="nx">icon</span><span class="p">=</span><span class="s">"rocket"</span> <span class="nx">title</span><span class="p">=</span><span class="s">"Feature"</span> <span class="o">%</span><span class="p">}}</span><span class="nx">Awesome</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">badge</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div><span class="badge cstyle info badge-with-title"><span class="badge-title"><i class="fa-fw fas fa-rocket"></i> Feature</span><span class="badge-content">Awesome</span></span>
|
||
<h3 id="other">Other</h3>
|
||
<h4 id="with-user-defined-color-font-awesome-brand-icon-and-markdown-title-and-content">With User-Defined Color, Font Awesome Brand Icon and Markdown Title and Content</h4>
|
||
<div class="highlight wrap-code"><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">badge</span> <span class="nx">color</span><span class="p">=</span><span class="s">"fuchsia"</span> <span class="nx">icon</span><span class="p">=</span><span class="s">"fa-fw fab fa-hackerrank"</span> <span class="nx">title</span><span class="p">=</span><span class="s">"**Font**"</span> <span class="o">%</span><span class="p">}}</span><span class="o">**</span><span class="nx">Awesome</span><span class="o">**</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">badge</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div><span class="badge cstyle default badge-with-title"><span class="badge-title"><i class="fa-fw fab fa-hackerrank"></i> <strong>Font</strong></span><span class="badge-content" style="background-color: fuchsia;"><strong>Awesome</strong></span></span>
|
||
<h4 id="with-icon-content">With Icon Content</h4>
|
||
<p>You can combine the badge with the <a href="/hugo-theme-relearn/shortcodes/icon/index.html"><code>icon</code> shortcode</a> to create even more stunning visuals.</p>
|
||
<p>In this case you need to declare <code>{{< badge >}}</code> instead of <code>{{% badge %}}</code>. Note, that in this case it is not possible to put markdown in the content.</p>
|
||
<div class="highlight wrap-code"><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">badge</span> <span class="nx">style</span><span class="p">=</span><span class="s">"primary"</span> <span class="nx">icon</span><span class="p">=</span><span class="s">"angle-double-up"</span> <span class="p">>}}{{</span><span class="o">%</span> <span class="nx">icon</span> <span class="nx">skull</span><span class="o">-</span><span class="nx">crossbones</span> <span class="o">%</span><span class="p">}}{{<</span> <span class="o">/</span><span class="nx">badge</span> <span class="p">>}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{<</span> <span class="nx">badge</span> <span class="nx">style</span><span class="p">=</span><span class="s">"primary"</span> <span class="nx">icon</span><span class="p">=</span><span class="s">"angle-double-up"</span> <span class="p">>}}{{</span><span class="o">%</span> <span class="nx">icon</span> <span class="nx">skull</span><span class="o">-</span><span class="nx">crossbones</span> <span class="o">%</span><span class="p">}}</span> <span class="nx">Pirate</span><span class="p">{{<</span> <span class="o">/</span><span class="nx">badge</span> <span class="p">>}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{<</span> <span class="nx">badge</span> <span class="nx">style</span><span class="p">=</span><span class="s">"primary"</span> <span class="nx">title</span><span class="p">=</span><span class="s">"Rank"</span> <span class="p">>}}{{</span><span class="o">%</span> <span class="nx">icon</span> <span class="nx">skull</span><span class="o">-</span><span class="nx">crossbones</span> <span class="o">%</span><span class="p">}}{{<</span> <span class="o">/</span><span class="nx">badge</span> <span class="p">>}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{<</span> <span class="nx">badge</span> <span class="nx">style</span><span class="p">=</span><span class="s">"primary"</span> <span class="nx">title</span><span class="p">=</span><span class="s">"Rank"</span> <span class="p">>}}{{</span><span class="o">%</span> <span class="nx">icon</span> <span class="nx">skull</span><span class="o">-</span><span class="nx">crossbones</span> <span class="o">%</span><span class="p">}}</span> <span class="nx">Pirate</span><span class="p">{{<</span> <span class="o">/</span><span class="nx">badge</span> <span class="p">>}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{<</span> <span class="nx">badge</span> <span class="nx">style</span><span class="p">=</span><span class="s">"primary"</span> <span class="nx">icon</span><span class="p">=</span><span class="s">"angle-double-up"</span> <span class="nx">title</span><span class="p">=</span><span class="s">"Rank"</span> <span class="p">>}}{{</span><span class="o">%</span> <span class="nx">icon</span> <span class="nx">skull</span><span class="o">-</span><span class="nx">crossbones</span> <span class="o">%</span><span class="p">}}{{<</span> <span class="o">/</span><span class="nx">badge</span> <span class="p">>}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{<</span> <span class="nx">badge</span> <span class="nx">style</span><span class="p">=</span><span class="s">"primary"</span> <span class="nx">icon</span><span class="p">=</span><span class="s">"angle-double-up"</span> <span class="nx">title</span><span class="p">=</span><span class="s">"Rank"</span> <span class="p">>}}{{</span><span class="o">%</span> <span class="nx">icon</span> <span class="nx">skull</span><span class="o">-</span><span class="nx">crossbones</span> <span class="o">%</span><span class="p">}}</span> <span class="nx">Pirate</span><span class="p">{{<</span> <span class="o">/</span><span class="nx">badge</span> <span class="p">>}}</span></span></span></code></pre></div><p><span class="badge cstyle primary badge-with-title"><span class="badge-title"><i class="fa-fw fas fa-angle-double-up"></i></span><span class="badge-content"><i class="fa-fw fas fa-skull-crossbones"></i></span></span><br>
|
||
<span class="badge cstyle primary badge-with-title"><span class="badge-title"><i class="fa-fw fas fa-angle-double-up"></i></span><span class="badge-content"><i class="fa-fw fas fa-skull-crossbones"></i> Pirate</span></span><br>
|
||
<span class="badge cstyle primary badge-with-title"><span class="badge-title">Rank</span><span class="badge-content"><i class="fa-fw fas fa-skull-crossbones"></i></span></span><br>
|
||
<span class="badge cstyle primary badge-with-title"><span class="badge-title">Rank</span><span class="badge-content"><i class="fa-fw fas fa-skull-crossbones"></i> Pirate</span></span><br>
|
||
<span class="badge cstyle primary badge-with-title"><span class="badge-title"><i class="fa-fw fas fa-angle-double-up"></i> Rank</span><span class="badge-content"><i class="fa-fw fas fa-skull-crossbones"></i></span></span><br>
|
||
<span class="badge cstyle primary badge-with-title"><span class="badge-title"><i class="fa-fw fas fa-angle-double-up"></i> Rank</span><span class="badge-content"><i class="fa-fw fas fa-skull-crossbones"></i> Pirate</span></span></p>
|
||
<h4 id="inside-of-text">Inside of Text</h4>
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-go" data-lang="go"><span class="line"><span class="cl"><span class="nx">Lorem</span> <span class="nx">ipsum</span> <span class="nx">dolor</span> <span class="nx">sit</span> <span class="nx">amet</span><span class="p">,</span> <span class="nx">graecis</span> <span class="nx">denique</span> <span class="nx">ei</span> <span class="nx">vel</span><span class="p">,</span> <span class="nx">at</span> <span class="nx">duo</span> <span class="nx">primis</span> <span class="nx">mandamus</span><span class="p">.</span> <span class="p">{{</span><span class="o">%</span> <span class="nx">badge</span> <span class="nx">style</span><span class="p">=</span><span class="s">"blue"</span> <span class="nx">icon</span><span class="p">=</span><span class="s">"rocket"</span> <span class="o">%</span><span class="p">}}</span><span class="nx">Awesome</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">badge</span> <span class="o">%</span><span class="p">}}</span> <span class="nx">Et</span> <span class="nx">legere</span> <span class="nx">ocurreret</span> <span class="nx">pri</span><span class="p">,</span> <span class="nx">animal</span> <span class="nx">tacimates</span> <span class="nx">complectitur</span> <span class="nx">ad</span> <span class="nx">cum</span><span class="p">.</span> <span class="nx">Cu</span> <span class="nx">eum</span> <span class="nx">inermis</span> <span class="nx">inimicus</span> <span class="nx">efficiendi</span><span class="p">.</span> <span class="nx">Labore</span> <span class="nx">officiis</span> <span class="nx">his</span> <span class="nx">ex</span><span class="p">,</span> <span class="nx">soluta</span> <span class="nx">officiis</span> <span class="nx">concludaturque</span> <span class="nx">ei</span> <span class="nx">qui</span><span class="p">,</span> <span class="nx">vide</span> <span class="nx">sensibus</span> <span class="nx">vim</span> <span class="nx">ad</span><span class="p">.</span></span></span></code></pre></div><p>Lorem ipsum dolor sit amet, graecis denique ei vel, at duo primis mandamus. <span class="badge cstyle blue badge-with-title"><span class="badge-title"><i class="fa-fw fas fa-rocket"></i></span><span class="badge-content">Awesome</span></span> Et legere ocurreret pri, animal tacimates complectitur ad cum. Cu eum inermis inimicus efficiendi. Labore officiis his ex, soluta officiis concludaturque ei qui, vide sensibus vim ad.</p>
|
||
|
||
<footer class="footline">
|
||
</footer>
|
||
</article>
|
||
|
||
<article class="default">
|
||
<header class="headline">
|
||
</header>
|
||
|
||
<h1 id="button">Button</h1>
|
||
|
||
<p>The <code>button</code> shortcode displays a clickable button with adjustable color, title and icon.</p>
|
||
<p><span class="btn cstyle interactive transparent"><a href="https://gohugo.io/" target="_self"><span class="title">Get Hugo</span></a></span>
|
||
<span class="btn cstyle interactive warning"><a href="https://gohugo.io/" target="_self"><i class="fa-fw fas fa-dragon"></i> <span class="title">Get Hugo</span></a></span></p>
|
||
<h2 id="usage">Usage</h2>
|
||
<p>While the examples are using shortcodes with named parameter you are free to also call this shortcode from your own partials.</p>
|
||
|
||
<div class="tab-panel" data-tab-group="shortcode-parameter">
|
||
<div class="tab-nav">
|
||
<div class="tab-nav-title">​</div>
|
||
<button
|
||
data-tab-item="shortcode"
|
||
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
|
||
onclick="switchTab('shortcode-parameter','shortcode')"
|
||
>
|
||
<span class="tab-nav-text">shortcode</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="partial"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('shortcode-parameter','partial')"
|
||
>
|
||
<span class="tab-nav-text">partial</span>
|
||
</button>
|
||
</div>
|
||
<div class="tab-content-container">
|
||
<div
|
||
data-tab-item="shortcode"
|
||
class="tab-content tab-panel-style cstyle initial active">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><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">button</span> <span class="nx">href</span><span class="p">=</span><span class="s">"https://gohugo.io/"</span> <span class="o">%</span><span class="p">}}</span><span class="nx">Get</span> <span class="nx">Hugo</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">button</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="nx">button</span> <span class="nx">href</span><span class="p">=</span><span class="s">"https://gohugo.io/"</span> <span class="nx">style</span><span class="p">=</span><span class="s">"warning"</span> <span class="nx">icon</span><span class="p">=</span><span class="s">"dragon"</span> <span class="o">%</span><span class="p">}}</span><span class="nx">Get</span> <span class="nx">Hugo</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">button</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div></div>
|
||
</div>
|
||
<div
|
||
data-tab-item="partial"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><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/button.html"</span> <span class="p">(</span><span class="nx">dict</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"page"</span> <span class="p">.</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"href"</span> <span class="s">"https://gohugo.io/"</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"content"</span> <span class="s">"Get Hugo"</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">)}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span> <span class="nx">partial</span> <span class="s">"shortcodes/button.html"</span> <span class="p">(</span><span class="nx">dict</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"page"</span> <span class="p">.</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"href"</span> <span class="s">"https://gohugo.io/"</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"style"</span> <span class="s">"warning"</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"icon"</span> <span class="s">"dragon"</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"content"</span> <span class="s">"Get Hugo"</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">)}}</span></span></span></code></pre></div></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<p>Once the button is clicked, it opens another browser tab for the given URL.</p>
|
||
<h3 id="parameter">Parameter</h3>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Name</th>
|
||
<th>Default</th>
|
||
<th>Notes</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td><strong>href</strong></td>
|
||
<td><em><empty></em></td>
|
||
<td>Either the destination URL for the button or JavaScript code to be executed on click. If this parameter is not set, the button will do nothing but is still displayed as clickable.<br><br>- if starting with <code>javascript:</code> all following text will be executed in your browser<br>- every other string will be interpreted as URL</td>
|
||
</tr>
|
||
<tr>
|
||
<td><strong>style</strong></td>
|
||
<td><code>transparent</code></td>
|
||
<td>The style scheme used for the button.<br><br>- by severity: <code>info</code>, <code>note</code>, <code>tip</code>, <code>warning</code><br>- by brand color: <code>primary</code>, <code>secondary</code>, <code>accent</code><br>- by color: <code>blue</code>, <code>green</code>, <code>grey</code>, <code>orange</code>, <code>red</code><br>- by special color: <code>default</code>, <code>transparent</code>, <code>code</code></td>
|
||
</tr>
|
||
<tr>
|
||
<td><strong>color</strong></td>
|
||
<td>see notes</td>
|
||
<td>The <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/color_value" rel="external" target="_self">CSS color value</a> to be used. If not set, the chosen color depends on the <strong>style</strong>. Any given value will overwrite the default.<br><br>- for severity styles: a nice matching color for the severity<br>- for all other styles: the corresponding color</td>
|
||
</tr>
|
||
<tr>
|
||
<td><strong>icon</strong></td>
|
||
<td>see notes</td>
|
||
<td><a href="/hugo-theme-relearn/shortcodes/icon/index.html#finding-an-icon">Font Awesome icon name</a> set to the left of the title. Depending on the <strong>style</strong> there may be a default icon. Any given value will overwrite the default.<br><br>- for severity styles: a nice matching icon for the severity<br>- for all other styles: <em><empty></em><br><br>If you want no icon for a severity style, you have to set this parameter to <code>" "</code> (a non empty string filled with spaces)</td>
|
||
</tr>
|
||
<tr>
|
||
<td><strong>iconposition</strong></td>
|
||
<td><code>left</code></td>
|
||
<td>Places the icon to the <code>left</code> or <code>right</code> of the title.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><strong>target</strong></td>
|
||
<td>see notes</td>
|
||
<td>The destination frame/window if <strong>href</strong> is an URL. Otherwise the parameter is not used. This behaves similar to normal links. If the parameter is not given it defaults to:<br><br>- the setting of <code>externalLinkTarget</code> or <code>_blank</code> if not set, for any address starting with <code>http://</code> or <code>https://</code><br>- no specific value for all other links</td>
|
||
</tr>
|
||
<tr>
|
||
<td><strong>type</strong></td>
|
||
<td>see notes</td>
|
||
<td>The <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type" rel="external" target="_self">button type</a> if <strong>href</strong> is JavaScript. Otherwise the parameter is not used. If the parameter is not given it defaults to <code>button</code></td>
|
||
</tr>
|
||
<tr>
|
||
<td><em><strong><content></strong></em></td>
|
||
<td>see notes</td>
|
||
<td>Arbitrary text for the button title. Depending on the <strong>style</strong> there may be a default title. Any given value will overwrite the default.<br><br>- for severity styles: the matching title for the severity<br>- for all other styles: <em><empty></em><br><br>If you want no title for a severity style, you have to set this parameter to <code>" "</code> (a non empty string filled with spaces)</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h2 id="examples">Examples</h2>
|
||
<h3 id="style">Style</h3>
|
||
<h4 id="by-severity">By Severity</h4>
|
||
<div class="highlight wrap-code"><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">button</span> <span class="nx">href</span><span class="p">=</span><span class="s">"https://gohugo.io/"</span> <span class="nx">style</span><span class="p">=</span><span class="s">"info"</span> <span class="o">%</span><span class="p">}}</span><span class="nx">Get</span> <span class="nx">Hugo</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">button</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="nx">button</span> <span class="nx">href</span><span class="p">=</span><span class="s">"https://gohugo.io/"</span> <span class="nx">style</span><span class="p">=</span><span class="s">"note"</span> <span class="o">%</span><span class="p">}}</span><span class="nx">Get</span> <span class="nx">Hugo</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">button</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="nx">button</span> <span class="nx">href</span><span class="p">=</span><span class="s">"https://gohugo.io/"</span> <span class="nx">style</span><span class="p">=</span><span class="s">"tip"</span> <span class="o">%</span><span class="p">}}</span><span class="nx">Get</span> <span class="nx">Hugo</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">button</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="nx">button</span> <span class="nx">href</span><span class="p">=</span><span class="s">"https://gohugo.io/"</span> <span class="nx">style</span><span class="p">=</span><span class="s">"warning"</span> <span class="o">%</span><span class="p">}}</span><span class="nx">Get</span> <span class="nx">Hugo</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">button</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div><p><span class="btn cstyle interactive info"><a href="https://gohugo.io/" target="_self"><i class="fa-fw fas fa-info-circle"></i> <span class="title">Get Hugo</span></a></span>
|
||
<span class="btn cstyle interactive note"><a href="https://gohugo.io/" target="_self"><i class="fa-fw fas fa-exclamation-circle"></i> <span class="title">Get Hugo</span></a></span>
|
||
<span class="btn cstyle interactive tip"><a href="https://gohugo.io/" target="_self"><i class="fa-fw fas fa-lightbulb"></i> <span class="title">Get Hugo</span></a></span>
|
||
<span class="btn cstyle interactive warning"><a href="https://gohugo.io/" target="_self"><i class="fa-fw fas fa-exclamation-triangle"></i> <span class="title">Get Hugo</span></a></span></p>
|
||
<h4 id="by-brand-colors">By Brand Colors</h4>
|
||
<div class="highlight wrap-code"><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">button</span> <span class="nx">href</span><span class="p">=</span><span class="s">"https://gohugo.io/"</span> <span class="nx">style</span><span class="p">=</span><span class="s">"primary"</span> <span class="o">%</span><span class="p">}}</span><span class="nx">Get</span> <span class="nx">Hugo</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">button</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="nx">button</span> <span class="nx">href</span><span class="p">=</span><span class="s">"https://gohugo.io/"</span> <span class="nx">style</span><span class="p">=</span><span class="s">"secondary"</span> <span class="o">%</span><span class="p">}}</span><span class="nx">Get</span> <span class="nx">Hugo</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">button</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="nx">button</span> <span class="nx">href</span><span class="p">=</span><span class="s">"https://gohugo.io/"</span> <span class="nx">style</span><span class="p">=</span><span class="s">"accent"</span> <span class="o">%</span><span class="p">}}</span><span class="nx">Get</span> <span class="nx">Hugo</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">button</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div><p><span class="btn cstyle interactive primary"><a href="https://gohugo.io/" target="_self"><span class="title">Get Hugo</span></a></span>
|
||
<span class="btn cstyle interactive secondary"><a href="https://gohugo.io/" target="_self"><span class="title">Get Hugo</span></a></span>
|
||
<span class="btn cstyle interactive accent"><a href="https://gohugo.io/" target="_self"><span class="title">Get Hugo</span></a></span></p>
|
||
<h4 id="by-color">By Color</h4>
|
||
<div class="highlight wrap-code"><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">button</span> <span class="nx">href</span><span class="p">=</span><span class="s">"https://gohugo.io/"</span> <span class="nx">style</span><span class="p">=</span><span class="s">"blue"</span> <span class="o">%</span><span class="p">}}</span><span class="nx">Get</span> <span class="nx">Hugo</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">button</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="nx">button</span> <span class="nx">href</span><span class="p">=</span><span class="s">"https://gohugo.io/"</span> <span class="nx">style</span><span class="p">=</span><span class="s">"green"</span> <span class="o">%</span><span class="p">}}</span><span class="nx">Get</span> <span class="nx">Hugo</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">button</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="nx">button</span> <span class="nx">href</span><span class="p">=</span><span class="s">"https://gohugo.io/"</span> <span class="nx">style</span><span class="p">=</span><span class="s">"grey"</span> <span class="o">%</span><span class="p">}}</span><span class="nx">Get</span> <span class="nx">Hugo</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">button</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="nx">button</span> <span class="nx">href</span><span class="p">=</span><span class="s">"https://gohugo.io/"</span> <span class="nx">style</span><span class="p">=</span><span class="s">"orange"</span> <span class="o">%</span><span class="p">}}</span><span class="nx">Get</span> <span class="nx">Hugo</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">button</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="nx">button</span> <span class="nx">href</span><span class="p">=</span><span class="s">"https://gohugo.io/"</span> <span class="nx">style</span><span class="p">=</span><span class="s">"red"</span> <span class="o">%</span><span class="p">}}</span><span class="nx">Get</span> <span class="nx">Hugo</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">button</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div><p><span class="btn cstyle interactive blue"><a href="https://gohugo.io/" target="_self"><span class="title">Get Hugo</span></a></span>
|
||
<span class="btn cstyle interactive green"><a href="https://gohugo.io/" target="_self"><span class="title">Get Hugo</span></a></span>
|
||
<span class="btn cstyle interactive grey"><a href="https://gohugo.io/" target="_self"><span class="title">Get Hugo</span></a></span>
|
||
<span class="btn cstyle interactive orange"><a href="https://gohugo.io/" target="_self"><span class="title">Get Hugo</span></a></span>
|
||
<span class="btn cstyle interactive red"><a href="https://gohugo.io/" target="_self"><span class="title">Get Hugo</span></a></span></p>
|
||
<h4 id="by-special-color">By Special Color</h4>
|
||
<div class="highlight wrap-code"><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">button</span> <span class="nx">href</span><span class="p">=</span><span class="s">"https://gohugo.io/"</span> <span class="nx">style</span><span class="p">=</span><span class="s">"default"</span> <span class="o">%</span><span class="p">}}</span><span class="nx">Get</span> <span class="nx">Hugo</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">button</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="nx">button</span> <span class="nx">href</span><span class="p">=</span><span class="s">"https://gohugo.io/"</span> <span class="nx">style</span><span class="p">=</span><span class="s">"transparent"</span> <span class="o">%</span><span class="p">}}</span><span class="nx">Get</span> <span class="nx">Hugo</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">button</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div><p><span class="btn cstyle interactive default"><a href="https://gohugo.io/" target="_self"><span class="title">Get Hugo</span></a></span>
|
||
<span class="btn cstyle interactive transparent"><a href="https://gohugo.io/" target="_self"><span class="title">Get Hugo</span></a></span></p>
|
||
<h3 id="icon">Icon</h3>
|
||
<h4 id="empty">Empty</h4>
|
||
<div class="highlight wrap-code"><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">button</span> <span class="nx">href</span><span class="p">=</span><span class="s">"https://gohugo.io/"</span> <span class="nx">icon</span><span class="p">=</span><span class="s">" "</span> <span class="o">%</span><span class="p">}}{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">button</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div><span class="btn cstyle interactive transparent"><a href="https://gohugo.io/" target="_self"></a></span>
|
||
<h4 id="only">Only</h4>
|
||
<div class="highlight wrap-code"><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">button</span> <span class="nx">href</span><span class="p">=</span><span class="s">"https://gohugo.io/"</span> <span class="nx">icon</span><span class="p">=</span><span class="s">"download"</span> <span class="o">%</span><span class="p">}}{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">button</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div><span class="btn cstyle interactive transparent"><a href="https://gohugo.io/" target="_self"><i class="fa-fw fas fa-download"></i></a></span>
|
||
<h4 id="to-the-left">To the Left</h4>
|
||
<div class="highlight wrap-code"><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">button</span> <span class="nx">href</span><span class="p">=</span><span class="s">"https://gohugo.io/"</span> <span class="nx">icon</span><span class="p">=</span><span class="s">"download"</span> <span class="o">%</span><span class="p">}}</span><span class="nx">Get</span> <span class="nx">Hugo</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">button</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div><span class="btn cstyle interactive transparent"><a href="https://gohugo.io/" target="_self"><i class="fa-fw fas fa-download"></i> <span class="title">Get Hugo</span></a></span>
|
||
<h4 id="to-the-right">To the Right</h4>
|
||
<div class="highlight wrap-code"><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">button</span> <span class="nx">href</span><span class="p">=</span><span class="s">"https://gohugo.io/"</span> <span class="nx">icon</span><span class="p">=</span><span class="s">"download"</span> <span class="nx">iconposition</span><span class="p">=</span><span class="s">"right"</span> <span class="o">%</span><span class="p">}}</span><span class="nx">Get</span> <span class="nx">Hugo</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">button</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div><span class="btn cstyle interactive transparent"><a href="https://gohugo.io/" target="_self"><span class="title">Get Hugo</span> <i class="fa-fw fas fa-download"></i></a></span>
|
||
<h4 id="override-for-severity">Override for Severity</h4>
|
||
<div class="highlight wrap-code"><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">button</span> <span class="nx">href</span><span class="p">=</span><span class="s">"https://gohugo.io/"</span> <span class="nx">icon</span><span class="p">=</span><span class="s">"dragon"</span> <span class="nx">style</span><span class="p">=</span><span class="s">"warning"</span> <span class="o">%</span><span class="p">}}</span><span class="nx">Get</span> <span class="nx">Hugo</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">button</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div><span class="btn cstyle interactive warning"><a href="https://gohugo.io/" target="_self"><i class="fa-fw fas fa-dragon"></i> <span class="title">Get Hugo</span></a></span>
|
||
<h3 id="target">Target</h3>
|
||
<div class="highlight wrap-code"><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">button</span> <span class="nx">href</span><span class="p">=</span><span class="s">"https://gohugo.io/"</span> <span class="nx">target</span><span class="p">=</span><span class="s">"_self"</span> <span class="o">%</span><span class="p">}}</span><span class="nx">Get</span> <span class="nx">Hugo</span> <span class="nx">in</span> <span class="nx">same</span> <span class="nx">window</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">button</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="nx">button</span> <span class="nx">href</span><span class="p">=</span><span class="s">"https://gohugo.io/"</span> <span class="o">%</span><span class="p">}}</span><span class="nx">Get</span> <span class="nx">Hugo</span> <span class="nx">in</span> <span class="nx">new</span> <span class="nx">Window</span><span class="o">/</span><span class="nf">Frame</span> <span class="p">(</span><span class="k">default</span><span class="p">){{</span><span class="o">%</span> <span class="o">/</span><span class="nx">button</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div><p><span class="btn cstyle interactive transparent"><a href="https://gohugo.io/" target="_self"><span class="title">Get Hugo in same Window/Frame</span></a></span>
|
||
<span class="btn cstyle interactive transparent"><a href="https://gohugo.io/" target="_self"><span class="title">Get Hugo in new Window/Frame (default)</span></a></span></p>
|
||
<h3 id="other">Other</h3>
|
||
<h4 id="with-user-defined-color-font-awesome-brand-icon-and-markdown-title">With User-Defined Color, Font Awesome Brand Icon and Markdown Title</h4>
|
||
<div class="highlight wrap-code"><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">button</span> <span class="nx">href</span><span class="p">=</span><span class="s">"https://gohugo.io/"</span> <span class="nx">color</span><span class="p">=</span><span class="s">"fuchsia"</span> <span class="nx">icon</span><span class="p">=</span><span class="s">"fa-fw fab fa-hackerrank"</span> <span class="o">%</span><span class="p">}}</span><span class="nx">Get</span> <span class="o">**</span><span class="nx">Hugo</span><span class="o">**</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">button</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div><span class="btn cstyle interactive default" style="--VARIABLE-BOX-color: fuchsia;"><a href="https://gohugo.io/" target="_self"><i class="fa-fw fab fa-hackerrank"></i> <span class="title">Get <strong>Hugo</strong></span></a></span>
|
||
<h4 id="severity-style-with-all-defaults">Severity Style with All Defaults</h4>
|
||
<div class="highlight wrap-code"><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">button</span> <span class="nx">href</span><span class="p">=</span><span class="s">"https://gohugo.io/"</span> <span class="nx">style</span><span class="p">=</span><span class="s">"tip"</span> <span class="o">%</span><span class="p">}}{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">button</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div><span class="btn cstyle interactive tip"><a href="https://gohugo.io/" target="_self"><i class="fa-fw fas fa-lightbulb"></i> <span class="title">Tip</span></a></span>
|
||
<h4 id="button-to-internal-page">Button to Internal Page</h4>
|
||
<div class="highlight wrap-code"><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">button</span> <span class="nx">href</span><span class="p">=</span><span class="s">"/index.html"</span> <span class="o">%</span><span class="p">}}</span><span class="nx">Home</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">button</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div><span class="btn cstyle interactive transparent"><a href="/index.html"><span class="title">Home</span></a></span>
|
||
<h4 id="button-with-javascript-action">Button with JavaScript Action</h4>
|
||
<p>If your JavaScript action does not change the focus afterwards, make sure to call <code>this.blur()</code> in the end to unselect the button.</p>
|
||
<div class="highlight wrap-code"><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">button</span> <span class="nx">style</span><span class="p">=</span><span class="s">"primary"</span> <span class="nx">icon</span><span class="p">=</span><span class="s">"bullhorn"</span> <span class="nx">href</span><span class="p">=</span><span class="s">"javascript:alert('Hello world!');this.blur();"</span> <span class="o">%</span><span class="p">}}</span><span class="nx">Shout</span> <span class="nx">it</span> <span class="nx">out</span><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">button</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div><span class="btn cstyle interactive primary"><button onclick="alert('Hello world!');this.blur();" type="button"><i class="fa-fw fas fa-bullhorn"></i> <span class="title">Shout it out</span></button></span>
|
||
<h4 id="button-within-a-form-element">Button within a <code>form</code> Element</h4>
|
||
<p>To use native HTML elements in your Markdown, add this in your <code>hugo.toml</code></p>
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-toml" data-lang="toml"><span class="line"><span class="cl"><span class="p">[</span><span class="nx">markup</span><span class="p">.</span><span class="nx">goldmark</span><span class="p">.</span><span class="nx">renderer</span><span class="p">]</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">unsafe</span> <span class="p">=</span> <span class="kc">true</span></span></span></code></pre></div><div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-html" data-lang="html"><span class="line"><span class="cl"><span class="p"><</span><span class="nt">form</span> <span class="na">action</span><span class="o">=</span><span class="s">"../../search.html"</span> <span class="na">method</span><span class="o">=</span><span class="s">"get"</span><span class="p">></span>
|
||
</span></span><span class="line"><span class="cl"> <span class="p"><</span><span class="nt">input</span> <span class="na">name</span><span class="o">=</span><span class="s">"search-by-detail"</span> <span class="na">class</span><span class="o">=</span><span class="s">"search-by"</span> <span class="na">type</span><span class="o">=</span><span class="s">"search"</span><span class="p">></span>
|
||
</span></span><span class="line"><span class="cl"> {{% button type="submit" style="secondary" icon="search" %}}Search{{% /button %}}
|
||
</span></span><span class="line"><span class="cl"><span class="p"></</span><span class="nt">form</span><span class="p">></span></span></span></code></pre></div><form action="../../search.html" method="get">
|
||
<div class="searchform" style="width: 20vw;">
|
||
<input name="search-by-detail" class="search-by" type="search" placeholder="Search...">
|
||
<span class="btn cstyle interactive secondary"><button onclick="" type="submit"><i class="fa-fw fas fa-search"></i> <span class="title">Search</span></button></span>
|
||
</div>
|
||
</form>
|
||
|
||
<footer class="footline">
|
||
</footer>
|
||
</article>
|
||
|
||
<article class="default">
|
||
<header class="headline">
|
||
</header>
|
||
|
||
<h1 id="children">Children</h1>
|
||
|
||
<p>The <code>children</code> shortcode lists the child pages of the current page and its descendants.</p>
|
||
|
||
<ul class="children children-li children-sort-weight">
|
||
|
||
<li><a href="/hugo-theme-relearn/shortcodes/children/test/index.html">page X</a></li>
|
||
<li><a href="/hugo-theme-relearn/shortcodes/children/children-1/index.html">page 1</a></li>
|
||
<li><a href="/hugo-theme-relearn/shortcodes/children/children-2/index.html">page 2</a></li>
|
||
<li><a href="/hugo-theme-relearn/shortcodes/children/children-3/index.html">page 3</a></li>
|
||
</ul>
|
||
<h2 id="usage">Usage</h2>
|
||
<p>While the examples are using shortcodes with named parameter you are free to also call this shortcode from your own partials.</p>
|
||
|
||
<div class="tab-panel" data-tab-group="shortcode-parameter">
|
||
<div class="tab-nav">
|
||
<div class="tab-nav-title">​</div>
|
||
<button
|
||
data-tab-item="shortcode"
|
||
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
|
||
onclick="switchTab('shortcode-parameter','shortcode')"
|
||
>
|
||
<span class="tab-nav-text">shortcode</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="partial"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('shortcode-parameter','partial')"
|
||
>
|
||
<span class="tab-nav-text">partial</span>
|
||
</button>
|
||
</div>
|
||
<div class="tab-content-container">
|
||
<div
|
||
data-tab-item="shortcode"
|
||
class="tab-content tab-panel-style cstyle initial active">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><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">children</span> <span class="nx">sort</span><span class="p">=</span><span class="s">"weight"</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div></div>
|
||
</div>
|
||
<div
|
||
data-tab-item="partial"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><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/children.html"</span> <span class="p">(</span><span class="nx">dict</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"page"</span> <span class="p">.</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"sort"</span> <span class="s">"weight"</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">)}}</span></span></span></code></pre></div></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<h3 id="parameter">Parameter</h3>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Name</th>
|
||
<th>Default</th>
|
||
<th>Notes</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td><strong>containerstyle</strong></td>
|
||
<td><code>ul</code></td>
|
||
<td>Choose the style used to group all children. It could be any HTML tag name.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><strong>style</strong></td>
|
||
<td><code>li</code></td>
|
||
<td>Choose the style used to display each descendant. It could be any HTML tag name.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><strong>showhidden</strong></td>
|
||
<td><code>false</code></td>
|
||
<td>When <code>true</code>, child pages hidden from the menu will be displayed as well.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><strong>description</strong></td>
|
||
<td><code>false</code></td>
|
||
<td>When <code>true</code> shows a short text under each page in the list. When no description or summary exists for the page, the first 70 words of the content is taken - <a href="https://gohugo.io/content/summaries/" rel="external" target="_self">read more info about summaries on gohugo.io</a>.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><strong>depth</strong></td>
|
||
<td><code>1</code></td>
|
||
<td>The depth of descendants to display. For example, if the value is <code>2</code>, the shortcode will display two levels of child pages. To get all descendants, set this value to a high number eg. <code>999</code>.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><strong>sort</strong></td>
|
||
<td><code>auto</code></td>
|
||
<td>The sort criteria of the displayed list.<br><br>- <code>auto</code> defaults to <a href="/hugo-theme-relearn/cont/frontmatter/index.html"><code>ordersectionsby</code> of the pages frontmatter</a><br> or to <a href="/hugo-theme-relearn/basics/configuration/index.html"><code>ordersectionsby</code> of the site configuration</a><br> or to <code>weight</code><br>- <code>weight</code><br>- <code>title</code><br>- <code>linktitle</code><br>- <code>modifieddate</code><br>- <code>expirydate</code><br>- <code>publishdate</code><br>- <code>date</code><br>- <code>length</code><br>- <code>default</code> adhering to Hugo’s default sort criteria</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h2 id="examples">Examples</h2>
|
||
<h3 id="all-default">All Default</h3>
|
||
<div class="highlight wrap-code"><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">children</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div>
|
||
<ul class="children children-li children-sort-">
|
||
|
||
<li><a href="/hugo-theme-relearn/shortcodes/children/test/index.html">page X</a></li>
|
||
<li><a href="/hugo-theme-relearn/shortcodes/children/children-1/index.html">page 1</a></li>
|
||
<li><a href="/hugo-theme-relearn/shortcodes/children/children-2/index.html">page 2</a></li>
|
||
<li><a href="/hugo-theme-relearn/shortcodes/children/children-3/index.html">page 3</a></li>
|
||
</ul>
|
||
<h3 id="with-description">With Description</h3>
|
||
<div class="highlight wrap-code"><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">children</span> <span class="nx">description</span><span class="p">=</span><span class="s">"true"</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div>
|
||
<ul class="children children-li children-sort-">
|
||
|
||
<li><a href="/hugo-theme-relearn/shortcodes/children/test/index.html">page X</a><p>This is a plain page test, and the beginning of a YAML multiline description...
|
||
</p></li>
|
||
<li><a href="/hugo-theme-relearn/shortcodes/children/children-1/index.html">page 1</a><p>This is a demo child page</p></li>
|
||
<li><a href="/hugo-theme-relearn/shortcodes/children/children-2/index.html">page 2</a><p>This is a demo child page with no description.
|
||
So its content is used as description.</p></li>
|
||
<li><a href="/hugo-theme-relearn/shortcodes/children/children-3/index.html">page 3</a><p>This is a demo child page</p></li>
|
||
</ul>
|
||
<h3 id="infinite-depth-and-hidden-pages">Infinite Depth and Hidden Pages</h3>
|
||
<div class="highlight wrap-code"><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">children</span> <span class="nx">depth</span><span class="p">=</span><span class="s">"999"</span> <span class="nx">showhidden</span><span class="p">=</span><span class="s">"true"</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div>
|
||
<ul class="children children-li children-sort-">
|
||
|
||
<li><a href="/hugo-theme-relearn/shortcodes/children/test/index.html">page X</a><ul>
|
||
</ul></li>
|
||
<li><a href="/hugo-theme-relearn/shortcodes/children/children-1/index.html">page 1</a><ul>
|
||
|
||
<li><a href="/hugo-theme-relearn/shortcodes/children/children-1/children-1-1/index.html">page 1-1</a><ul>
|
||
|
||
<li><a href="/hugo-theme-relearn/shortcodes/children/children-1/children-1-1/children-1-1-1/index.html">page 1-1-1 (hidden)</a><ul>
|
||
|
||
<li><a href="/hugo-theme-relearn/shortcodes/children/children-1/children-1-1/children-1-1-1/children-1-1-1-1/index.html">page 1-1-1-1</a><ul>
|
||
|
||
<li><a href="/hugo-theme-relearn/shortcodes/children/children-1/children-1-1/children-1-1-1/children-1-1-1-1/children-1-1-1-1-1/index.html">page 1-1-1-1-1 (hidden)</a><ul>
|
||
|
||
<li><a href="/hugo-theme-relearn/shortcodes/children/children-1/children-1-1/children-1-1-1/children-1-1-1-1/children-1-1-1-1-1/children-1-1-1-1-1-1/index.html">page 1-1-1-1-1-1</a><ul>
|
||
</ul></li></ul></li></ul></li></ul></li>
|
||
<li><span>page 1-1-2 (headless)</span><ul>
|
||
|
||
<li><a href="/hugo-theme-relearn/shortcodes/children/children-1/children-1-1/children-1-1-2/children-1-1-2-1/index.html">page 1-1-2-1</a><ul>
|
||
</ul></li>
|
||
<li><a href="/hugo-theme-relearn/shortcodes/children/children-1/children-1-1/children-1-1-2/children-1-1-2-2/index.html">page 1-1-2-2</a><ul>
|
||
</ul></li></ul></li>
|
||
<li><a href="/hugo-theme-relearn/shortcodes/children/children-1/children-1-1/children-1-1-3/index.html">page 1-1-3</a><ul>
|
||
</ul></li></ul></li></ul></li>
|
||
<li><a href="/hugo-theme-relearn/shortcodes/children/children-2/index.html">page 2</a><ul>
|
||
</ul></li>
|
||
<li><a href="/hugo-theme-relearn/shortcodes/children/children-3/index.html">page 3</a><ul>
|
||
|
||
<li><a href="/hugo-theme-relearn/shortcodes/children/children-3/test3/index.html">page 3-1</a><ul>
|
||
</ul></li></ul></li>
|
||
<li><a href="/hugo-theme-relearn/shortcodes/children/children-4/index.html">page 4 (hidden)</a><ul>
|
||
</ul></li>
|
||
</ul>
|
||
<h3 id="heading-styles-for-container-and-elements">Heading Styles for Container and Elements</h3>
|
||
<div class="highlight wrap-code"><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">children</span> <span class="nx">containerstyle</span><span class="p">=</span><span class="s">"div"</span> <span class="nx">style</span><span class="p">=</span><span class="s">"h2"</span> <span class="nx">depth</span><span class="p">=</span><span class="s">"3"</span> <span class="nx">description</span><span class="p">=</span><span class="s">"true"</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div>
|
||
<div class="children children-h2 children-sort-">
|
||
|
||
<h2><a href="/hugo-theme-relearn/shortcodes/children/test/index.html">page X</a></h2><p>This is a plain page test, and the beginning of a YAML multiline description...
|
||
</p>
|
||
|
||
<h2><a href="/hugo-theme-relearn/shortcodes/children/children-1/index.html">page 1</a></h2><p>This is a demo child page</p>
|
||
|
||
<h3><a href="/hugo-theme-relearn/shortcodes/children/children-1/children-1-1/index.html">page 1-1</a></h3><p>This is a demo child page</p>
|
||
|
||
<h4><span>page 1-1-2 (headless)</span></h4><p>This is a demo child page</p>
|
||
<h4><a href="/hugo-theme-relearn/shortcodes/children/children-1/children-1-1/children-1-1-3/index.html">page 1-1-3</a></h4><p>This is a demo child page</p>
|
||
<h2><a href="/hugo-theme-relearn/shortcodes/children/children-2/index.html">page 2</a></h2><p>This is a demo child page with no description.
|
||
So its content is used as description.</p>
|
||
|
||
<h2><a href="/hugo-theme-relearn/shortcodes/children/children-3/index.html">page 3</a></h2><p>This is a demo child page</p>
|
||
|
||
<h3><a href="/hugo-theme-relearn/shortcodes/children/children-3/test3/index.html">page 3-1</a></h3><p>This is a plain page test nested in a parent</p>
|
||
|
||
</div>
|
||
<h3 id="divs-for-group-and-element-styles">Divs for Group and Element Styles</h3>
|
||
<div class="highlight wrap-code"><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">children</span> <span class="nx">containerstyle</span><span class="p">=</span><span class="s">"div"</span> <span class="nx">style</span><span class="p">=</span><span class="s">"div"</span> <span class="nx">depth</span><span class="p">=</span><span class="s">"3"</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div>
|
||
<div class="children children-div children-sort-">
|
||
|
||
<div><a href="/hugo-theme-relearn/shortcodes/children/test/index.html">page X</a></div>
|
||
|
||
<div><a href="/hugo-theme-relearn/shortcodes/children/children-1/index.html">page 1</a></div>
|
||
|
||
<div><a href="/hugo-theme-relearn/shortcodes/children/children-1/children-1-1/index.html">page 1-1</a></div>
|
||
|
||
<div><span>page 1-1-2 (headless)</span></div>
|
||
<div><a href="/hugo-theme-relearn/shortcodes/children/children-1/children-1-1/children-1-1-3/index.html">page 1-1-3</a></div>
|
||
<div><a href="/hugo-theme-relearn/shortcodes/children/children-2/index.html">page 2</a></div>
|
||
|
||
<div><a href="/hugo-theme-relearn/shortcodes/children/children-3/index.html">page 3</a></div>
|
||
|
||
<div><a href="/hugo-theme-relearn/shortcodes/children/children-3/test3/index.html">page 3-1</a></div>
|
||
|
||
</div>
|
||
|
||
<footer class="footline">
|
||
</footer>
|
||
</article>
|
||
|
||
<section>
|
||
<h1 class="a11y-only">Subsections of Children</h1>
|
||
<article class="default">
|
||
<header class="headline">
|
||
<div class=" taxonomy-tags term-list cstyle tags" title="Tags" style="--VARIABLE-TAGS-BG-color: var(--INTERNAL-TAG-BG-color);">
|
||
<ul>
|
||
<li><a class="term-link" href="/hugo-theme-relearn/tags/children/index.html">Children</a></li>
|
||
</ul>
|
||
</div>
|
||
</header>
|
||
|
||
<h1 id="page-x">page X</h1>
|
||
|
||
<p>This is a plain demo child page.</p>
|
||
|
||
<footer class="footline">
|
||
</footer>
|
||
</article>
|
||
|
||
<article class="default">
|
||
<header class="headline">
|
||
<div class=" taxonomy-tags term-list cstyle tags" title="Tags" style="--VARIABLE-TAGS-BG-color: var(--INTERNAL-TAG-BG-color);">
|
||
<ul>
|
||
<li><a class="term-link" href="/hugo-theme-relearn/tags/children/index.html">Children</a></li>
|
||
<li><a class="term-link" href="/hugo-theme-relearn/tags/non-hidden/index.html">Non-Hidden</a></li>
|
||
</ul>
|
||
</div>
|
||
</header>
|
||
|
||
<h1 id="page-1">page 1</h1>
|
||
|
||
<p>This is a demo child page.</p>
|
||
<h2 id="subpages-of-this-page">Subpages of this page</h2>
|
||
|
||
<ul class="children children-li children-sort-">
|
||
|
||
<li><a href="/hugo-theme-relearn/shortcodes/children/children-1/children-1-1/index.html">page 1-1</a></li>
|
||
</ul>
|
||
|
||
<footer class="footline">
|
||
</footer>
|
||
</article>
|
||
|
||
<section>
|
||
<h1 class="a11y-only">Subsections of page 1</h1>
|
||
<article class="default">
|
||
<header class="headline">
|
||
<div class=" taxonomy-tags term-list cstyle tags" title="Tags" style="--VARIABLE-TAGS-BG-color: var(--INTERNAL-TAG-BG-color);">
|
||
<ul>
|
||
<li><a class="term-link" href="/hugo-theme-relearn/tags/children/index.html">Children</a></li>
|
||
<li><a class="term-link" href="/hugo-theme-relearn/tags/non-hidden/index.html">Non-Hidden</a></li>
|
||
</ul>
|
||
</div>
|
||
</header>
|
||
|
||
<h1 id="page-1-1">page 1-1</h1>
|
||
|
||
<p>This is a demo child page with a hidden child. You can still access the hidden child <a href="/hugo-theme-relearn/shortcodes/children/children-1/children-1-1/children-1-1-1/index.html">directly</a> or via the search.</p>
|
||
<h2 id="subpages-of-this-page">Subpages of this page</h2>
|
||
|
||
<ul class="children children-li children-sort-">
|
||
|
||
<li><a href="/hugo-theme-relearn/shortcodes/children/children-1/children-1-1/children-1-1-1/index.html">page 1-1-1 (hidden)</a></li>
|
||
<li><span>page 1-1-2 (headless)</span></li>
|
||
<li><a href="/hugo-theme-relearn/shortcodes/children/children-1/children-1-1/children-1-1-3/index.html">page 1-1-3</a></li>
|
||
</ul>
|
||
|
||
<footer class="footline">
|
||
</footer>
|
||
</article>
|
||
|
||
<section>
|
||
<h1 class="a11y-only">Subsections of page 1-1</h1>
|
||
<article class="default">
|
||
<header class="headline">
|
||
<div class=" taxonomy-tags term-list cstyle tags" title="Tags" style="--VARIABLE-TAGS-BG-color: var(--INTERNAL-TAG-BG-color);">
|
||
<ul>
|
||
<li><a class="term-link" href="/hugo-theme-relearn/tags/children/index.html">Children</a></li>
|
||
<li><a class="term-link" href="/hugo-theme-relearn/tags/non-hidden/index.html">Non-Hidden</a></li>
|
||
</ul>
|
||
</div>
|
||
</header>
|
||
|
||
<h1 id="page-1-1-2-headless">page 1-1-2 (headless)</h1>
|
||
|
||
|
||
<footer class="footline">
|
||
</footer>
|
||
</article>
|
||
|
||
<section>
|
||
<h1 class="a11y-only">Subsections of page 1-1-2 (headless)</h1>
|
||
<article class="default">
|
||
<header class="headline">
|
||
<div class=" taxonomy-tags term-list cstyle tags" title="Tags" style="--VARIABLE-TAGS-BG-color: var(--INTERNAL-TAG-BG-color);">
|
||
<ul>
|
||
<li><a class="term-link" href="/hugo-theme-relearn/tags/children/index.html">Children</a></li>
|
||
<li><a class="term-link" href="/hugo-theme-relearn/tags/non-hidden/index.html">Non-Hidden</a></li>
|
||
</ul>
|
||
</div>
|
||
</header>
|
||
|
||
<h1 id="page-1-1-2-1">page 1-1-2-1</h1>
|
||
|
||
<p>This is a plain demo child page.</p>
|
||
|
||
<footer class="footline">
|
||
</footer>
|
||
</article>
|
||
|
||
<article class="default">
|
||
<header class="headline">
|
||
<div class=" taxonomy-tags term-list cstyle tags" title="Tags" style="--VARIABLE-TAGS-BG-color: var(--INTERNAL-TAG-BG-color);">
|
||
<ul>
|
||
<li><a class="term-link" href="/hugo-theme-relearn/tags/children/index.html">Children</a></li>
|
||
<li><a class="term-link" href="/hugo-theme-relearn/tags/non-hidden/index.html">Non-Hidden</a></li>
|
||
</ul>
|
||
</div>
|
||
</header>
|
||
|
||
<h1 id="page-1-1-2-2">page 1-1-2-2</h1>
|
||
|
||
<p>This is a plain demo child page.</p>
|
||
|
||
<footer class="footline">
|
||
</footer>
|
||
</article>
|
||
|
||
</section>
|
||
<article class="default">
|
||
<header class="headline">
|
||
<div class=" taxonomy-tags term-list cstyle tags" title="Tags" style="--VARIABLE-TAGS-BG-color: var(--INTERNAL-TAG-BG-color);">
|
||
<ul>
|
||
<li><a class="term-link" href="/hugo-theme-relearn/tags/children/index.html">Children</a></li>
|
||
<li><a class="term-link" href="/hugo-theme-relearn/tags/non-hidden/index.html">Non-Hidden</a></li>
|
||
</ul>
|
||
</div>
|
||
</header>
|
||
|
||
<h1 id="page-1-1-3">page 1-1-3</h1>
|
||
|
||
<p>This is a plain demo child page.</p>
|
||
|
||
<footer class="footline">
|
||
</footer>
|
||
</article>
|
||
|
||
</section>
|
||
</section>
|
||
<article class="default">
|
||
<header class="headline">
|
||
<div class=" taxonomy-tags term-list cstyle tags" title="Tags" style="--VARIABLE-TAGS-BG-color: var(--INTERNAL-TAG-BG-color);">
|
||
<ul>
|
||
<li><a class="term-link" href="/hugo-theme-relearn/tags/children/index.html">Children</a></li>
|
||
<li><a class="term-link" href="/hugo-theme-relearn/tags/non-hidden/index.html">Non-Hidden</a></li>
|
||
</ul>
|
||
</div>
|
||
</header>
|
||
|
||
<h1 id="page-2">page 2</h1>
|
||
|
||
<p>This is a demo child page with no description.</p>
|
||
<p>So its content is used as description.</p>
|
||
|
||
<footer class="footline">
|
||
</footer>
|
||
</article>
|
||
|
||
<article class="default">
|
||
<header class="headline">
|
||
<div class=" taxonomy-tags term-list cstyle tags" title="Tags" style="--VARIABLE-TAGS-BG-color: var(--INTERNAL-TAG-BG-color);">
|
||
<ul>
|
||
<li><a class="term-link" href="/hugo-theme-relearn/tags/children/index.html">Children</a></li>
|
||
<li><a class="term-link" href="/hugo-theme-relearn/tags/non-hidden/index.html">Non-Hidden</a></li>
|
||
</ul>
|
||
</div>
|
||
</header>
|
||
|
||
<h1 id="page-3">page 3</h1>
|
||
|
||
<p>This is a demo child page.</p>
|
||
<h2 id="subpages-of-this-page">Subpages of this page</h2>
|
||
|
||
<ul class="children children-li children-sort-">
|
||
|
||
<li><a href="/hugo-theme-relearn/shortcodes/children/children-3/test3/index.html">page 3-1</a></li>
|
||
</ul>
|
||
|
||
<footer class="footline">
|
||
</footer>
|
||
</article>
|
||
|
||
<section>
|
||
<h1 class="a11y-only">Subsections of page 3</h1>
|
||
<article class="default">
|
||
<header class="headline">
|
||
<div class=" taxonomy-tags term-list cstyle tags" title="Tags" style="--VARIABLE-TAGS-BG-color: var(--INTERNAL-TAG-BG-color);">
|
||
<ul>
|
||
<li><a class="term-link" href="/hugo-theme-relearn/tags/children/index.html">Children</a></li>
|
||
<li><a class="term-link" href="/hugo-theme-relearn/tags/non-hidden/index.html">Non-Hidden</a></li>
|
||
</ul>
|
||
</div>
|
||
</header>
|
||
|
||
<h1 id="page-3-1">page 3-1</h1>
|
||
|
||
<p>This is a plain demo child page.</p>
|
||
|
||
<footer class="footline">
|
||
</footer>
|
||
</article>
|
||
|
||
</section>
|
||
</section>
|
||
<article class="default">
|
||
<header class="headline">
|
||
</header>
|
||
|
||
<h1 id="expand">Expand</h1>
|
||
|
||
<p>The <code>expand</code> shortcode displays an expandable/collapsible section of text.</p>
|
||
|
||
<div class="expand">
|
||
<input type="checkbox" id="R-expand-57d19f82681329d567a126ca3fc5e416" aria-controls="R-expandcontent-57d19f82681329d567a126ca3fc5e416" >
|
||
<label class="expand-label" for="R-expand-57d19f82681329d567a126ca3fc5e416" >
|
||
<i class="fa-fw fas fa-chevron-down"></i>
|
||
<i class="fa-fw fas fa-chevron-right"></i>
|
||
Expand me…
|
||
</label>
|
||
<div id="R-expandcontent-57d19f82681329d567a126ca3fc5e416" class="expand-content">
|
||
|
||
<p>Thank you!</p>
|
||
<p>That’s some text with a footnote<sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup></p>
|
||
<p>That’s some more text with a footnote.<sup id="fnref:2"><a href="#fn:2" class="footnote-ref" role="doc-noteref">2</a></sup></p>
|
||
<div class="footnotes" role="doc-endnotes">
|
||
<hr>
|
||
<ol>
|
||
<li id="fn:1">
|
||
<p>And that’s the footnote. <a href="#fnref:1" class="footnote-backref" role="doc-backlink">↩︎</a></p>
|
||
</li>
|
||
<li id="fn:2">
|
||
<p>Anything of interest goes here.</p>
|
||
<p>Blue light glows blue. <a href="#fnref:2" class="footnote-backref" role="doc-backlink">↩︎</a></p>
|
||
</li>
|
||
</ol>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<h2 id="usage">Usage</h2>
|
||
<p>While the examples are using shortcodes with named parameter you are free to use positional as well or also call this shortcode from your own partials.</p>
|
||
|
||
<div class="tab-panel" data-tab-group="shortcode-parameter">
|
||
<div class="tab-nav">
|
||
<div class="tab-nav-title">​</div>
|
||
<button
|
||
data-tab-item="shortcode"
|
||
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
|
||
onclick="switchTab('shortcode-parameter','shortcode')"
|
||
>
|
||
<span class="tab-nav-text">shortcode</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="shortcode-positional"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('shortcode-parameter','shortcode-positional')"
|
||
>
|
||
<span class="tab-nav-text">shortcode (positional)</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="partial"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('shortcode-parameter','partial')"
|
||
>
|
||
<span class="tab-nav-text">partial</span>
|
||
</button>
|
||
</div>
|
||
<div class="tab-content-container">
|
||
<div
|
||
data-tab-item="shortcode"
|
||
class="tab-content tab-panel-style cstyle initial active">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><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">expand</span> <span class="nx">title</span><span class="p">=</span><span class="s">"Expand me..."</span> <span class="o">%</span><span class="p">}}</span><span class="nx">Thank</span> <span class="nx">you</span><span class="p">!{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">expand</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div></div>
|
||
</div>
|
||
<div
|
||
data-tab-item="shortcode-positional"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><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">expand</span> <span class="s">"Expand me..."</span> <span class="o">%</span><span class="p">}}</span><span class="nx">Thank</span> <span class="nx">you</span><span class="p">!{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">expand</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div></div>
|
||
</div>
|
||
<div
|
||
data-tab-item="partial"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><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/expand.html"</span> <span class="p">(</span><span class="nx">dict</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"page"</span> <span class="p">.</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"title"</span> <span class="s">"Expand me..."</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"content"</span> <span class="s">"Thank you!"</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">)}}</span></span></span></code></pre></div></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<h3 id="parameter">Parameter</h3>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Name</th>
|
||
<th>Position</th>
|
||
<th>Default</th>
|
||
<th>Notes</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td><strong>title</strong></td>
|
||
<td>1</td>
|
||
<td><code>"Expand me..."</code></td>
|
||
<td>Arbitrary text to appear next to the expand/collapse icon.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><strong>open</strong></td>
|
||
<td>2</td>
|
||
<td><code>false</code></td>
|
||
<td>When <code>true</code> the content text will be initially shown as expanded.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><em><strong><content></strong></em></td>
|
||
<td></td>
|
||
<td><em><empty></em></td>
|
||
<td>Arbitrary text to be displayed on expand.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h2 id="examples">Examples</h2>
|
||
<h3 id="all-defaults">All Defaults</h3>
|
||
<div class="highlight wrap-code"><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">expand</span> <span class="o">%</span><span class="p">}}</span><span class="nx">Yes</span><span class="p">,</span> <span class="nx">you</span> <span class="nx">did</span> <span class="nx">it</span><span class="p">!{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">expand</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div>
|
||
<div class="expand">
|
||
<input type="checkbox" id="R-expand-186233ff1bd765ab722c278238b69677" aria-controls="R-expandcontent-186233ff1bd765ab722c278238b69677" >
|
||
<label class="expand-label" for="R-expand-186233ff1bd765ab722c278238b69677" >
|
||
<i class="fa-fw fas fa-chevron-down"></i>
|
||
<i class="fa-fw fas fa-chevron-right"></i>
|
||
Expand me…
|
||
</label>
|
||
<div id="R-expandcontent-186233ff1bd765ab722c278238b69677" class="expand-content">
|
||
<p>
|
||
Yes, you did it!</div>
|
||
</div>
|
||
<h3 id="initially-expanded">Initially Expanded</h3>
|
||
<div class="highlight wrap-code"><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">expand</span> <span class="nx">title</span><span class="p">=</span><span class="s">"Expand me..."</span> <span class="nx">open</span><span class="p">=</span><span class="s">"true"</span> <span class="o">%</span><span class="p">}}</span><span class="nx">No</span> <span class="nx">need</span> <span class="nx">to</span> <span class="nx">press</span> <span class="nx">you</span><span class="p">!{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">expand</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div>
|
||
<div class="expand">
|
||
<input type="checkbox" id="R-expand-77bd20eeca05641b78110fd537d7cf94" aria-controls="R-expandcontent-77bd20eeca05641b78110fd537d7cf94" checked>
|
||
<label class="expand-label" for="R-expand-77bd20eeca05641b78110fd537d7cf94" >
|
||
<i class="fa-fw fas fa-chevron-down"></i>
|
||
<i class="fa-fw fas fa-chevron-right"></i>
|
||
Expand me…
|
||
</label>
|
||
<div id="R-expandcontent-77bd20eeca05641b78110fd537d7cf94" class="expand-content">
|
||
<p>
|
||
No need to press you!</div>
|
||
</div>
|
||
<h3 id="arbitrary-text">Arbitrary Text</h3>
|
||
<div class="highlight wrap-code"><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">expand</span> <span class="nx">title</span><span class="p">=</span><span class="s">"Show me almost **endless** possibilities"</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nx">You</span> <span class="nx">can</span> <span class="nx">add</span> <span class="nx">standard</span> <span class="nx">markdown</span> <span class="nx">syntax</span><span class="p">:</span>
|
||
</span></span><span class="line"><span class="cl">
|
||
</span></span><span class="line"><span class="cl"><span class="o">-</span> <span class="nx">multiple</span> <span class="nx">paragraphs</span>
|
||
</span></span><span class="line"><span class="cl"><span class="o">-</span> <span class="nx">bullet</span> <span class="nx">point</span> <span class="nx">lists</span>
|
||
</span></span><span class="line"><span class="cl"><span class="o">-</span> <span class="nx">_emphasized_</span><span class="p">,</span> <span class="o">**</span><span class="nx">bold</span><span class="o">**</span> <span class="nx">and</span> <span class="nx">even</span> <span class="o">**</span><span class="nx">_bold</span> <span class="nx">emphasized_</span><span class="o">**</span> <span class="nx">text</span>
|
||
</span></span><span class="line"><span class="cl"><span class="o">-</span> <span class="p">[</span><span class="nx">links</span><span class="p">](</span><span class="nx">https</span><span class="p">:</span><span class="c1">//example.com)
|
||
</span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="o">-</span> <span class="nx">etc</span><span class="p">.</span>
|
||
</span></span><span class="line"><span class="cl">
|
||
</span></span><span class="line"><span class="cl"><span class="s">```plaintext
|
||
</span></span></span><span class="line"><span class="cl"><span class="s">...and even source code
|
||
</span></span></span><span class="line"><span class="cl"><span class="s">```</span>
|
||
</span></span><span class="line"><span class="cl">
|
||
</span></span><span class="line"><span class="cl"><span class="p">></span> <span class="nx">the</span> <span class="nx">possibilities</span> <span class="nx">are</span> <span class="nf">endless</span> <span class="p">(</span><span class="nx">almost</span> <span class="o">-</span> <span class="nx">including</span> <span class="nx">other</span> <span class="nx">shortcodes</span> <span class="nx">may</span> <span class="nx">or</span> <span class="nx">may</span> <span class="nx">not</span> <span class="nx">work</span><span class="p">)</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">expand</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div>
|
||
<div class="expand">
|
||
<input type="checkbox" id="R-expand-e22ee8f06f41f34eb65ffa409fe0b495" aria-controls="R-expandcontent-e22ee8f06f41f34eb65ffa409fe0b495" >
|
||
<label class="expand-label" for="R-expand-e22ee8f06f41f34eb65ffa409fe0b495" >
|
||
<i class="fa-fw fas fa-chevron-down"></i>
|
||
<i class="fa-fw fas fa-chevron-right"></i>
|
||
Show me almost <strong>endless</strong> possibilities
|
||
</label>
|
||
<div id="R-expandcontent-e22ee8f06f41f34eb65ffa409fe0b495" class="expand-content">
|
||
|
||
<p>You can add standard markdown syntax:</p>
|
||
<ul>
|
||
<li>multiple paragraphs</li>
|
||
<li>bullet point lists</li>
|
||
<li><em>emphasized</em>, <strong>bold</strong> and even <strong><em>bold emphasized</em></strong> text</li>
|
||
<li><a href="https://example.com" rel="external" target="_self">links</a></li>
|
||
<li>etc.</li>
|
||
</ul>
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-plaintext" data-lang="plaintext"><span class="line"><span class="cl">...and even source code</span></span></code></pre></div><blockquote>
|
||
<p>the possibilities are endless (almost - including other shortcodes may or may not work)</p>
|
||
</blockquote>
|
||
</div>
|
||
</div>
|
||
|
||
<footer class="footline">
|
||
</footer>
|
||
</article>
|
||
|
||
<article class="default">
|
||
<header class="headline">
|
||
</header>
|
||
|
||
<h1 id="highlight">Highlight</h1>
|
||
|
||
<p>The <code>highlight</code> shortcode renders your code with a syntax highlighter.</p>
|
||
|
||
<div class="tab-panel" data-tab-group="7f0c6c49c7f9bc58fc07a82aaafe8bb5">
|
||
<div class="tab-nav">
|
||
<div class="tab-nav-title">​</div>
|
||
<button
|
||
data-tab-item="python"
|
||
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
|
||
onclick="switchTab('7f0c6c49c7f9bc58fc07a82aaafe8bb5','python')"
|
||
>
|
||
<span class="tab-nav-text">python</span>
|
||
</button>
|
||
</div>
|
||
<div class="tab-content-container">
|
||
<div
|
||
data-tab-item="python"
|
||
class="tab-content tab-panel-style cstyle initial active">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code" lineNos="true"><pre tabindex="0" class="chroma"><code class="language-py" data-lang="py"><span class="line"><span class="ln">1</span><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="s2">"Hello World!"</span><span class="p">)</span></span></span></code></pre></div></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<h2 id="usage">Usage</h2>
|
||
<p>This shortcode is fully compatible with Hugo’s <a href="https://gohugo.io/content-management/syntax-highlighting/#highlight-shortcode" rel="external" target="_self"><code>highlight</code> shortcode</a> but <strong>offers some extensions</strong>.</p>
|
||
<p>It is called interchangeably in the same way as Hugo’s own shortcode providing positional parameter or by simply using codefences.</p>
|
||
<p>You are free to also call this shortcode from your own partials. In this case it resembles Hugo’s <a href="https://gohugo.io/functions/highlight/" rel="external" target="_self"><code>highlight</code> function</a> syntax if you call this shortcode as a partial using compatibility syntax.</p>
|
||
<p>While the examples are using shortcodes with named parameter it is recommended to use codefences instead. This is because more and more other software supports codefences (eg. GitHub) and so your markdown becomes more portable.</p>
|
||
|
||
<div class="tab-panel" data-tab-group="shortcode-parameter">
|
||
<div class="tab-nav">
|
||
<div class="tab-nav-title">​</div>
|
||
<button
|
||
data-tab-item="codefence"
|
||
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
|
||
onclick="switchTab('shortcode-parameter','codefence')"
|
||
>
|
||
<span class="tab-nav-text">codefence</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="shortcode"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('shortcode-parameter','shortcode')"
|
||
>
|
||
<span class="tab-nav-text">shortcode</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="shortcode-positional"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('shortcode-parameter','shortcode-positional')"
|
||
>
|
||
<span class="tab-nav-text">shortcode (positional)</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="partial"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('shortcode-parameter','partial')"
|
||
>
|
||
<span class="tab-nav-text">partial</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="partial-compat"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('shortcode-parameter','partial-compat')"
|
||
>
|
||
<span class="tab-nav-text">partial (compat)</span>
|
||
</button>
|
||
</div>
|
||
<div class="tab-content-container">
|
||
<div
|
||
data-tab-item="codefence"
|
||
class="tab-content tab-panel-style cstyle initial active">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-md" data-lang="md"><span class="line"><span class="cl">```py { lineNos="true" wrap="true" title="python" }
|
||
</span></span><span class="line"><span class="cl">print("Hello World!")
|
||
</span></span><span class="line"><span class="cl">```</span></span></code></pre></div></div>
|
||
</div>
|
||
<div
|
||
data-tab-item="shortcode"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><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">highlight</span> <span class="nx">lineNos</span><span class="p">=</span><span class="s">"true"</span> <span class="kd">type</span><span class="p">=</span><span class="s">"py"</span> <span class="nx">wrap</span><span class="p">=</span><span class="s">"true"</span> <span class="nx">title</span><span class="p">=</span><span class="s">"python"</span> <span class="p">>}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="s">"Hello World!"</span><span class="p">)</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{<</span> <span class="o">/</span><span class="nx">highlight</span> <span class="p">>}}</span></span></span></code></pre></div></div>
|
||
</div>
|
||
<div
|
||
data-tab-item="shortcode-positional"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><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">highlight</span> <span class="nx">py</span> <span class="s">"lineNos=true,wrap=true,title=python"</span> <span class="p">>}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="s">"Hello World!"</span><span class="p">)</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{<</span> <span class="o">/</span><span class="nx">highlight</span> <span class="p">>}}</span></span></span></code></pre></div></div>
|
||
</div>
|
||
<div
|
||
data-tab-item="partial"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><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/highlight.html"</span> <span class="p">(</span><span class="nx">dict</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"page"</span> <span class="p">.</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"content"</span> <span class="s">"print(\"Hello World!\")"</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"lineNos"</span> <span class="s">"true"</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"type"</span> <span class="s">"py"</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"wrap"</span> <span class="s">"true"</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"title"</span> <span class="s">"python"</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">)}}</span></span></span></code></pre></div></div>
|
||
</div>
|
||
<div
|
||
data-tab-item="partial-compat"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><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/highlight.html"</span> <span class="p">(</span><span class="nx">dict</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"page"</span> <span class="p">.</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"content"</span> <span class="s">"print(\"Hello World!\")"</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"options"</span> <span class="s">"lineNos=true,wrap=true,title=python"</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"type"</span> <span class="s">"py"</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">)}}</span></span></span></code></pre></div></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<h3 id="parameter">Parameter</h3>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Name</th>
|
||
<th>Position</th>
|
||
<th>Default</th>
|
||
<th>Notes</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td><strong>type</strong></td>
|
||
<td>1</td>
|
||
<td><em><empty></em></td>
|
||
<td>The language of the code to highlight. Choose from one of the <a href="https://gohugo.io/content-management/syntax-highlighting/#list-of-chroma-highlighting-languages" rel="external" target="_self">supported languages</a>. Case-insensitive.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><strong>title</strong></td>
|
||
<td></td>
|
||
<td><em><empty></em></td>
|
||
<td><strong>Extension</strong>. Arbitrary title for code. This displays the code like a <a href="/hugo-theme-relearn/shortcodes/tab/index.html">single tab</a> if <code>hl_inline=false</code> (which is Hugo’s default).</td>
|
||
</tr>
|
||
<tr>
|
||
<td><strong>wrap</strong></td>
|
||
<td></td>
|
||
<td>see notes</td>
|
||
<td><strong>Extension</strong>. When <code>true</code> the content may wrap on long lines otherwise it will be scrollable.<br><br>The default value can be set in your <code>hugo.toml</code> and overwritten via frontmatter. <a href="/hugo-theme-relearn/shortcodes/highlight/index.html#configuration">See below</a>.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><strong>options</strong></td>
|
||
<td>2</td>
|
||
<td><em><empty></em></td>
|
||
<td>An optional, comma-separated list of zero or more <a href="https://gohugo.io/functions/highlight/#options" rel="external" target="_self">Hugo supported options</a> as well as extension parameter from this table.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><em><strong><option></strong></em></td>
|
||
<td></td>
|
||
<td><em><empty></em></td>
|
||
<td>Any of <a href="https://gohugo.io/functions/highlight/#options" rel="external" target="_self">Hugo’s supported options</a>.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><em><strong><content></strong></em></td>
|
||
<td></td>
|
||
<td><em><empty></em></td>
|
||
<td>Your code to highlight.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h2 id="configuration">Configuration</h2>
|
||
<p>Default values for <a href="https://gohugo.io/functions/highlight/#options" rel="external" target="_self">Hugo’s supported options</a> can be set via <a href="https://gohugo.io/getting-started/configuration-markup/#highlight" rel="external" target="_self">goldmark settings</a> in your <code>hugo.toml</code></p>
|
||
<p>Default values for extension options can be set via params settings in your <code>hugo.toml</code> or be overwritten by frontmatter for each individual page.</p>
|
||
<h3 id="global-configuration-file">Global Configuration File</h3>
|
||
<p>You can configure the color style used for code blocks in your <a href="/hugo-theme-relearn/basics/branding/index.html#syntax-highlighting">color variants stylesheet</a> file.</p>
|
||
<h4 id="recommended-settings">Recommended Settings</h4>
|
||
|
||
<div class="tab-panel" data-tab-group="config-code">
|
||
<div class="tab-nav">
|
||
<div class="tab-nav-title">hugo.</div>
|
||
<button
|
||
data-tab-item="toml"
|
||
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
|
||
onclick="switchTab('config-code','toml')"
|
||
>
|
||
<span class="tab-nav-text">toml</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="yaml"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('config-code','yaml')"
|
||
>
|
||
<span class="tab-nav-text">yaml</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="json"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('config-code','json')"
|
||
>
|
||
<span class="tab-nav-text">json</span>
|
||
</button>
|
||
</div>
|
||
<div class="tab-content-container">
|
||
<div
|
||
data-tab-item="toml"
|
||
class="tab-content tab-panel-style cstyle initial active">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-toml" data-lang="toml"><span class="line"><span class="cl"><span class="p">[</span><span class="nx">markup</span><span class="p">]</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="p">[</span><span class="nx">markup</span><span class="p">.</span><span class="nx">highlight</span><span class="p">]</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">lineNumbersInTable</span> <span class="p">=</span> <span class="kc">false</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">noClasses</span> <span class="p">=</span> <span class="kc">false</span></span></span></code></pre></div></div>
|
||
</div>
|
||
<div
|
||
data-tab-item="yaml"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">markup</span><span class="p">:</span><span class="w">
|
||
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">highlight</span><span class="p">:</span><span class="w">
|
||
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">lineNumbersInTable</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="w">
|
||
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">noClasses</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span></span></span></code></pre></div></div>
|
||
</div>
|
||
<div
|
||
data-tab-item="json"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nt">"markup"</span><span class="p">:</span> <span class="p">{</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nt">"highlight"</span><span class="p">:</span> <span class="p">{</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nt">"lineNumbersInTable"</span><span class="p">:</span> <span class="kc">false</span><span class="p">,</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nt">"noClasses"</span><span class="p">:</span> <span class="kc">false</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="p">}</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="p">}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">}</span></span></span></code></pre></div></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<h4 id="optional-settings">Optional Settings</h4>
|
||
|
||
<div class="tab-panel" data-tab-group="config-code">
|
||
<div class="tab-nav">
|
||
<div class="tab-nav-title">hugo.</div>
|
||
<button
|
||
data-tab-item="toml"
|
||
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
|
||
onclick="switchTab('config-code','toml')"
|
||
>
|
||
<span class="tab-nav-text">toml</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="yaml"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('config-code','yaml')"
|
||
>
|
||
<span class="tab-nav-text">yaml</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="json"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('config-code','json')"
|
||
>
|
||
<span class="tab-nav-text">json</span>
|
||
</button>
|
||
</div>
|
||
<div class="tab-content-container">
|
||
<div
|
||
data-tab-item="toml"
|
||
class="tab-content tab-panel-style cstyle initial active">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-toml" data-lang="toml"><span class="line"><span class="cl"><span class="p">[</span><span class="nx">params</span><span class="p">]</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">highlightWrap</span> <span class="p">=</span> <span class="kc">true</span></span></span></code></pre></div></div>
|
||
</div>
|
||
<div
|
||
data-tab-item="yaml"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">params</span><span class="p">:</span><span class="w">
|
||
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">highlightWrap</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span></span></span></code></pre></div></div>
|
||
</div>
|
||
<div
|
||
data-tab-item="json"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nt">"params"</span><span class="p">:</span> <span class="p">{</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nt">"highlightWrap"</span><span class="p">:</span> <span class="kc">true</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="p">}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">}</span></span></span></code></pre></div></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<h3 id="pages-frontmatter">Page’s Frontmatter</h3>
|
||
|
||
<div class="tab-panel" data-tab-group="config-code">
|
||
<div class="tab-nav">
|
||
<div class="tab-nav-title">​</div>
|
||
<button
|
||
data-tab-item="toml"
|
||
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
|
||
onclick="switchTab('config-code','toml')"
|
||
>
|
||
<span class="tab-nav-text">toml</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="yaml"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('config-code','yaml')"
|
||
>
|
||
<span class="tab-nav-text">yaml</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="json"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('config-code','json')"
|
||
>
|
||
<span class="tab-nav-text">json</span>
|
||
</button>
|
||
</div>
|
||
<div class="tab-content-container">
|
||
<div
|
||
data-tab-item="toml"
|
||
class="tab-content tab-panel-style cstyle initial active">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-toml" data-lang="toml"><span class="line"><span class="cl"><span class="err">+++</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nx">highlightWrap</span> <span class="p">=</span> <span class="kc">true</span>
|
||
</span></span><span class="line"><span class="cl"><span class="err">+++</span></span></span></code></pre></div></div>
|
||
</div>
|
||
<div
|
||
data-tab-item="yaml"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nn">---</span><span class="w">
|
||
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">highlightWrap</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="w">
|
||
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nn">---</span></span></span></code></pre></div></div>
|
||
</div>
|
||
<div
|
||
data-tab-item="json"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nt">"highlightWrap"</span><span class="p">:</span> <span class="kc">true</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">}</span></span></span></code></pre></div></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<h2 id="examples">Examples</h2>
|
||
<h3 id="line-numbers-with-starting-offset">Line Numbers with Starting Offset</h3>
|
||
<p>As mentioned above, line numbers in a <code>table</code> layout will shift if code is wrapping, so better use <code>inline</code>. To make things easier for you, set <code>lineNumbersInTable = false</code> in your <code>hugo.toml</code> and add <code>lineNos = true</code> when calling the shortcode instead of the specific values <code>table</code> or <code>inline</code>.</p>
|
||
<div class="highlight wrap-code"><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">highlight</span> <span class="nx">lineNos</span><span class="p">=</span><span class="s">"true"</span> <span class="nx">lineNoStart</span><span class="p">=</span><span class="s">"666"</span> <span class="kd">type</span><span class="p">=</span><span class="s">"py"</span> <span class="p">>}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="err">#</span> <span class="nx">the</span> <span class="nx">hardest</span> <span class="nx">part</span> <span class="nx">is</span> <span class="nx">to</span> <span class="nx">start</span> <span class="nx">writing</span> <span class="nx">code</span><span class="p">;</span> <span class="nx">here</span><span class="err">'</span><span class="nx">s</span> <span class="nx">a</span> <span class="nx">kickstart</span><span class="p">;</span> <span class="nx">just</span> <span class="nx">copy</span> <span class="nx">and</span> <span class="nx">paste</span> <span class="nx">this</span><span class="p">;</span> <span class="nx">it</span><span class="err">'</span><span class="nx">s</span> <span class="nx">free</span><span class="p">;</span> <span class="nx">the</span> <span class="nx">next</span> <span class="nx">lines</span> <span class="nx">will</span> <span class="nx">cost</span> <span class="nx">you</span> <span class="nx">serious</span> <span class="nx">credits</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="s">"Hello"</span><span class="p">)</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="s">" "</span><span class="p">)</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="s">"World"</span><span class="p">)</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="s">"!"</span><span class="p">)</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{<</span> <span class="o">/</span><span class="nx">highlight</span> <span class="p">>}}</span></span></span></code></pre></div><div class="highlight wrap-code" lineNoStart="666" lineNos="true"><pre tabindex="0" class="chroma"><code class="language-py" data-lang="py"><span class="line"><span class="ln">666</span><span class="cl"><span class="c1"># the hardest part is to start writing code; here's a kickstart; just copy and paste this; it's free; the next lines will cost you serious credits</span>
|
||
</span></span><span class="line"><span class="ln">667</span><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="s2">"Hello"</span><span class="p">)</span>
|
||
</span></span><span class="line"><span class="ln">668</span><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="s2">" "</span><span class="p">)</span>
|
||
</span></span><span class="line"><span class="ln">669</span><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="s2">"World"</span><span class="p">)</span>
|
||
</span></span><span class="line"><span class="ln">670</span><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="s2">"!"</span><span class="p">)</span></span></span></code></pre></div>
|
||
<h3 id="codefence-with-title">Codefence with Title</h3>
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-md" data-lang="md"><span class="line"><span class="cl">```py { title="python" }
|
||
</span></span><span class="line"><span class="cl"><span class="gh"># a bit shorter
|
||
</span></span></span><span class="line"><span class="cl"><span class="gh"></span>print("Hello World!")
|
||
</span></span><span class="line"><span class="cl">```</span></span></code></pre></div>
|
||
<div class="tab-panel" data-tab-group="cfb12f3103518c66d538d65d4883481d">
|
||
<div class="tab-nav">
|
||
<div class="tab-nav-title">​</div>
|
||
<button
|
||
data-tab-item="python"
|
||
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
|
||
onclick="switchTab('cfb12f3103518c66d538d65d4883481d','python')"
|
||
>
|
||
<span class="tab-nav-text">python</span>
|
||
</button>
|
||
</div>
|
||
<div class="tab-content-container">
|
||
<div
|
||
data-tab-item="python"
|
||
class="tab-content tab-panel-style cstyle initial active">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-py" data-lang="py"><span class="line"><span class="cl"><span class="c1"># a bit shorter</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="s2">"Hello World!"</span><span class="p">)</span></span></span></code></pre></div></div>
|
||
</div>
|
||
</div>
|
||
</div><h3 id="with-wrap">With Wrap</h3>
|
||
<div class="highlight wrap-code"><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">highlight</span> <span class="kd">type</span><span class="p">=</span><span class="s">"py"</span> <span class="nx">wrap</span><span class="p">=</span><span class="s">"true"</span> <span class="nx">hl_lines</span><span class="p">=</span><span class="s">"2"</span> <span class="p">>}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="err">#</span> <span class="nx">Quicksort</span> <span class="nx">Python</span> <span class="nx">One</span><span class="o">-</span><span class="nx">liner</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nx">lambda</span> <span class="nx">L</span><span class="p">:</span> <span class="p">[]</span> <span class="k">if</span> <span class="nx">L</span><span class="o">==</span><span class="p">[]</span> <span class="k">else</span> <span class="nf">qsort</span><span class="p">([</span><span class="nx">x</span> <span class="k">for</span> <span class="nx">x</span> <span class="nx">in</span> <span class="nx">L</span><span class="p">[</span><span class="mi">1</span><span class="p">:]</span> <span class="k">if</span> <span class="nx">x</span><span class="p"><</span> <span class="nx">L</span><span class="p">[</span><span class="mi">0</span><span class="p">]])</span> <span class="o">+</span> <span class="nx">L</span><span class="p">[</span><span class="mi">0</span><span class="p">:</span><span class="mi">1</span><span class="p">]</span> <span class="o">+</span> <span class="nf">qsort</span><span class="p">([</span><span class="nx">x</span> <span class="k">for</span> <span class="nx">x</span> <span class="nx">in</span> <span class="nx">L</span><span class="p">[</span><span class="mi">1</span><span class="p">:]</span> <span class="k">if</span> <span class="nx">x</span><span class="o">>=</span><span class="nx">L</span><span class="p">[</span><span class="mi">0</span><span class="p">]])</span>
|
||
</span></span><span class="line"><span class="cl"><span class="err">#</span> <span class="nx">Some</span> <span class="nx">more</span> <span class="nx">stuff</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{<</span> <span class="o">/</span><span class="nx">highlight</span> <span class="p">>}}</span></span></span></code></pre></div><div class="highlight wrap-code" hl_lines="2"><pre tabindex="0" class="chroma"><code class="language-py" data-lang="py"><span class="line"><span class="cl"><span class="c1"># Quicksort Python One-liner</span>
|
||
</span></span><span class="line hl"><span class="cl"><span class="k">lambda</span> <span class="n">L</span><span class="p">:</span> <span class="p">[]</span> <span class="k">if</span> <span class="n">L</span><span class="o">==</span><span class="p">[]</span> <span class="k">else</span> <span class="n">qsort</span><span class="p">([</span><span class="n">x</span> <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="n">L</span><span class="p">[</span><span class="mi">1</span><span class="p">:]</span> <span class="k">if</span> <span class="n">x</span><span class="o"><</span> <span class="n">L</span><span class="p">[</span><span class="mi">0</span><span class="p">]])</span> <span class="o">+</span> <span class="n">L</span><span class="p">[</span><span class="mi">0</span><span class="p">:</span><span class="mi">1</span><span class="p">]</span> <span class="o">+</span> <span class="n">qsort</span><span class="p">([</span><span class="n">x</span> <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="n">L</span><span class="p">[</span><span class="mi">1</span><span class="p">:]</span> <span class="k">if</span> <span class="n">x</span><span class="o">>=</span><span class="n">L</span><span class="p">[</span><span class="mi">0</span><span class="p">]])</span>
|
||
</span></span><span class="line"><span class="cl"><span class="c1"># Some more stuff</span></span></span></code></pre></div>
|
||
<h3 id="without-wrap">Without Wrap</h3>
|
||
<div class="highlight wrap-code"><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">highlight</span> <span class="kd">type</span><span class="p">=</span><span class="s">"py"</span> <span class="nx">wrap</span><span class="p">=</span><span class="s">"false"</span> <span class="nx">hl_lines</span><span class="p">=</span><span class="s">"2"</span> <span class="p">>}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="err">#</span> <span class="nx">Quicksort</span> <span class="nx">Python</span> <span class="nx">One</span><span class="o">-</span><span class="nx">liner</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nx">lambda</span> <span class="nx">L</span><span class="p">:</span> <span class="p">[]</span> <span class="k">if</span> <span class="nx">L</span><span class="o">==</span><span class="p">[]</span> <span class="k">else</span> <span class="nf">qsort</span><span class="p">([</span><span class="nx">x</span> <span class="k">for</span> <span class="nx">x</span> <span class="nx">in</span> <span class="nx">L</span><span class="p">[</span><span class="mi">1</span><span class="p">:]</span> <span class="k">if</span> <span class="nx">x</span><span class="p"><</span> <span class="nx">L</span><span class="p">[</span><span class="mi">0</span><span class="p">]])</span> <span class="o">+</span> <span class="nx">L</span><span class="p">[</span><span class="mi">0</span><span class="p">:</span><span class="mi">1</span><span class="p">]</span> <span class="o">+</span> <span class="nf">qsort</span><span class="p">([</span><span class="nx">x</span> <span class="k">for</span> <span class="nx">x</span> <span class="nx">in</span> <span class="nx">L</span><span class="p">[</span><span class="mi">1</span><span class="p">:]</span> <span class="k">if</span> <span class="nx">x</span><span class="o">>=</span><span class="nx">L</span><span class="p">[</span><span class="mi">0</span><span class="p">]])</span>
|
||
</span></span><span class="line"><span class="cl"><span class="err">#</span> <span class="nx">Some</span> <span class="nx">more</span> <span class="nx">stuff</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{<</span> <span class="o">/</span><span class="nx">highlight</span> <span class="p">>}}</span></span></span></code></pre></div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-py" data-lang="py"><span class="line"><span class="cl"><span class="c1"># Quicksort Python One-liner</span>
|
||
</span></span><span class="line hl"><span class="cl"><span class="k">lambda</span> <span class="n">L</span><span class="p">:</span> <span class="p">[]</span> <span class="k">if</span> <span class="n">L</span><span class="o">==</span><span class="p">[]</span> <span class="k">else</span> <span class="n">qsort</span><span class="p">([</span><span class="n">x</span> <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="n">L</span><span class="p">[</span><span class="mi">1</span><span class="p">:]</span> <span class="k">if</span> <span class="n">x</span><span class="o"><</span> <span class="n">L</span><span class="p">[</span><span class="mi">0</span><span class="p">]])</span> <span class="o">+</span> <span class="n">L</span><span class="p">[</span><span class="mi">0</span><span class="p">:</span><span class="mi">1</span><span class="p">]</span> <span class="o">+</span> <span class="n">qsort</span><span class="p">([</span><span class="n">x</span> <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="n">L</span><span class="p">[</span><span class="mi">1</span><span class="p">:]</span> <span class="k">if</span> <span class="n">x</span><span class="o">>=</span><span class="n">L</span><span class="p">[</span><span class="mi">0</span><span class="p">]])</span>
|
||
</span></span><span class="line"><span class="cl"><span class="c1"># Some more stuff</span></span></span></code></pre></div>
|
||
|
||
<footer class="footline">
|
||
</footer>
|
||
</article>
|
||
|
||
<article class="default">
|
||
<header class="headline">
|
||
</header>
|
||
|
||
<h1 id="icon">Icon</h1>
|
||
|
||
<p>The <code>icon</code> shortcode displays icons using the <a href="https://fontawesome.com" rel="external" target="_self">Font Awesome</a> library.</p>
|
||
<p><i class="fa-fw fas fa-exclamation-triangle"></i>
|
||
<i class="fa-fw fas fa-angle-double-up"></i>
|
||
<i class="fa-fw fas fa-skull-crossbones"></i></p>
|
||
<h2 id="usage">Usage</h2>
|
||
<p>While the examples are using shortcodes with positional parameter you are free to also call this shortcode from your own partials.</p>
|
||
|
||
<div class="tab-panel" data-tab-group="shortcode-parameter">
|
||
<div class="tab-nav">
|
||
<div class="tab-nav-title">​</div>
|
||
<button
|
||
data-tab-item="shortcode"
|
||
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
|
||
onclick="switchTab('shortcode-parameter','shortcode')"
|
||
>
|
||
<span class="tab-nav-text">shortcode</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="shortcode-positional"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('shortcode-parameter','shortcode-positional')"
|
||
>
|
||
<span class="tab-nav-text">shortcode (positional)</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="partial"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('shortcode-parameter','partial')"
|
||
>
|
||
<span class="tab-nav-text">partial</span>
|
||
</button>
|
||
</div>
|
||
<div class="tab-content-container">
|
||
<div
|
||
data-tab-item="shortcode"
|
||
class="tab-content tab-panel-style cstyle initial active">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><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">icon</span> <span class="nx">icon</span><span class="p">=</span><span class="s">"exclamation-triangle"</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="nx">icon</span> <span class="nx">icon</span><span class="p">=</span><span class="s">"angle-double-up"</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="nx">icon</span> <span class="nx">icon</span><span class="p">=</span><span class="s">"skull-crossbones"</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div></div>
|
||
</div>
|
||
<div
|
||
data-tab-item="shortcode-positional"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><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">icon</span> <span class="nx">exclamation</span><span class="o">-</span><span class="nx">triangle</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="nx">icon</span> <span class="nx">angle</span><span class="o">-</span><span class="nx">double</span><span class="o">-</span><span class="nx">up</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="nx">icon</span> <span class="nx">skull</span><span class="o">-</span><span class="nx">crossbones</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div></div>
|
||
</div>
|
||
<div
|
||
data-tab-item="partial"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><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/icon.html"</span> <span class="p">(</span><span class="nx">dict</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"page"</span> <span class="p">.</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"icon"</span> <span class="s">"exclamation-triangle"</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">)}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span> <span class="nx">partial</span> <span class="s">"shortcodes/icon.html"</span> <span class="p">(</span><span class="nx">dict</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"page"</span> <span class="p">.</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"icon"</span> <span class="s">"angle-double-up"</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">)}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span> <span class="nx">partial</span> <span class="s">"shortcodes/icon.html"</span> <span class="p">(</span><span class="nx">dict</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"page"</span> <span class="p">.</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"icon"</span> <span class="s">"skull-crossbones"</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">)}}</span></span></span></code></pre></div></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<h3 id="parameter">Parameter</h3>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Name</th>
|
||
<th>Position</th>
|
||
<th>Default</th>
|
||
<th>Notes</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td><strong>icon</strong></td>
|
||
<td>1</td>
|
||
<td><em><empty></em></td>
|
||
<td><a href="/hugo-theme-relearn/shortcodes/icon/index.html#finding-an-icon">Font Awesome icon name</a> to be displayed. It will be displayed in the text color of its according context.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h3 id="finding-an-icon">Finding an icon</h3>
|
||
<p>Browse through the available icons in the <a href="https://fontawesome.com/v6/search?m=free" rel="external" target="_self">Font Awesome Gallery</a>. Notice that the <strong>free</strong> filter is enabled, as only the free icons are available by default.</p>
|
||
<p>Once on the Font Awesome page for a specific icon, for example the page for the <a href="https://fontawesome.com/v6/icons/heart?s=solid" rel="external" target="_self">heart</a>, copy the icon name and paste into the Markdown content.</p>
|
||
<h3 id="customising-icons">Customising Icons</h3>
|
||
<p>Font Awesome provides many ways to modify the icon</p>
|
||
<ul>
|
||
<li>Change color (by default the icon will inherit the parent color)</li>
|
||
<li>Increase or decrease size</li>
|
||
<li>Rotate</li>
|
||
<li>Combine with other icons</li>
|
||
</ul>
|
||
<p>Check the full documentation on <a href="https://fontawesome.com/how-to-use/web-fonts-with-css" rel="external" target="_self">web fonts with CSS</a> for more.</p>
|
||
<h2 id="examples">Examples</h2>
|
||
<h3 id="standard-usage">Standard Usage</h3>
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-go" data-lang="go"><span class="line"><span class="cl"><span class="nx">Built</span> <span class="nx">with</span> <span class="p">{{</span><span class="o">%</span> <span class="nx">icon</span> <span class="nx">heart</span> <span class="o">%</span><span class="p">}}</span> <span class="nx">by</span> <span class="nx">Relearn</span> <span class="nx">and</span> <span class="nx">Hugo</span></span></span></code></pre></div><p>Built with <i class="fa-fw fas fa-heart"></i> by Relearn and Hugo</p>
|
||
<h3 id="advanced-html-usage">Advanced HTML Usage</h3>
|
||
<p>While the shortcode simplifies using standard icons, the icon customization and other advanced features of the Font Awesome library require you to use HTML directly. Paste the <code><i></code> HTML into markup, and Font Awesome will load the relevant icon.</p>
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-html" data-lang="html"><span class="line"><span class="cl">Built with <span class="p"><</span><span class="nt">i</span> <span class="na">class</span><span class="o">=</span><span class="s">"fas fa-heart"</span><span class="p">></</span><span class="nt">i</span><span class="p">></span> by Relearn and Hugo</span></span></code></pre></div><p>Built with <i class="fas fa-heart"></i> by Relearn and Hugo</p>
|
||
<p>To use these native HTML elements in your Markdown, add this in your <code>hugo.toml</code>:</p>
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-toml" data-lang="toml"><span class="line"><span class="cl"><span class="p">[</span><span class="nx">markup</span><span class="p">.</span><span class="nx">goldmark</span><span class="p">.</span><span class="nx">renderer</span><span class="p">]</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">unsafe</span> <span class="p">=</span> <span class="kc">true</span></span></span></code></pre></div>
|
||
<footer class="footline">
|
||
</footer>
|
||
</article>
|
||
|
||
<article class="default">
|
||
<header class="headline">
|
||
</header>
|
||
|
||
<h1 id="include">Include</h1>
|
||
|
||
<p>The <code>include</code> shortcode includes other files from your project inside of the current page.</p>
|
||
<h2 id="usage">Usage</h2>
|
||
<p>While the examples are using shortcodes with named parameter you are free to use positional as well or also call this shortcode from your own partials.</p>
|
||
|
||
<div class="tab-panel" data-tab-group="shortcode-parameter">
|
||
<div class="tab-nav">
|
||
<div class="tab-nav-title">​</div>
|
||
<button
|
||
data-tab-item="shortcode"
|
||
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
|
||
onclick="switchTab('shortcode-parameter','shortcode')"
|
||
>
|
||
<span class="tab-nav-text">shortcode</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="shortcode-positional"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('shortcode-parameter','shortcode-positional')"
|
||
>
|
||
<span class="tab-nav-text">shortcode (positional)</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="partial"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('shortcode-parameter','partial')"
|
||
>
|
||
<span class="tab-nav-text">partial</span>
|
||
</button>
|
||
</div>
|
||
<div class="tab-content-container">
|
||
<div
|
||
data-tab-item="shortcode"
|
||
class="tab-content tab-panel-style cstyle initial active">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><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">include</span> <span class="nx">file</span><span class="p">=</span><span class="s">"shortcodes/include/INCLUDE_ME.md"</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div></div>
|
||
</div>
|
||
<div
|
||
data-tab-item="shortcode-positional"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><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">include</span> <span class="s">"shortcodes/include/INCLUDE_ME.md"</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div></div>
|
||
</div>
|
||
<div
|
||
data-tab-item="partial"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><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/include .html"</span> <span class="p">(</span><span class="nx">dict</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"page"</span> <span class="p">.</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"file"</span> <span class="s">"shortcodes/include/INCLUDE_ME.md"</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">)}}</span></span></span></code></pre></div></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<p>The included files can even contain Markdown and will be taken into account when generating the table of contents.</p>
|
||
<h3 id="parameter">Parameter</h3>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Name</th>
|
||
<th>Position</th>
|
||
<th>Default</th>
|
||
<th>Notes</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td><strong>file</strong></td>
|
||
<td>1</td>
|
||
<td><em><empty></em></td>
|
||
<td>The path to the file to be included. Path resolution adheres to <a href="https://gohugo.io/functions/readfile/" rel="external" target="_self">Hugo’s build-in <code>readFile</code> function</a></td>
|
||
</tr>
|
||
<tr>
|
||
<td><strong>hidefirstheading</strong></td>
|
||
<td>2</td>
|
||
<td><code>false</code></td>
|
||
<td>When <code>true</code> and the included file contains headings, the first heading will be hidden. This comes in handy, eg. if you include otherwise standalone Markdown files.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h2 id="examples">Examples</h2>
|
||
<h3 id="arbitrary-content">Arbitrary Content</h3>
|
||
<div class="highlight wrap-code"><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">include</span> <span class="s">"shortcodes/include/INCLUDE_ME.md"</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div><p>You can add standard markdown syntax:</p>
|
||
<ul>
|
||
<li>multiple paragraphs</li>
|
||
<li>bullet point lists</li>
|
||
<li><em>emphasized</em>, <strong>bold</strong> and even <strong><em>bold emphasized</em></strong> text</li>
|
||
<li><a href="https://example.com" rel="external" target="_self">links</a></li>
|
||
<li>etc.<sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup></li>
|
||
</ul>
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-plaintext" data-lang="plaintext"><span class="line"><span class="cl">...and even source code</span></span></code></pre></div><blockquote>
|
||
<p>the possibilities are endless (almost - including other shortcodes may or may not work) (almost - including other shortcodes may or may not work)</p>
|
||
</blockquote>
|
||
<div class="footnotes" role="doc-endnotes">
|
||
<hr>
|
||
<ol>
|
||
<li id="fn:1">
|
||
<p>Et Cetera (English: /ɛtˈsɛtərə/), abbreviated to etc., etc, et cet., is a Latin expression that is used in English to mean “and other similar things”, or “and so forth” <a href="#fnref:1" class="footnote-backref" role="doc-backlink">↩︎</a></p>
|
||
</li>
|
||
</ol>
|
||
</div>
|
||
|
||
<footer class="footline">
|
||
</footer>
|
||
</article>
|
||
|
||
<section>
|
||
<h1 class="a11y-only">Subsections of Include</h1>
|
||
</section>
|
||
<article class="default">
|
||
<header class="headline">
|
||
</header>
|
||
|
||
<h1 id="math">Math</h1>
|
||
|
||
<p>The <code>math</code> shortcode generates beautiful formatted math and chemical formulae using the <a href="https://mathjax.org/" rel="external" target="_self">MathJax</a> library.</p>
|
||
|
||
<span class="math align-center">
|
||
$$\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)$$
|
||
</span>
|
||
<h2 id="usage">Usage</h2>
|
||
<p>While the examples are using shortcodes with named parameter it is recommended to use codefences instead. This is because more and more other software supports Math codefences (eg. GitHub) and so your markdown becomes more portable.</p>
|
||
<p>You are free to also call this shortcode from your own partials.</p>
|
||
<p>Math is also usable without enclosing it in a shortcode or codefence but <a href="/hugo-theme-relearn/shortcodes/math/index.html#passthrough-configuration">requires configuration</a> by you. In this case no parameter from the below table are available.</p>
|
||
|
||
<div class="tab-panel" data-tab-group="shortcode-parameter">
|
||
<div class="tab-nav">
|
||
<div class="tab-nav-title">​</div>
|
||
<button
|
||
data-tab-item="codefence"
|
||
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
|
||
onclick="switchTab('shortcode-parameter','codefence')"
|
||
>
|
||
<span class="tab-nav-text">codefence</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="shortcode"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('shortcode-parameter','shortcode')"
|
||
>
|
||
<span class="tab-nav-text">shortcode</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="partial"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('shortcode-parameter','partial')"
|
||
>
|
||
<span class="tab-nav-text">partial</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="passthrough"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('shortcode-parameter','passthrough')"
|
||
>
|
||
<span class="tab-nav-text">passthrough</span>
|
||
</button>
|
||
</div>
|
||
<div class="tab-content-container">
|
||
<div
|
||
data-tab-item="codefence"
|
||
class="tab-content tab-panel-style cstyle initial active">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-md" data-lang="md"><span class="line"><span class="cl">```math { align="center" }
|
||
</span></span><span class="line"><span class="cl">$$\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)$$
|
||
</span></span><span class="line"><span class="cl">```</span></span></code></pre></div></div>
|
||
</div>
|
||
<div
|
||
data-tab-item="shortcode"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><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">math</span> <span class="nx">align</span><span class="p">=</span><span class="s">"center"</span> <span class="p">>}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="err">$$\</span><span class="nf">left</span><span class="p">(</span> <span class="err">\</span><span class="nx">sum_</span><span class="p">{</span><span class="nx">k</span><span class="p">=</span><span class="mi">1</span><span class="p">}^</span><span class="nx">n</span> <span class="nx">a_k</span> <span class="nx">b_k</span> <span class="err">\</span><span class="nx">right</span><span class="p">)^</span><span class="mi">2</span> <span class="err">\</span><span class="nx">leq</span> <span class="err">\</span><span class="nf">left</span><span class="p">(</span> <span class="err">\</span><span class="nx">sum_</span><span class="p">{</span><span class="nx">k</span><span class="p">=</span><span class="mi">1</span><span class="p">}^</span><span class="nx">n</span> <span class="nx">a_k</span><span class="p">^</span><span class="mi">2</span> <span class="err">\</span><span class="nx">right</span><span class="p">)</span> <span class="err">\</span><span class="nf">left</span><span class="p">(</span> <span class="err">\</span><span class="nx">sum_</span><span class="p">{</span><span class="nx">k</span><span class="p">=</span><span class="mi">1</span><span class="p">}^</span><span class="nx">n</span> <span class="nx">b_k</span><span class="p">^</span><span class="mi">2</span> <span class="err">\</span><span class="nx">right</span><span class="p">)</span><span class="err">$$</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{<</span> <span class="o">/</span><span class="nx">math</span> <span class="p">>}}</span></span></span></code></pre></div></div>
|
||
</div>
|
||
<div
|
||
data-tab-item="partial"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><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/math.html"</span> <span class="p">(</span><span class="nx">dict</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"page"</span> <span class="p">.</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"content"</span> <span class="s">"$$left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)$$"</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"align"</span> <span class="s">"center"</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">)}}</span></span></span></code></pre></div></div>
|
||
</div>
|
||
<div
|
||
data-tab-item="passthrough"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-md" data-lang="md"><span class="line"><span class="cl">$$\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)$$</span></span></code></pre></div></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<h3 id="parameter">Parameter</h3>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Name</th>
|
||
<th>Default</th>
|
||
<th>Notes</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td><strong>align</strong></td>
|
||
<td><code>center</code></td>
|
||
<td>Allowed values are <code>left</code>, <code>center</code> or <code>right</code>.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><em><strong><content></strong></em></td>
|
||
<td><em><empty></em></td>
|
||
<td>Your formulae.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h2 id="configuration">Configuration</h2>
|
||
<p>MathJax is configured with default settings but you can customize MathJax’s default settings for all of your files through a JSON object in your <code>hugo.toml</code> or override these settings per page through your pages frontmatter.</p>
|
||
<p>The JSON object of your <code>hugo.toml</code> / frontmatter is forwarded into MathJax’s configuration object.</p>
|
||
<p>See <a href="https://docs.mathjax.org/en/latest/options/index.html" rel="external" target="_self">MathJax documentation</a> for all allowed settings.</p>
|
||
<h3 id="global-configuration-file">Global Configuration File</h3>
|
||
<p>This example reflects the default configuration also used if you don’t define <code>mathJaxInitialize</code></p>
|
||
|
||
<div class="tab-panel" data-tab-group="config-code">
|
||
<div class="tab-nav">
|
||
<div class="tab-nav-title">hugo.</div>
|
||
<button
|
||
data-tab-item="toml"
|
||
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
|
||
onclick="switchTab('config-code','toml')"
|
||
>
|
||
<span class="tab-nav-text">toml</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="yaml"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('config-code','yaml')"
|
||
>
|
||
<span class="tab-nav-text">yaml</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="json"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('config-code','json')"
|
||
>
|
||
<span class="tab-nav-text">json</span>
|
||
</button>
|
||
</div>
|
||
<div class="tab-content-container">
|
||
<div
|
||
data-tab-item="toml"
|
||
class="tab-content tab-panel-style cstyle initial active">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-toml" data-lang="toml"><span class="line"><span class="cl"><span class="p">[</span><span class="nx">params</span><span class="p">]</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">mathJaxInitialize</span> <span class="p">=</span> <span class="s1">'{ "tex": { "inlineMath": [["\(", "\)"], ["$", "$"]], displayMath: [["\[", "\]"], ["$$", "$$"]] }, "options": { "enableMenu": false }'</span></span></span></code></pre></div></div>
|
||
</div>
|
||
<div
|
||
data-tab-item="yaml"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">params</span><span class="p">:</span><span class="w">
|
||
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">mathJaxInitialize</span><span class="p">:</span><span class="w"> </span><span class="s1">'{ "tex": { "inlineMath": [["\(", "\)"], ["$", "$"]], displayMath:
|
||
</span></span></span><span class="line"><span class="cl"><span class="s1"> [["\[", "\]"], ["$$", "$$"]] }, "options": { "enableMenu": false }'</span></span></span></code></pre></div></div>
|
||
</div>
|
||
<div
|
||
data-tab-item="json"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nt">"params"</span><span class="p">:</span> <span class="p">{</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nt">"mathJaxInitialize"</span><span class="p">:</span> <span class="s2">"{ \"tex\": { \"inlineMath\": [[\"\\(\", \"\\)\"], [\"$\", \"$\"]], displayMath: [[\"\\[\", \"\\]\"], [\"$$\", \"$$\"]] }, \"options\": { \"enableMenu\": false }"</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="p">}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">}</span></span></span></code></pre></div></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<h3 id="pages-frontmatter">Page’s Frontmatter</h3>
|
||
<p>Usually you don’t need to redefine the global initialization settings for a single page. But if you do, you have repeat all the values from your global configuration you want to keep for a single page as well.</p>
|
||
<p>Eg. If you have redefined the delimiters to something exotic like <code>@</code> symbols in your global config, but want to additionally align your math to the left for a specific page, you have to put this to your frontmatter:</p>
|
||
|
||
<div class="tab-panel" data-tab-group="config-code">
|
||
<div class="tab-nav">
|
||
<div class="tab-nav-title">​</div>
|
||
<button
|
||
data-tab-item="toml"
|
||
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
|
||
onclick="switchTab('config-code','toml')"
|
||
>
|
||
<span class="tab-nav-text">toml</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="yaml"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('config-code','yaml')"
|
||
>
|
||
<span class="tab-nav-text">yaml</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="json"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('config-code','json')"
|
||
>
|
||
<span class="tab-nav-text">json</span>
|
||
</button>
|
||
</div>
|
||
<div class="tab-content-container">
|
||
<div
|
||
data-tab-item="toml"
|
||
class="tab-content tab-panel-style cstyle initial active">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-toml" data-lang="toml"><span class="line"><span class="cl"><span class="err">+++</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nx">mathJaxInitialize</span> <span class="p">=</span> <span class="s1">'{ "chtml": { "displayAlign": "left" }, { "tex": { "inlineMath": [["\(", "\)"], ["@", "@"]], displayMath: [["\[", "\]"], ["@@", "@@"]] }, "options": { "enableMenu": false }'</span>
|
||
</span></span><span class="line"><span class="cl"><span class="err">+++</span></span></span></code></pre></div></div>
|
||
</div>
|
||
<div
|
||
data-tab-item="yaml"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nn">---</span><span class="w">
|
||
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">mathJaxInitialize</span><span class="p">:</span><span class="w"> </span><span class="s1">'{ "chtml": { "displayAlign": "left" }, { "tex": { "inlineMath":
|
||
</span></span></span><span class="line"><span class="cl"><span class="s1"> [["\(", "\)"], ["@", "@"]], displayMath: [["\[", "\]"], ["@@", "@@"]] }, "options":
|
||
</span></span></span><span class="line"><span class="cl"><span class="s1"> { "enableMenu": false }'</span><span class="w">
|
||
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nn">---</span></span></span></code></pre></div></div>
|
||
</div>
|
||
<div
|
||
data-tab-item="json"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nt">"mathJaxInitialize"</span><span class="p">:</span> <span class="s2">"{ \"chtml\": { \"displayAlign\": \"left\" }, { \"tex\": { \"inlineMath\": [[\"\\(\", \"\\)\"], [\"@\", \"@\"]], displayMath: [[\"\\[\", \"\\]\"], [\"@@\", \"@@\"]] }, \"options\": { \"enableMenu\": false }"</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">}</span></span></span></code></pre></div></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<h3 id="passthrough-configuration">Passthrough Configuration</h3>
|
||
<p>You can use your math without enclosing it in a shortcode or codefence by using a <a href="https://gohugo.io/content-management/mathematics/#step-1" rel="external" target="_self">passthrough configuration</a> in your <code>hugo.toml</code>:</p>
|
||
|
||
<div class="tab-panel" data-tab-group="config-code">
|
||
<div class="tab-nav">
|
||
<div class="tab-nav-title">hugo.</div>
|
||
<button
|
||
data-tab-item="toml"
|
||
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
|
||
onclick="switchTab('config-code','toml')"
|
||
>
|
||
<span class="tab-nav-text">toml</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="yaml"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('config-code','yaml')"
|
||
>
|
||
<span class="tab-nav-text">yaml</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="json"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('config-code','json')"
|
||
>
|
||
<span class="tab-nav-text">json</span>
|
||
</button>
|
||
</div>
|
||
<div class="tab-content-container">
|
||
<div
|
||
data-tab-item="toml"
|
||
class="tab-content tab-panel-style cstyle initial active">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-toml" data-lang="toml"><span class="line"><span class="cl"><span class="p">[</span><span class="nx">markup</span><span class="p">]</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="p">[</span><span class="nx">markup</span><span class="p">.</span><span class="nx">goldmark</span><span class="p">]</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="p">[</span><span class="nx">markup</span><span class="p">.</span><span class="nx">goldmark</span><span class="p">.</span><span class="nx">extensions</span><span class="p">]</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="p">[</span><span class="nx">markup</span><span class="p">.</span><span class="nx">goldmark</span><span class="p">.</span><span class="nx">extensions</span><span class="p">.</span><span class="nx">passthrough</span><span class="p">]</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">enable</span> <span class="p">=</span> <span class="kc">true</span>
|
||
</span></span><span class="line"><span class="cl">
|
||
</span></span><span class="line"><span class="cl"> <span class="p">[</span><span class="nx">markup</span><span class="p">.</span><span class="nx">goldmark</span><span class="p">.</span><span class="nx">extensions</span><span class="p">.</span><span class="nx">passthrough</span><span class="p">.</span><span class="nx">delimiters</span><span class="p">]</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">block</span> <span class="p">=</span> <span class="p">[[</span><span class="s1">'\['</span><span class="p">,</span> <span class="s1">'\]'</span><span class="p">],</span> <span class="p">[</span><span class="s1">'$$'</span><span class="p">,</span> <span class="s1">'$$'</span><span class="p">]]</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">inline</span> <span class="p">=</span> <span class="p">[[</span><span class="s1">'\('</span><span class="p">,</span> <span class="s1">'\)'</span><span class="p">],</span> <span class="p">[</span><span class="s1">'$'</span><span class="p">,</span> <span class="s1">'$'</span><span class="p">]]</span></span></span></code></pre></div></div>
|
||
</div>
|
||
<div
|
||
data-tab-item="yaml"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">markup</span><span class="p">:</span><span class="w">
|
||
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">goldmark</span><span class="p">:</span><span class="w">
|
||
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">extensions</span><span class="p">:</span><span class="w">
|
||
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">passthrough</span><span class="p">:</span><span class="w">
|
||
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">delimiters</span><span class="p">:</span><span class="w">
|
||
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">block</span><span class="p">:</span><span class="w">
|
||
</span></span></span><span class="line"><span class="cl"><span class="w"> </span>- - <span class="l">\[</span><span class="w">
|
||
</span></span></span><span class="line"><span class="cl"><span class="w"> </span>- <span class="l">\]</span><span class="w">
|
||
</span></span></span><span class="line"><span class="cl"><span class="w"> </span>- - <span class="l">$$</span><span class="w">
|
||
</span></span></span><span class="line"><span class="cl"><span class="w"> </span>- <span class="l">$$</span><span class="w">
|
||
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">inline</span><span class="p">:</span><span class="w">
|
||
</span></span></span><span class="line"><span class="cl"><span class="w"> </span>- - <span class="l">\(</span><span class="w">
|
||
</span></span></span><span class="line"><span class="cl"><span class="w"> </span>- <span class="l">\)</span><span class="w">
|
||
</span></span></span><span class="line"><span class="cl"><span class="w"> </span>- - <span class="l">$</span><span class="w">
|
||
</span></span></span><span class="line"><span class="cl"><span class="w"> </span>- <span class="l">$</span><span class="w">
|
||
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">enable</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span></span></span></code></pre></div></div>
|
||
</div>
|
||
<div
|
||
data-tab-item="json"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nt">"markup"</span><span class="p">:</span> <span class="p">{</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nt">"goldmark"</span><span class="p">:</span> <span class="p">{</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nt">"extensions"</span><span class="p">:</span> <span class="p">{</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nt">"passthrough"</span><span class="p">:</span> <span class="p">{</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nt">"delimiters"</span><span class="p">:</span> <span class="p">{</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nt">"block"</span><span class="p">:</span> <span class="p">[</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="p">[</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s2">"\\["</span><span class="p">,</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s2">"\\]"</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="p">],</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="p">[</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s2">"$$"</span><span class="p">,</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s2">"$$"</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="p">]</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="p">],</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nt">"inline"</span><span class="p">:</span> <span class="p">[</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="p">[</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s2">"\\("</span><span class="p">,</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s2">"\\)"</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="p">],</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="p">[</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s2">"$"</span><span class="p">,</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s2">"$"</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="p">]</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="p">]</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="p">},</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nt">"enable"</span><span class="p">:</span> <span class="kc">true</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="p">}</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="p">}</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="p">}</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="p">}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">}</span></span></span></code></pre></div></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<p>In this case you have to tell the theme that your page contains math by setting this in your page’s frontmatter:</p>
|
||
|
||
<div class="tab-panel" data-tab-group="config-code">
|
||
<div class="tab-nav">
|
||
<div class="tab-nav-title">​</div>
|
||
<button
|
||
data-tab-item="toml"
|
||
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
|
||
onclick="switchTab('config-code','toml')"
|
||
>
|
||
<span class="tab-nav-text">toml</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="yaml"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('config-code','yaml')"
|
||
>
|
||
<span class="tab-nav-text">yaml</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="json"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('config-code','json')"
|
||
>
|
||
<span class="tab-nav-text">json</span>
|
||
</button>
|
||
</div>
|
||
<div class="tab-content-container">
|
||
<div
|
||
data-tab-item="toml"
|
||
class="tab-content tab-panel-style cstyle initial active">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-toml" data-lang="toml"><span class="line"><span class="cl"><span class="err">+++</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nx">disableMathJax</span> <span class="p">=</span> <span class="kc">false</span>
|
||
</span></span><span class="line"><span class="cl"><span class="err">+++</span></span></span></code></pre></div></div>
|
||
</div>
|
||
<div
|
||
data-tab-item="yaml"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nn">---</span><span class="w">
|
||
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">disableMathJax</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="w">
|
||
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nn">---</span></span></span></code></pre></div></div>
|
||
</div>
|
||
<div
|
||
data-tab-item="json"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nt">"disableMathJax"</span><span class="p">:</span> <span class="kc">false</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">}</span></span></span></code></pre></div></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<p>See the <a href="/hugo-theme-relearn/shortcodes/math/index.html#passthrough">example</a> on how it makes using math really easy.</p>
|
||
<h2 id="examples">Examples</h2>
|
||
<h3 id="inline-math">Inline Math</h3>
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-md" data-lang="md"><span class="line"><span class="cl">Inline math is generated if you use a single <span class="sb">`$`</span> as a delimiter around your formulae: {{<span class="p"><</span> <span class="nt">math</span> <span class="p">></span>}}$\sqrt{3}${{<span class="p"><</span> <span class="p">/</span><span class="nt">math</span> <span class="p">></span>}}</span></span></code></pre></div><p>Inline math is generated if you use a single <code>$</code> as a delimiter around your formulae:
|
||
<span class="math align-center">$\sqrt{3}$</span></p>
|
||
<h3 id="blocklevel-math-with-right-alignment">Blocklevel Math with Right Alignment</h3>
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-md" data-lang="md"><span class="line"><span class="cl">If you delimit your formulae by two consecutive <span class="sb">`$$`</span> it generates a new block.
|
||
</span></span><span class="line"><span class="cl">
|
||
</span></span><span class="line"><span class="cl">{{<span class="p"><</span> <span class="nt">math</span> <span class="na">align</span><span class="o">=</span><span class="s">"right"</span> <span class="p">></span>}}
|
||
</span></span><span class="line"><span class="cl">$$\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)$$
|
||
</span></span><span class="line"><span class="cl">{{<span class="p"><</span> <span class="p">/</span><span class="nt">math</span> <span class="p">></span>}}</span></span></code></pre></div><p>If you delimit your formulae by two consecutive <code>$$</code> it generates a new block.</p>
|
||
|
||
<span class="math align-right">
|
||
$$\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)$$
|
||
</span>
|
||
<h3 id="codefence">Codefence</h3>
|
||
<p>You can also use codefences.</p>
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-md" data-lang="md"><span class="line"><span class="cl"><span class="s">```math
|
||
</span></span></span><span class="line"><span class="cl"><span class="s"></span>$$\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)$$
|
||
</span></span><span class="line"><span class="cl"><span class="s">```</span></span></span></code></pre></div>
|
||
<span class="math align-center">$$\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)$$</span><h3 id="passthrough">Passthrough</h3>
|
||
<p>This works for block as well as inline math but is only available if you are using the <a href="/hugo-theme-relearn/shortcodes/math/index.html#passthrough-configuration">passthrough configuration</a>.</p>
|
||
<p>With passthrough configuration you can just drop your math without enclosed by shortcodes or codefences but no settings from the <a href="/hugo-theme-relearn/shortcodes/math/index.html#parameter">parameter table</a> are available.</p>
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-md" data-lang="md"><span class="line"><span class="cl">$$\left|
|
||
</span></span><span class="line"><span class="cl">\begin{array}{cc}
|
||
</span></span><span class="line"><span class="cl">a <span class="err">&</span> b \\
|
||
</span></span><span class="line"><span class="cl">c <span class="err">&</span> d
|
||
</span></span><span class="line"><span class="cl">\end{array}\right|$$</span></span></code></pre></div>$$\left|
|
||
\begin{array}{cc}
|
||
a & b \\
|
||
c & d
|
||
\end{array}\right|$$
|
||
<h3 id="chemical-formulae">Chemical Formulae</h3>
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-md" data-lang="md"><span class="line"><span class="cl">{{<span class="p"><</span> <span class="nt">math</span> <span class="p">></span>}}
|
||
</span></span><span class="line"><span class="cl">$$\ce{Hg^2+ ->[I-] HgI2 ->[I-] [Hg^{II}I4]^2-}$$
|
||
</span></span><span class="line"><span class="cl">{{<span class="p"><</span> <span class="p">/</span><span class="nt">math</span> <span class="p">></span>}}</span></span></code></pre></div>
|
||
<span class="math align-center">
|
||
$$\ce{Hg^2+ ->[I-] HgI2 ->[I-] [Hg^{II}I4]^2-}$$
|
||
</span>
|
||
|
||
<footer class="footline">
|
||
</footer>
|
||
</article>
|
||
|
||
<article class="default">
|
||
<header class="headline">
|
||
</header>
|
||
|
||
<h1 id="mermaid">Mermaid</h1>
|
||
|
||
<p>The <code>mermaid</code> shortcode generates diagrams and flowcharts from text, in a similar manner as Markdown using the <a href="https://mermaidjs.github.io/" rel="external" target="_self">Mermaid</a> library.</p>
|
||
|
||
<pre class="mermaid align-center zoomable">
|
||
graph LR;
|
||
If --> Then
|
||
Then --> Else
|
||
</pre>
|
||
<h2 id="usage">Usage</h2>
|
||
<p>While the examples are using shortcodes with named parameter it is recommended to use codefences instead. This is because more and more other software supports Mermaid codefences (eg. GitHub) and so your markdown becomes more portable.</p>
|
||
<p>You are free to also call this shortcode from your own partials.</p>
|
||
|
||
<div class="tab-panel" data-tab-group="shortcode-parameter">
|
||
<div class="tab-nav">
|
||
<div class="tab-nav-title">​</div>
|
||
<button
|
||
data-tab-item="codefence"
|
||
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
|
||
onclick="switchTab('shortcode-parameter','codefence')"
|
||
>
|
||
<span class="tab-nav-text">codefence</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="shortcode"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('shortcode-parameter','shortcode')"
|
||
>
|
||
<span class="tab-nav-text">shortcode</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="partial"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('shortcode-parameter','partial')"
|
||
>
|
||
<span class="tab-nav-text">partial</span>
|
||
</button>
|
||
</div>
|
||
<div class="tab-content-container">
|
||
<div
|
||
data-tab-item="codefence"
|
||
class="tab-content tab-panel-style cstyle initial active">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-md" data-lang="md"><span class="line"><span class="cl">```mermaid { align="center" zoom="true" }
|
||
</span></span><span class="line"><span class="cl">graph LR;
|
||
</span></span><span class="line"><span class="cl"> If --> Then
|
||
</span></span><span class="line"><span class="cl"> Then --> Else
|
||
</span></span><span class="line"><span class="cl">```</span></span></code></pre></div></div>
|
||
</div>
|
||
<div
|
||
data-tab-item="shortcode"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><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">mermaid</span> <span class="nx">align</span><span class="p">=</span><span class="s">"center"</span> <span class="nx">zoom</span><span class="p">=</span><span class="s">"true"</span> <span class="p">>}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nx">graph</span> <span class="nx">LR</span><span class="p">;</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">If</span> <span class="o">--</span><span class="p">></span> <span class="nx">Then</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">Then</span> <span class="o">--</span><span class="p">></span> <span class="nx">Else</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{<</span> <span class="o">/</span><span class="nx">mermaid</span> <span class="p">>}}</span></span></span></code></pre></div></div>
|
||
</div>
|
||
<div
|
||
data-tab-item="partial"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><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/mermaid.html"</span> <span class="p">(</span><span class="nx">dict</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"page"</span> <span class="p">.</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"content"</span> <span class="s">"graph LR;\nIf --> Then\nThen --> Else"</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"align"</span> <span class="s">"center"</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"zoom"</span> <span class="s">"true"</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">)}}</span></span></span></code></pre></div></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<p>The generated graphs can be panned by dragging them and zoomed by using the mousewheel. On mobile devices you can use finger gestures.</p>
|
||
<h3 id="parameter">Parameter</h3>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Name</th>
|
||
<th>Default</th>
|
||
<th>Notes</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td><strong>align</strong></td>
|
||
<td><code>center</code></td>
|
||
<td>Allowed values are <code>left</code>, <code>center</code> or <code>right</code>.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><strong>zoom</strong></td>
|
||
<td>see notes</td>
|
||
<td>Whether the graph is pan- and zoomable.<br><br>If not set the value is determined by the <code>mermaidZoom</code> setting of the <a href="/hugo-theme-relearn/shortcodes/mermaid/index.html#global-configuration-file">site</a> or the <a href="/hugo-theme-relearn/shortcodes/mermaid/index.html#pages-frontmatter">pages frontmatter</a> or <code>false</code> if not set at all.<br><br>- <code>false</code>: no pan or zoom<br>- <code>true</code>: pan and zoom active</td>
|
||
</tr>
|
||
<tr>
|
||
<td><em><strong><content></strong></em></td>
|
||
<td><em><empty></em></td>
|
||
<td>Your Mermaid graph.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h2 id="configuration">Configuration</h2>
|
||
<p>Mermaid is configured with default settings. You can customize Mermaid’s default settings for all of your files through a JSON object in your <code>hugo.toml</code>, override these settings per page through your pages frontmatter or override these setting per diagramm through <a href="https://mermaid-js.github.io/mermaid/#/directives?id=directives" rel="external" target="_self">diagram directives</a>.</p>
|
||
<p>The JSON object of your <code>hugo.toml</code> / frontmatter is forwarded into Mermaid’s <code>mermaid.initialize()</code> function.</p>
|
||
<p>See <a href="https://mermaid-js.github.io/mermaid/#/Setup?id=mermaidapi-configuration-defaults" rel="external" target="_self">Mermaid documentation</a> for all allowed settings.</p>
|
||
<p>The <code>theme</code> setting can also be set by your used color variant. This will be the sitewide default and can - again - be overridden by your settings in <code>hugo.toml</code>, frontmatter or diagram directives.</p>
|
||
<h3 id="global-configuration-file">Global Configuration File</h3>
|
||
|
||
<div class="tab-panel" data-tab-group="config-code">
|
||
<div class="tab-nav">
|
||
<div class="tab-nav-title">hugo.</div>
|
||
<button
|
||
data-tab-item="toml"
|
||
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
|
||
onclick="switchTab('config-code','toml')"
|
||
>
|
||
<span class="tab-nav-text">toml</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="yaml"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('config-code','yaml')"
|
||
>
|
||
<span class="tab-nav-text">yaml</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="json"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('config-code','json')"
|
||
>
|
||
<span class="tab-nav-text">json</span>
|
||
</button>
|
||
</div>
|
||
<div class="tab-content-container">
|
||
<div
|
||
data-tab-item="toml"
|
||
class="tab-content tab-panel-style cstyle initial active">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-toml" data-lang="toml"><span class="line"><span class="cl"><span class="p">[</span><span class="nx">params</span><span class="p">]</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">mermaidInitialize</span> <span class="p">=</span> <span class="s1">'{ "theme": "dark" }'</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">mermaidZoom</span> <span class="p">=</span> <span class="kc">true</span></span></span></code></pre></div></div>
|
||
</div>
|
||
<div
|
||
data-tab-item="yaml"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">params</span><span class="p">:</span><span class="w">
|
||
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">mermaidInitialize</span><span class="p">:</span><span class="w"> </span><span class="s1">'{ "theme": "dark" }'</span><span class="w">
|
||
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">mermaidZoom</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span></span></span></code></pre></div></div>
|
||
</div>
|
||
<div
|
||
data-tab-item="json"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nt">"params"</span><span class="p">:</span> <span class="p">{</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nt">"mermaidInitialize"</span><span class="p">:</span> <span class="s2">"{ \"theme\": \"dark\" }"</span><span class="p">,</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nt">"mermaidZoom"</span><span class="p">:</span> <span class="kc">true</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="p">}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">}</span></span></span></code></pre></div></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<h3 id="pages-frontmatter">Page’s Frontmatter</h3>
|
||
|
||
<div class="tab-panel" data-tab-group="config-code">
|
||
<div class="tab-nav">
|
||
<div class="tab-nav-title">​</div>
|
||
<button
|
||
data-tab-item="toml"
|
||
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
|
||
onclick="switchTab('config-code','toml')"
|
||
>
|
||
<span class="tab-nav-text">toml</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="yaml"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('config-code','yaml')"
|
||
>
|
||
<span class="tab-nav-text">yaml</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="json"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('config-code','json')"
|
||
>
|
||
<span class="tab-nav-text">json</span>
|
||
</button>
|
||
</div>
|
||
<div class="tab-content-container">
|
||
<div
|
||
data-tab-item="toml"
|
||
class="tab-content tab-panel-style cstyle initial active">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-toml" data-lang="toml"><span class="line"><span class="cl"><span class="err">+++</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nx">mermaidInitialize</span> <span class="p">=</span> <span class="s1">'{ "theme": "dark" }'</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nx">mermaidZoom</span> <span class="p">=</span> <span class="kc">true</span>
|
||
</span></span><span class="line"><span class="cl"><span class="err">+++</span></span></span></code></pre></div></div>
|
||
</div>
|
||
<div
|
||
data-tab-item="yaml"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nn">---</span><span class="w">
|
||
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">mermaidInitialize</span><span class="p">:</span><span class="w"> </span><span class="s1">'{ "theme": "dark" }'</span><span class="w">
|
||
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">mermaidZoom</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="w">
|
||
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nn">---</span></span></span></code></pre></div></div>
|
||
</div>
|
||
<div
|
||
data-tab-item="json"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nt">"mermaidInitialize"</span><span class="p">:</span> <span class="s2">"{ \"theme\": \"dark\" }"</span><span class="p">,</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nt">"mermaidZoom"</span><span class="p">:</span> <span class="kc">true</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">}</span></span></span></code></pre></div></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<h2 id="examples">Examples</h2>
|
||
<h3 id="flowchart-with-yaml-title">Flowchart with YAML-Title</h3>
|
||
<div class="highlight wrap-code"><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">mermaid</span> <span class="p">>}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="o">---</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nx">title</span><span class="p">:</span> <span class="nx">Example</span> <span class="nx">Diagram</span>
|
||
</span></span><span class="line"><span class="cl"><span class="o">---</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nx">graph</span> <span class="nx">LR</span><span class="p">;</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">A</span><span class="p">[</span><span class="nx">Hard</span> <span class="nx">edge</span><span class="p">]</span> <span class="o">--</span><span class="p">>|</span><span class="nx">Link</span> <span class="nx">text</span><span class="p">|</span> <span class="nf">B</span><span class="p">(</span><span class="nx">Round</span> <span class="nx">edge</span><span class="p">)</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">B</span> <span class="o">--</span><span class="p">></span> <span class="nx">C</span><span class="p">{<</span><span class="nx">strong</span><span class="p">></span><span class="nx">Decision</span><span class="p"><</span><span class="o">/</span><span class="nx">strong</span><span class="p">>}</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">C</span> <span class="o">--</span><span class="p">>|</span><span class="nx">One</span><span class="p">|</span> <span class="nx">D</span><span class="p">[</span><span class="nx">Result</span> <span class="nx">one</span><span class="p">]</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">C</span> <span class="o">--</span><span class="p">>|</span><span class="nx">Two</span><span class="p">|</span> <span class="nx">E</span><span class="p">[</span><span class="nx">Result</span> <span class="nx">two</span><span class="p">]</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{<</span> <span class="o">/</span><span class="nx">mermaid</span> <span class="p">>}}</span></span></span></code></pre></div>
|
||
<pre class="mermaid align-center zoomable">
|
||
---
|
||
title: Example Diagram
|
||
---
|
||
graph LR;
|
||
A[Hard edge] -->|Link text| B(Round edge)
|
||
B --> C{<strong>Decision</strong>}
|
||
C -->|One| D[Result one]
|
||
C -->|Two| E[Result two]
|
||
</pre>
|
||
<h3 id="sequence-diagram-with-configuration-directive">Sequence Diagram with Configuration Directive</h3>
|
||
<div class="highlight wrap-code"><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">mermaid</span> <span class="p">>}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="o">%%</span><span class="p">{</span><span class="nx">init</span><span class="p">:{</span><span class="s">"fontFamily"</span><span class="p">:</span><span class="s">"monospace"</span><span class="p">,</span> <span class="s">"sequence"</span><span class="p">:{</span><span class="s">"showSequenceNumbers"</span><span class="p">:</span><span class="kc">true</span><span class="p">}}}</span><span class="o">%%</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nx">sequenceDiagram</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">Alice</span><span class="o">->></span><span class="nx">John</span><span class="p">:</span> <span class="nx">Hello</span> <span class="nx">John</span><span class="p">,</span> <span class="nx">how</span> <span class="nx">are</span> <span class="nx">you</span><span class="err">?</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">loop</span> <span class="nx">Healthcheck</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">John</span><span class="o">->></span><span class="nx">John</span><span class="p">:</span> <span class="nx">Fight</span> <span class="nx">against</span> <span class="nx">hypochondria</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">end</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">Note</span> <span class="nx">right</span> <span class="nx">of</span> <span class="nx">John</span><span class="p">:</span> <span class="nx">Rational</span> <span class="nx">thoughts</span><span class="p">!</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">John</span><span class="o">-->></span><span class="nx">Alice</span><span class="p">:</span> <span class="nx">Great</span><span class="p">!</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">John</span><span class="o">->></span><span class="nx">Bob</span><span class="p">:</span> <span class="nx">How</span> <span class="nx">about</span> <span class="nx">you</span><span class="err">?</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">Bob</span><span class="o">-->></span><span class="nx">John</span><span class="p">:</span> <span class="nx">Jolly</span> <span class="nx">good</span><span class="p">!</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{<</span> <span class="o">/</span><span class="nx">mermaid</span> <span class="p">>}}</span></span></span></code></pre></div>
|
||
<pre class="mermaid align-center zoomable">
|
||
%%{init:{"fontFamily":"monospace", "sequence":{"showSequenceNumbers":true}}}%%
|
||
sequenceDiagram
|
||
Alice->>John: Hello John, how are you?
|
||
loop Healthcheck
|
||
John->>John: Fight against hypochondria
|
||
end
|
||
Note right of John: Rational thoughts!
|
||
John-->>Alice: Great!
|
||
John->>Bob: How about you?
|
||
Bob-->>John: Jolly good!
|
||
</pre>
|
||
<h3 id="class-diagram-with-codefence-syntax">Class Diagram with Codefence Syntax</h3>
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-go" data-lang="go"><span class="line"><span class="cl"><span class="s">```mermaid
|
||
</span></span></span><span class="line"><span class="cl"><span class="s">classDiagram
|
||
</span></span></span><span class="line"><span class="cl"><span class="s"> Animal <|-- Duck
|
||
</span></span></span><span class="line"><span class="cl"><span class="s"> Animal <|-- Fish
|
||
</span></span></span><span class="line"><span class="cl"><span class="s"> Animal <|-- Zebra
|
||
</span></span></span><span class="line"><span class="cl"><span class="s"> Animal : +int age
|
||
</span></span></span><span class="line"><span class="cl"><span class="s"> Animal : +String gender
|
||
</span></span></span><span class="line"><span class="cl"><span class="s"> Animal: +isMammal()
|
||
</span></span></span><span class="line"><span class="cl"><span class="s"> Animal: +mate()
|
||
</span></span></span><span class="line"><span class="cl"><span class="s"> class Duck{
|
||
</span></span></span><span class="line"><span class="cl"><span class="s"> +String beakColor
|
||
</span></span></span><span class="line"><span class="cl"><span class="s"> +swim()
|
||
</span></span></span><span class="line"><span class="cl"><span class="s"> +quack()
|
||
</span></span></span><span class="line"><span class="cl"><span class="s"> }
|
||
</span></span></span><span class="line"><span class="cl"><span class="s"> class Fish{
|
||
</span></span></span><span class="line"><span class="cl"><span class="s"> -int sizeInFeet
|
||
</span></span></span><span class="line"><span class="cl"><span class="s"> -canEat()
|
||
</span></span></span><span class="line"><span class="cl"><span class="s"> }
|
||
</span></span></span><span class="line"><span class="cl"><span class="s"> class Zebra{
|
||
</span></span></span><span class="line"><span class="cl"><span class="s"> +bool is_wild
|
||
</span></span></span><span class="line"><span class="cl"><span class="s"> +run()
|
||
</span></span></span><span class="line"><span class="cl"><span class="s"> }
|
||
</span></span></span><span class="line"><span class="cl"><span class="s">```</span></span></span></code></pre></div>
|
||
<pre class="mermaid align-center zoomable">classDiagram
|
||
Animal <|-- Duck
|
||
Animal <|-- Fish
|
||
Animal <|-- Zebra
|
||
Animal : +int age
|
||
Animal : +String gender
|
||
Animal: +isMammal()
|
||
Animal: +mate()
|
||
class Duck{
|
||
+String beakColor
|
||
+swim()
|
||
+quack()
|
||
}
|
||
class Fish{
|
||
-int sizeInFeet
|
||
-canEat()
|
||
}
|
||
class Zebra{
|
||
+bool is_wild
|
||
+run()
|
||
}</pre><h3 id="state-diagram-aligned-to-the-right">State Diagram Aligned to the Right</h3>
|
||
<div class="highlight wrap-code"><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">mermaid</span> <span class="nx">align</span><span class="p">=</span><span class="s">"right"</span> <span class="p">>}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nx">stateDiagram</span><span class="o">-</span><span class="nx">v2</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">open</span><span class="p">:</span> <span class="nx">Open</span> <span class="nx">Door</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">closed</span><span class="p">:</span> <span class="nx">Closed</span> <span class="nx">Door</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">locked</span><span class="p">:</span> <span class="nx">Locked</span> <span class="nx">Door</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">open</span> <span class="o">--</span><span class="p">></span> <span class="nx">closed</span><span class="p">:</span> <span class="nx">Close</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">closed</span> <span class="o">--</span><span class="p">></span> <span class="nx">locked</span><span class="p">:</span> <span class="nx">Lock</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">locked</span> <span class="o">--</span><span class="p">></span> <span class="nx">closed</span><span class="p">:</span> <span class="nx">Unlock</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">closed</span> <span class="o">--</span><span class="p">></span> <span class="nx">open</span><span class="p">:</span> <span class="nx">Open</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{<</span> <span class="o">/</span><span class="nx">mermaid</span> <span class="p">>}}</span></span></span></code></pre></div>
|
||
<pre class="mermaid align-right zoomable">
|
||
stateDiagram-v2
|
||
open: Open Door
|
||
closed: Closed Door
|
||
locked: Locked Door
|
||
open --> closed: Close
|
||
closed --> locked: Lock
|
||
locked --> closed: Unlock
|
||
closed --> open: Open
|
||
</pre>
|
||
<h3 id="entity-relationship-model-with-non-default-mermaid-theme">Entity Relationship Model with Non-Default Mermaid Theme</h3>
|
||
<div class="highlight wrap-code"><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">mermaid</span> <span class="p">>}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="o">%%</span><span class="p">{</span><span class="nx">init</span><span class="p">:{</span><span class="s">"theme"</span><span class="p">:</span><span class="s">"forest"</span><span class="p">}}</span><span class="o">%%</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nx">erDiagram</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">CUSTOMER</span> <span class="p">}|..|{</span> <span class="nx">DELIVERY</span><span class="o">-</span><span class="nx">ADDRESS</span> <span class="p">:</span> <span class="nx">has</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">CUSTOMER</span> <span class="o">||--</span><span class="nx">o</span><span class="p">{</span> <span class="nx">ORDER</span> <span class="p">:</span> <span class="nx">places</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">CUSTOMER</span> <span class="o">||--</span><span class="nx">o</span><span class="p">{</span> <span class="nx">INVOICE</span> <span class="p">:</span> <span class="s">"liable for"</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">DELIVERY</span><span class="o">-</span><span class="nx">ADDRESS</span> <span class="o">||--</span><span class="nx">o</span><span class="p">{</span> <span class="nx">ORDER</span> <span class="p">:</span> <span class="nx">receives</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">INVOICE</span> <span class="o">||--</span><span class="p">|{</span> <span class="nx">ORDER</span> <span class="p">:</span> <span class="nx">covers</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">ORDER</span> <span class="o">||--</span><span class="p">|{</span> <span class="nx">ORDER</span><span class="o">-</span><span class="nx">ITEM</span> <span class="p">:</span> <span class="nx">includes</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">PRODUCT</span><span class="o">-</span><span class="nx">CATEGORY</span> <span class="o">||--</span><span class="p">|{</span> <span class="nx">PRODUCT</span> <span class="p">:</span> <span class="nx">contains</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">PRODUCT</span> <span class="o">||--</span><span class="nx">o</span><span class="p">{</span> <span class="nx">ORDER</span><span class="o">-</span><span class="nx">ITEM</span> <span class="p">:</span> <span class="s">"ordered in"</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{<</span> <span class="o">/</span><span class="nx">mermaid</span> <span class="p">>}}</span></span></span></code></pre></div>
|
||
<pre class="mermaid align-center zoomable">
|
||
%%{init:{"theme":"forest"}}%%
|
||
erDiagram
|
||
CUSTOMER }|..|{ DELIVERY-ADDRESS : has
|
||
CUSTOMER ||--o{ ORDER : places
|
||
CUSTOMER ||--o{ INVOICE : "liable for"
|
||
DELIVERY-ADDRESS ||--o{ ORDER : receives
|
||
INVOICE ||--|{ ORDER : covers
|
||
ORDER ||--|{ ORDER-ITEM : includes
|
||
PRODUCT-CATEGORY ||--|{ PRODUCT : contains
|
||
PRODUCT ||--o{ ORDER-ITEM : "ordered in"
|
||
</pre>
|
||
<h3 id="user-journey">User Journey</h3>
|
||
<div class="highlight wrap-code"><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">mermaid</span> <span class="p">>}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nx">journey</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">title</span> <span class="nx">My</span> <span class="nx">working</span> <span class="nx">day</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">section</span> <span class="nx">Go</span> <span class="nx">to</span> <span class="nx">work</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">Make</span> <span class="nx">tea</span><span class="p">:</span> <span class="mi">5</span><span class="p">:</span> <span class="nx">Me</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">Go</span> <span class="nx">upstairs</span><span class="p">:</span> <span class="mi">3</span><span class="p">:</span> <span class="nx">Me</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">Do</span> <span class="nx">work</span><span class="p">:</span> <span class="mi">1</span><span class="p">:</span> <span class="nx">Me</span><span class="p">,</span> <span class="nx">Cat</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">section</span> <span class="nx">Go</span> <span class="nx">home</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">Go</span> <span class="nx">downstairs</span><span class="p">:</span> <span class="mi">5</span><span class="p">:</span> <span class="nx">Me</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">Sit</span> <span class="nx">down</span><span class="p">:</span> <span class="mi">3</span><span class="p">:</span> <span class="nx">Me</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{<</span> <span class="o">/</span><span class="nx">mermaid</span> <span class="p">>}}</span></span></span></code></pre></div>
|
||
<pre class="mermaid align-center zoomable">
|
||
journey
|
||
title My working day
|
||
section Go to work
|
||
Make tea: 5: Me
|
||
Go upstairs: 3: Me
|
||
Do work: 1: Me, Cat
|
||
section Go home
|
||
Go downstairs: 5: Me
|
||
Sit down: 3: Me
|
||
</pre>
|
||
<h3 id="gantt-chart">GANTT Chart</h3>
|
||
<div class="highlight wrap-code"><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">mermaid</span> <span class="p">>}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nx">gantt</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">dateFormat</span> <span class="nx">YYYY</span><span class="o">-</span><span class="nx">MM</span><span class="o">-</span><span class="nx">DD</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">title</span> <span class="nx">Adding</span> <span class="nx">GANTT</span> <span class="nx">diagram</span> <span class="nx">functionality</span> <span class="nx">to</span> <span class="nx">Mermaid</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">section</span> <span class="nx">A</span> <span class="nx">section</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">Completed</span> <span class="nx">task</span> <span class="p">:</span><span class="nx">done</span><span class="p">,</span> <span class="nx">des1</span><span class="p">,</span> <span class="mi">2014</span><span class="o">-</span><span class="mo">01</span><span class="o">-</span><span class="mo">06</span><span class="p">,</span><span class="mi">2014</span><span class="o">-</span><span class="mo">01</span><span class="o">-</span><span class="mi">08</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">Active</span> <span class="nx">task</span> <span class="p">:</span><span class="nx">active</span><span class="p">,</span> <span class="nx">des2</span><span class="p">,</span> <span class="mi">2014</span><span class="o">-</span><span class="mo">01</span><span class="o">-</span><span class="mi">09</span><span class="p">,</span> <span class="mi">3</span><span class="nx">d</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">Future</span> <span class="nx">task</span> <span class="p">:</span> <span class="nx">des3</span><span class="p">,</span> <span class="nx">after</span> <span class="nx">des2</span><span class="p">,</span> <span class="mi">5</span><span class="nx">d</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">Future</span> <span class="nx">task2</span> <span class="p">:</span> <span class="nx">des4</span><span class="p">,</span> <span class="nx">after</span> <span class="nx">des3</span><span class="p">,</span> <span class="mi">5</span><span class="nx">d</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">section</span> <span class="nx">Critical</span> <span class="nx">tasks</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">Completed</span> <span class="nx">task</span> <span class="nx">in</span> <span class="nx">the</span> <span class="nx">critical</span> <span class="nx">line</span> <span class="p">:</span><span class="nx">crit</span><span class="p">,</span> <span class="nx">done</span><span class="p">,</span> <span class="mi">2014</span><span class="o">-</span><span class="mo">01</span><span class="o">-</span><span class="mo">06</span><span class="p">,</span><span class="mi">24</span><span class="nx">h</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">Implement</span> <span class="nx">parser</span> <span class="nx">and</span> <span class="nx">jison</span> <span class="p">:</span><span class="nx">crit</span><span class="p">,</span> <span class="nx">done</span><span class="p">,</span> <span class="nx">after</span> <span class="nx">des1</span><span class="p">,</span> <span class="mi">2</span><span class="nx">d</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">Create</span> <span class="nx">tests</span> <span class="k">for</span> <span class="nx">parser</span> <span class="p">:</span><span class="nx">crit</span><span class="p">,</span> <span class="nx">active</span><span class="p">,</span> <span class="mi">3</span><span class="nx">d</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">Future</span> <span class="nx">task</span> <span class="nx">in</span> <span class="nx">critical</span> <span class="nx">line</span> <span class="p">:</span><span class="nx">crit</span><span class="p">,</span> <span class="mi">5</span><span class="nx">d</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">Create</span> <span class="nx">tests</span> <span class="k">for</span> <span class="nx">renderer</span> <span class="p">:</span><span class="mi">2</span><span class="nx">d</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">Add</span> <span class="nx">to</span> <span class="nx">Mermaid</span> <span class="p">:</span><span class="mi">1</span><span class="nx">d</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{<</span> <span class="o">/</span><span class="nx">mermaid</span> <span class="p">>}}</span></span></span></code></pre></div>
|
||
<pre class="mermaid align-center zoomable">
|
||
gantt
|
||
dateFormat YYYY-MM-DD
|
||
title Adding GANTT diagram functionality to Mermaid
|
||
section A section
|
||
Completed task :done, des1, 2014-01-06,2014-01-08
|
||
Active task :active, des2, 2014-01-09, 3d
|
||
Future task : des3, after des2, 5d
|
||
Future task2 : des4, after des3, 5d
|
||
section Critical tasks
|
||
Completed task in the critical line :crit, done, 2014-01-06,24h
|
||
Implement parser and jison :crit, done, after des1, 2d
|
||
Create tests for parser :crit, active, 3d
|
||
Future task in critical line :crit, 5d
|
||
Create tests for renderer :2d
|
||
Add to Mermaid :1d
|
||
</pre>
|
||
<h3 id="pie-chart-without-zoom">Pie Chart without Zoom</h3>
|
||
<div class="highlight wrap-code"><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">mermaid</span> <span class="nx">zoom</span><span class="p">=</span><span class="s">"false"</span> <span class="p">>}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nx">pie</span> <span class="nx">title</span> <span class="nx">Pets</span> <span class="nx">adopted</span> <span class="nx">by</span> <span class="nx">volunteers</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"Dogs"</span> <span class="p">:</span> <span class="mi">386</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"Cats"</span> <span class="p">:</span> <span class="mi">85</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"Rats"</span> <span class="p">:</span> <span class="mi">15</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{<</span> <span class="o">/</span><span class="nx">mermaid</span> <span class="p">>}}</span></span></span></code></pre></div>
|
||
<pre class="mermaid align-center ">
|
||
pie title Pets adopted by volunteers
|
||
"Dogs" : 386
|
||
"Cats" : 85
|
||
"Rats" : 15
|
||
</pre>
|
||
<h3 id="quadrant-chart">Quadrant Chart</h3>
|
||
<div class="highlight wrap-code"><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">mermaid</span> <span class="p">>}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nx">pie</span> <span class="nx">title</span> <span class="nx">Pets</span> <span class="nx">adopted</span> <span class="nx">by</span> <span class="nx">volunteers</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">title</span> <span class="nx">Reach</span> <span class="nx">and</span> <span class="nx">engagement</span> <span class="nx">of</span> <span class="nx">campaigns</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">x</span><span class="o">-</span><span class="nx">axis</span> <span class="nx">Low</span> <span class="nx">Reach</span> <span class="o">--</span><span class="p">></span> <span class="nx">High</span> <span class="nx">Reach</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">y</span><span class="o">-</span><span class="nx">axis</span> <span class="nx">Low</span> <span class="nx">Engagement</span> <span class="o">--</span><span class="p">></span> <span class="nx">High</span> <span class="nx">Engagement</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">quadrant</span><span class="o">-</span><span class="mi">1</span> <span class="nx">We</span> <span class="nx">should</span> <span class="nx">expand</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">quadrant</span><span class="o">-</span><span class="mi">2</span> <span class="nx">Need</span> <span class="nx">to</span> <span class="nx">promote</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">quadrant</span><span class="o">-</span><span class="mi">3</span> <span class="nx">Re</span><span class="o">-</span><span class="nx">evaluate</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">quadrant</span><span class="o">-</span><span class="mi">4</span> <span class="nx">May</span> <span class="nx">be</span> <span class="nx">improved</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">Campaign</span> <span class="nx">A</span><span class="p">:</span> <span class="p">[</span><span class="mf">0.3</span><span class="p">,</span> <span class="mf">0.6</span><span class="p">]</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">Campaign</span> <span class="nx">B</span><span class="p">:</span> <span class="p">[</span><span class="mf">0.45</span><span class="p">,</span> <span class="mf">0.23</span><span class="p">]</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">Campaign</span> <span class="nx">C</span><span class="p">:</span> <span class="p">[</span><span class="mf">0.57</span><span class="p">,</span> <span class="mf">0.69</span><span class="p">]</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">Campaign</span> <span class="nx">D</span><span class="p">:</span> <span class="p">[</span><span class="mf">0.78</span><span class="p">,</span> <span class="mf">0.34</span><span class="p">]</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">Campaign</span> <span class="nx">E</span><span class="p">:</span> <span class="p">[</span><span class="mf">0.40</span><span class="p">,</span> <span class="mf">0.34</span><span class="p">]</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">Campaign</span> <span class="nx">F</span><span class="p">:</span> <span class="p">[</span><span class="mf">0.35</span><span class="p">,</span> <span class="mf">0.78</span><span class="p">]</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{<</span> <span class="o">/</span><span class="nx">mermaid</span> <span class="p">>}}</span></span></span></code></pre></div>
|
||
<pre class="mermaid align-center zoomable">
|
||
quadrantChart
|
||
title Reach and engagement of campaigns
|
||
x-axis Low Reach --> High Reach
|
||
y-axis Low Engagement --> High Engagement
|
||
quadrant-1 We should expand
|
||
quadrant-2 Need to promote
|
||
quadrant-3 Re-evaluate
|
||
quadrant-4 May be improved
|
||
Campaign A: [0.3, 0.6]
|
||
Campaign B: [0.45, 0.23]
|
||
Campaign C: [0.57, 0.69]
|
||
Campaign D: [0.78, 0.34]
|
||
Campaign E: [0.40, 0.34]
|
||
Campaign F: [0.35, 0.78]
|
||
</pre>
|
||
<h3 id="requirement-diagram">Requirement Diagram</h3>
|
||
<div class="highlight wrap-code"><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">mermaid</span> <span class="p">>}}</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">requirementDiagram</span>
|
||
</span></span><span class="line"><span class="cl">
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">requirement</span> <span class="nx">test_req</span> <span class="p">{</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">id</span><span class="p">:</span> <span class="mi">1</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">text</span><span class="p">:</span> <span class="nx">the</span> <span class="nx">test</span> <span class="nx">text</span><span class="p">.</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">risk</span><span class="p">:</span> <span class="nx">high</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">verifymethod</span><span class="p">:</span> <span class="nx">test</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="p">}</span>
|
||
</span></span><span class="line"><span class="cl">
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">element</span> <span class="nx">test_entity</span> <span class="p">{</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="kd">type</span><span class="p">:</span> <span class="nx">simulation</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="p">}</span>
|
||
</span></span><span class="line"><span class="cl">
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">test_entity</span> <span class="o">-</span> <span class="nx">satisfies</span> <span class="o">-</span><span class="p">></span> <span class="nx">test_req</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{<</span> <span class="o">/</span><span class="nx">mermaid</span> <span class="p">>}}</span></span></span></code></pre></div>
|
||
<pre class="mermaid align-center zoomable">
|
||
requirementDiagram
|
||
|
||
requirement test_req {
|
||
id: 1
|
||
text: the test text.
|
||
risk: high
|
||
verifymethod: test
|
||
}
|
||
|
||
element test_entity {
|
||
type: simulation
|
||
}
|
||
|
||
test_entity - satisfies -> test_req
|
||
</pre>
|
||
<h3 id="git-graph">Git Graph</h3>
|
||
<div class="highlight wrap-code"><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">mermaid</span> <span class="p">>}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nx">gitGraph</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">commit</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">commit</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">branch</span> <span class="nx">develop</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">checkout</span> <span class="nx">develop</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">commit</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">commit</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">checkout</span> <span class="nx">main</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">merge</span> <span class="nx">develop</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">commit</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">commit</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{<</span> <span class="o">/</span><span class="nx">mermaid</span> <span class="p">>}}</span></span></span></code></pre></div>
|
||
<pre class="mermaid align-center zoomable">
|
||
gitGraph
|
||
commit
|
||
commit
|
||
branch develop
|
||
checkout develop
|
||
commit
|
||
commit
|
||
checkout main
|
||
merge develop
|
||
commit
|
||
commit
|
||
</pre>
|
||
<h3 id="c4-diagrams">C4 Diagrams</h3>
|
||
<div class="highlight wrap-code"><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">mermaid</span> <span class="p">>}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nx">C4Context</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">title</span> <span class="nx">System</span> <span class="nx">Context</span> <span class="nx">diagram</span> <span class="k">for</span> <span class="nx">Internet</span> <span class="nx">Banking</span> <span class="nx">System</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nf">Enterprise_Boundary</span><span class="p">(</span><span class="nx">b0</span><span class="p">,</span> <span class="s">"BankBoundary0"</span><span class="p">)</span> <span class="p">{</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nf">Person</span><span class="p">(</span><span class="nx">customerA</span><span class="p">,</span> <span class="s">"Banking Customer A"</span><span class="p">,</span> <span class="s">"A customer of the bank, with personal bank accounts."</span><span class="p">)</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nf">Person</span><span class="p">(</span><span class="nx">customerB</span><span class="p">,</span> <span class="s">"Banking Customer B"</span><span class="p">)</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nf">Person_Ext</span><span class="p">(</span><span class="nx">customerC</span><span class="p">,</span> <span class="s">"Banking Customer C"</span><span class="p">,</span> <span class="s">"desc"</span><span class="p">)</span>
|
||
</span></span><span class="line"><span class="cl">
|
||
</span></span><span class="line"><span class="cl"> <span class="nf">Person</span><span class="p">(</span><span class="nx">customerD</span><span class="p">,</span> <span class="s">"Banking Customer D"</span><span class="p">,</span> <span class="s">"A customer of the bank, <br/> with personal bank accounts."</span><span class="p">)</span>
|
||
</span></span><span class="line"><span class="cl">
|
||
</span></span><span class="line"><span class="cl"> <span class="nf">System</span><span class="p">(</span><span class="nx">SystemAA</span><span class="p">,</span> <span class="s">"Internet Banking System"</span><span class="p">,</span> <span class="s">"Allows customers to view information about their bank accounts, and make payments."</span><span class="p">)</span>
|
||
</span></span><span class="line"><span class="cl">
|
||
</span></span><span class="line"><span class="cl"> <span class="nf">Enterprise_Boundary</span><span class="p">(</span><span class="nx">b1</span><span class="p">,</span> <span class="s">"BankBoundary"</span><span class="p">)</span> <span class="p">{</span>
|
||
</span></span><span class="line"><span class="cl">
|
||
</span></span><span class="line"><span class="cl"> <span class="nf">SystemDb_Ext</span><span class="p">(</span><span class="nx">SystemE</span><span class="p">,</span> <span class="s">"Mainframe Banking System"</span><span class="p">,</span> <span class="s">"Stores all of the core banking information about customers, accounts, transactions, etc."</span><span class="p">)</span>
|
||
</span></span><span class="line"><span class="cl">
|
||
</span></span><span class="line"><span class="cl"> <span class="nf">System_Boundary</span><span class="p">(</span><span class="nx">b2</span><span class="p">,</span> <span class="s">"BankBoundary2"</span><span class="p">)</span> <span class="p">{</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nf">System</span><span class="p">(</span><span class="nx">SystemA</span><span class="p">,</span> <span class="s">"Banking System A"</span><span class="p">)</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nf">System</span><span class="p">(</span><span class="nx">SystemB</span><span class="p">,</span> <span class="s">"Banking System B"</span><span class="p">,</span> <span class="s">"A system of the bank, with personal bank accounts. next line."</span><span class="p">)</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="p">}</span>
|
||
</span></span><span class="line"><span class="cl">
|
||
</span></span><span class="line"><span class="cl"> <span class="nf">System_Ext</span><span class="p">(</span><span class="nx">SystemC</span><span class="p">,</span> <span class="s">"E-mail system"</span><span class="p">,</span> <span class="s">"The internal Microsoft Exchange e-mail system."</span><span class="p">)</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nf">SystemDb</span><span class="p">(</span><span class="nx">SystemD</span><span class="p">,</span> <span class="s">"Banking System D Database"</span><span class="p">,</span> <span class="s">"A system of the bank, with personal bank accounts."</span><span class="p">)</span>
|
||
</span></span><span class="line"><span class="cl">
|
||
</span></span><span class="line"><span class="cl"> <span class="nf">Boundary</span><span class="p">(</span><span class="nx">b3</span><span class="p">,</span> <span class="s">"BankBoundary3"</span><span class="p">,</span> <span class="s">"boundary"</span><span class="p">)</span> <span class="p">{</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nf">SystemQueue</span><span class="p">(</span><span class="nx">SystemF</span><span class="p">,</span> <span class="s">"Banking System F Queue"</span><span class="p">,</span> <span class="s">"A system of the bank."</span><span class="p">)</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nf">SystemQueue_Ext</span><span class="p">(</span><span class="nx">SystemG</span><span class="p">,</span> <span class="s">"Banking System G Queue"</span><span class="p">,</span> <span class="s">"A system of the bank, with personal bank accounts."</span><span class="p">)</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="p">}</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="p">}</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="p">}</span>
|
||
</span></span><span class="line"><span class="cl">
|
||
</span></span><span class="line"><span class="cl"> <span class="nf">BiRel</span><span class="p">(</span><span class="nx">customerA</span><span class="p">,</span> <span class="nx">SystemAA</span><span class="p">,</span> <span class="s">"Uses"</span><span class="p">)</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nf">BiRel</span><span class="p">(</span><span class="nx">SystemAA</span><span class="p">,</span> <span class="nx">SystemE</span><span class="p">,</span> <span class="s">"Uses"</span><span class="p">)</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nf">Rel</span><span class="p">(</span><span class="nx">SystemAA</span><span class="p">,</span> <span class="nx">SystemC</span><span class="p">,</span> <span class="s">"Sends e-mails"</span><span class="p">,</span> <span class="s">"SMTP"</span><span class="p">)</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nf">Rel</span><span class="p">(</span><span class="nx">SystemC</span><span class="p">,</span> <span class="nx">customerA</span><span class="p">,</span> <span class="s">"Sends e-mails to"</span><span class="p">)</span>
|
||
</span></span><span class="line"><span class="cl">
|
||
</span></span><span class="line"><span class="cl"> <span class="nf">UpdateElementStyle</span><span class="p">(</span><span class="nx">customerA</span><span class="p">,</span> <span class="err">$</span><span class="nx">fontColor</span><span class="p">=</span><span class="s">"red"</span><span class="p">,</span> <span class="err">$</span><span class="nx">bgColor</span><span class="p">=</span><span class="s">"grey"</span><span class="p">,</span> <span class="err">$</span><span class="nx">borderColor</span><span class="p">=</span><span class="s">"red"</span><span class="p">)</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nf">UpdateRelStyle</span><span class="p">(</span><span class="nx">customerA</span><span class="p">,</span> <span class="nx">SystemAA</span><span class="p">,</span> <span class="err">$</span><span class="nx">textColor</span><span class="p">=</span><span class="s">"blue"</span><span class="p">,</span> <span class="err">$</span><span class="nx">lineColor</span><span class="p">=</span><span class="s">"blue"</span><span class="p">,</span> <span class="err">$</span><span class="nx">offsetX</span><span class="p">=</span><span class="s">"5"</span><span class="p">)</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nf">UpdateRelStyle</span><span class="p">(</span><span class="nx">SystemAA</span><span class="p">,</span> <span class="nx">SystemE</span><span class="p">,</span> <span class="err">$</span><span class="nx">textColor</span><span class="p">=</span><span class="s">"blue"</span><span class="p">,</span> <span class="err">$</span><span class="nx">lineColor</span><span class="p">=</span><span class="s">"blue"</span><span class="p">,</span> <span class="err">$</span><span class="nx">offsetY</span><span class="p">=</span><span class="s">"-10"</span><span class="p">)</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nf">UpdateRelStyle</span><span class="p">(</span><span class="nx">SystemAA</span><span class="p">,</span> <span class="nx">SystemC</span><span class="p">,</span> <span class="err">$</span><span class="nx">textColor</span><span class="p">=</span><span class="s">"blue"</span><span class="p">,</span> <span class="err">$</span><span class="nx">lineColor</span><span class="p">=</span><span class="s">"blue"</span><span class="p">,</span> <span class="err">$</span><span class="nx">offsetY</span><span class="p">=</span><span class="s">"-40"</span><span class="p">,</span> <span class="err">$</span><span class="nx">offsetX</span><span class="p">=</span><span class="s">"-50"</span><span class="p">)</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nf">UpdateRelStyle</span><span class="p">(</span><span class="nx">SystemC</span><span class="p">,</span> <span class="nx">customerA</span><span class="p">,</span> <span class="err">$</span><span class="nx">textColor</span><span class="p">=</span><span class="s">"red"</span><span class="p">,</span> <span class="err">$</span><span class="nx">lineColor</span><span class="p">=</span><span class="s">"red"</span><span class="p">,</span> <span class="err">$</span><span class="nx">offsetX</span><span class="p">=</span><span class="s">"-50"</span><span class="p">,</span> <span class="err">$</span><span class="nx">offsetY</span><span class="p">=</span><span class="s">"20"</span><span class="p">)</span>
|
||
</span></span><span class="line"><span class="cl">
|
||
</span></span><span class="line"><span class="cl"> <span class="nf">UpdateLayoutConfig</span><span class="p">(</span><span class="err">$</span><span class="nx">c4ShapeInRow</span><span class="p">=</span><span class="s">"3"</span><span class="p">,</span> <span class="err">$</span><span class="nx">c4BoundaryInRow</span><span class="p">=</span><span class="s">"1"</span><span class="p">)</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{<</span> <span class="o">/</span><span class="nx">mermaid</span> <span class="p">>}}</span></span></span></code></pre></div>
|
||
<pre class="mermaid align-center zoomable">
|
||
C4Context
|
||
title System Context diagram for Internet Banking System
|
||
Enterprise_Boundary(b0, "BankBoundary0") {
|
||
Person(customerA, "Banking Customer A", "A customer of the bank, with personal bank accounts.")
|
||
Person(customerB, "Banking Customer B")
|
||
Person_Ext(customerC, "Banking Customer C", "desc")
|
||
|
||
Person(customerD, "Banking Customer D", "A customer of the bank, <br/> with personal bank accounts.")
|
||
|
||
System(SystemAA, "Internet Banking System", "Allows customers to view information about their bank accounts, and make payments.")
|
||
|
||
Enterprise_Boundary(b1, "BankBoundary") {
|
||
|
||
SystemDb_Ext(SystemE, "Mainframe Banking System", "Stores all of the core banking information about customers, accounts, transactions, etc.")
|
||
|
||
System_Boundary(b2, "BankBoundary2") {
|
||
System(SystemA, "Banking System A")
|
||
System(SystemB, "Banking System B", "A system of the bank, with personal bank accounts. next line.")
|
||
}
|
||
|
||
System_Ext(SystemC, "E-mail system", "The internal Microsoft Exchange e-mail system.")
|
||
SystemDb(SystemD, "Banking System D Database", "A system of the bank, with personal bank accounts.")
|
||
|
||
Boundary(b3, "BankBoundary3", "boundary") {
|
||
SystemQueue(SystemF, "Banking System F Queue", "A system of the bank.")
|
||
SystemQueue_Ext(SystemG, "Banking System G Queue", "A system of the bank, with personal bank accounts.")
|
||
}
|
||
}
|
||
}
|
||
|
||
BiRel(customerA, SystemAA, "Uses")
|
||
BiRel(SystemAA, SystemE, "Uses")
|
||
Rel(SystemAA, SystemC, "Sends e-mails", "SMTP")
|
||
Rel(SystemC, customerA, "Sends e-mails to")
|
||
|
||
UpdateElementStyle(customerA, $fontColor="red", $bgColor="grey", $borderColor="red")
|
||
UpdateRelStyle(customerA, SystemAA, $textColor="blue", $lineColor="blue", $offsetX="5")
|
||
UpdateRelStyle(SystemAA, SystemE, $textColor="blue", $lineColor="blue", $offsetY="-10")
|
||
UpdateRelStyle(SystemAA, SystemC, $textColor="blue", $lineColor="blue", $offsetY="-40", $offsetX="-50")
|
||
UpdateRelStyle(SystemC, customerA, $textColor="red", $lineColor="red", $offsetX="-50", $offsetY="20")
|
||
|
||
UpdateLayoutConfig($c4ShapeInRow="3", $c4BoundaryInRow="1")
|
||
</pre>
|
||
<h3 id="mindmaps">Mindmaps</h3>
|
||
<div class="highlight wrap-code"><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">mermaid</span> <span class="p">>}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nx">mindmap</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nf">root</span><span class="p">((</span><span class="nx">mindmap</span><span class="p">))</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">Origins</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">Long</span> <span class="nx">history</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="p">::</span><span class="nf">icon</span><span class="p">(</span><span class="nx">fa</span> <span class="nx">fa</span><span class="o">-</span><span class="nx">book</span><span class="p">)</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">Popularisation</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">British</span> <span class="nx">popular</span> <span class="nx">psychology</span> <span class="nx">author</span> <span class="nx">Tony</span> <span class="nx">Buzan</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">Research</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">On</span> <span class="nx">effectiveness</span><span class="p"><</span><span class="nx">br</span><span class="o">/</span><span class="p">></span><span class="nx">and</span> <span class="nx">features</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">On</span> <span class="nx">Automatic</span> <span class="nx">creation</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">Uses</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">Creative</span> <span class="nx">techniques</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">Strategic</span> <span class="nx">planning</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">Argument</span> <span class="nx">mapping</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">Tools</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">Pen</span> <span class="nx">and</span> <span class="nx">paper</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">Mermaid</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{<</span> <span class="o">/</span><span class="nx">mermaid</span> <span class="p">>}}</span></span></span></code></pre></div>
|
||
<pre class="mermaid align-center zoomable">
|
||
mindmap
|
||
root((mindmap))
|
||
Origins
|
||
Long history
|
||
::icon(fa fa-book)
|
||
Popularisation
|
||
British popular psychology author Tony Buzan
|
||
Research
|
||
On effectiveness<br/>and features
|
||
On Automatic creation
|
||
Uses
|
||
Creative techniques
|
||
Strategic planning
|
||
Argument mapping
|
||
Tools
|
||
Pen and paper
|
||
Mermaid
|
||
</pre>
|
||
<h3 id="timeline">Timeline</h3>
|
||
<div class="highlight wrap-code"><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">mermaid</span> <span class="p">>}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nx">timeline</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">title</span> <span class="nx">History</span> <span class="nx">of</span> <span class="nx">Social</span> <span class="nx">Media</span> <span class="nx">Platform</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="mi">2002</span> <span class="p">:</span> <span class="nx">LinkedIn</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="mi">2004</span> <span class="p">:</span> <span class="nx">Facebook</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="p">:</span> <span class="nx">Google</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="mi">2005</span> <span class="p">:</span> <span class="nx">Youtube</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="mi">2006</span> <span class="p">:</span> <span class="nx">Twitter</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{<</span> <span class="o">/</span><span class="nx">mermaid</span> <span class="p">>}}</span></span></span></code></pre></div>
|
||
<pre class="mermaid align-center zoomable">
|
||
timeline
|
||
title History of Social Media Platform
|
||
2002 : LinkedIn
|
||
2004 : Facebook
|
||
: Google
|
||
2005 : Youtube
|
||
2006 : Twitter
|
||
</pre>
|
||
<h3 id="sankey">Sankey</h3>
|
||
<div class="highlight wrap-code"><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">mermaid</span> <span class="p">>}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nx">sankey</span><span class="o">-</span><span class="nx">beta</span>
|
||
</span></span><span class="line"><span class="cl">
|
||
</span></span><span class="line"><span class="cl"><span class="o">%%</span> <span class="nx">source</span><span class="p">,</span><span class="nx">target</span><span class="p">,</span><span class="nx">value</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nx">Electricity</span> <span class="nx">grid</span><span class="p">,</span><span class="nx">Over</span> <span class="nx">generation</span> <span class="o">/</span> <span class="nx">exports</span><span class="p">,</span><span class="mf">104.453</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nx">Electricity</span> <span class="nx">grid</span><span class="p">,</span><span class="nx">Heating</span> <span class="nx">and</span> <span class="nx">cooling</span> <span class="o">-</span> <span class="nx">homes</span><span class="p">,</span><span class="mf">113.726</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nx">Electricity</span> <span class="nx">grid</span><span class="p">,</span><span class="nx">H2</span> <span class="nx">conversion</span><span class="p">,</span><span class="mf">27.14</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{<</span> <span class="o">/</span><span class="nx">mermaid</span> <span class="p">>}}</span></span></span></code></pre></div>
|
||
<pre class="mermaid align-center zoomable">
|
||
sankey-beta
|
||
|
||
%% source,target,value
|
||
Electricity grid,Over generation / exports,104.453
|
||
Electricity grid,Heating and cooling - homes,113.726
|
||
Electricity grid,H2 conversion,27.14
|
||
</pre>
|
||
<h3 id="xychart">XYChart</h3>
|
||
<div class="highlight wrap-code"><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">mermaid</span> <span class="p">>}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nx">xychart</span><span class="o">-</span><span class="nx">beta</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">title</span> <span class="s">"Sales Revenue"</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">x</span><span class="o">-</span><span class="nx">axis</span> <span class="p">[</span><span class="nx">jan</span><span class="p">,</span> <span class="nx">feb</span><span class="p">,</span> <span class="nx">mar</span><span class="p">,</span> <span class="nx">apr</span><span class="p">,</span> <span class="nx">may</span><span class="p">,</span> <span class="nx">jun</span><span class="p">,</span> <span class="nx">jul</span><span class="p">,</span> <span class="nx">aug</span><span class="p">,</span> <span class="nx">sep</span><span class="p">,</span> <span class="nx">oct</span><span class="p">,</span> <span class="nx">nov</span><span class="p">,</span> <span class="nx">dec</span><span class="p">]</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">y</span><span class="o">-</span><span class="nx">axis</span> <span class="s">"Revenue (in $)"</span> <span class="mi">4000</span> <span class="o">--</span><span class="p">></span> <span class="mi">11000</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">bar</span> <span class="p">[</span><span class="mi">5000</span><span class="p">,</span> <span class="mi">6000</span><span class="p">,</span> <span class="mi">7500</span><span class="p">,</span> <span class="mi">8200</span><span class="p">,</span> <span class="mi">9500</span><span class="p">,</span> <span class="mi">10500</span><span class="p">,</span> <span class="mi">11000</span><span class="p">,</span> <span class="mi">10200</span><span class="p">,</span> <span class="mi">9200</span><span class="p">,</span> <span class="mi">8500</span><span class="p">,</span> <span class="mi">7000</span><span class="p">,</span> <span class="mi">6000</span><span class="p">]</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">line</span> <span class="p">[</span><span class="mi">5000</span><span class="p">,</span> <span class="mi">6000</span><span class="p">,</span> <span class="mi">7500</span><span class="p">,</span> <span class="mi">8200</span><span class="p">,</span> <span class="mi">9500</span><span class="p">,</span> <span class="mi">10500</span><span class="p">,</span> <span class="mi">11000</span><span class="p">,</span> <span class="mi">10200</span><span class="p">,</span> <span class="mi">9200</span><span class="p">,</span> <span class="mi">8500</span><span class="p">,</span> <span class="mi">7000</span><span class="p">,</span> <span class="mi">6000</span><span class="p">]</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{<</span> <span class="o">/</span><span class="nx">mermaid</span> <span class="p">>}}</span></span></span></code></pre></div>
|
||
<pre class="mermaid align-center zoomable">
|
||
xychart-beta
|
||
title "Sales Revenue"
|
||
x-axis [jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec]
|
||
y-axis "Revenue (in $)" 4000 --> 11000
|
||
bar [5000, 6000, 7500, 8200, 9500, 10500, 11000, 10200, 9200, 8500, 7000, 6000]
|
||
line [5000, 6000, 7500, 8200, 9500, 10500, 11000, 10200, 9200, 8500, 7000, 6000]
|
||
</pre>
|
||
<h3 id="block-diagram">Block Diagram</h3>
|
||
<div class="highlight wrap-code"><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">mermaid</span> <span class="p">>}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nx">block</span><span class="o">-</span><span class="nx">beta</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nx">columns</span> <span class="mi">1</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nf">db</span><span class="p">((</span><span class="s">"DB"</span><span class="p">))</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">blockArrowId6</span><span class="p"><[</span><span class="s">"&nbsp;&nbsp;&nbsp;"</span><span class="p">]>(</span><span class="nx">down</span><span class="p">)</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">block</span><span class="p">:</span><span class="nx">ID</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">A</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">B</span><span class="p">[</span><span class="s">"A wide one in the middle"</span><span class="p">]</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">C</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">end</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">space</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">D</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">ID</span> <span class="o">--</span><span class="p">></span> <span class="nx">D</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">C</span> <span class="o">--</span><span class="p">></span> <span class="nx">D</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">style</span> <span class="nx">B</span> <span class="nx">fill</span><span class="p">:</span><span class="err">#</span><span class="mi">969</span><span class="p">,</span><span class="nx">stroke</span><span class="p">:</span><span class="err">#</span><span class="mi">333</span><span class="p">,</span><span class="nx">stroke</span><span class="o">-</span><span class="nx">width</span><span class="p">:</span><span class="mi">4</span><span class="nx">px</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{<</span> <span class="o">/</span><span class="nx">mermaid</span> <span class="p">>}}</span></span></span></code></pre></div>
|
||
<pre class="mermaid align-center zoomable">
|
||
block-beta
|
||
columns 1
|
||
db(("DB"))
|
||
blockArrowId6<["&nbsp;&nbsp;&nbsp;"]>(down)
|
||
block:ID
|
||
A
|
||
B["A wide one in the middle"]
|
||
C
|
||
end
|
||
space
|
||
D
|
||
ID --> D
|
||
C --> D
|
||
style B fill:#969,stroke:#333,stroke-width:4px
|
||
</pre>
|
||
|
||
<footer class="footline">
|
||
</footer>
|
||
</article>
|
||
|
||
<article class="default">
|
||
<header class="headline">
|
||
</header>
|
||
|
||
<h1 id="notice">Notice</h1>
|
||
|
||
<p>The <code>notice</code> shortcode shows various types of disclaimers with adjustable color, title and icon to help you structure your page.</p>
|
||
|
||
<div class="box notices cstyle primary">
|
||
<div class="box-label"><i class="fa-fw fas fa-skull-crossbones"></i> There may be pirates</div>
|
||
<div class="box-content">
|
||
|
||
<p>It is all about the boxes.</p>
|
||
</div>
|
||
</div>
|
||
<h2 id="usage">Usage</h2>
|
||
<p>While the examples are using shortcodes with named parameter you are free to use positional as well or also call this shortcode from your own partials.</p>
|
||
|
||
<div class="tab-panel" data-tab-group="shortcode-parameter">
|
||
<div class="tab-nav">
|
||
<div class="tab-nav-title">​</div>
|
||
<button
|
||
data-tab-item="shortcode"
|
||
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
|
||
onclick="switchTab('shortcode-parameter','shortcode')"
|
||
>
|
||
<span class="tab-nav-text">shortcode</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="shortcode-positional"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('shortcode-parameter','shortcode-positional')"
|
||
>
|
||
<span class="tab-nav-text">shortcode (positional)</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="partial"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('shortcode-parameter','partial')"
|
||
>
|
||
<span class="tab-nav-text">partial</span>
|
||
</button>
|
||
</div>
|
||
<div class="tab-content-container">
|
||
<div
|
||
data-tab-item="shortcode"
|
||
class="tab-content tab-panel-style cstyle initial active">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><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">notice</span> <span class="nx">style</span><span class="p">=</span><span class="s">"primary"</span> <span class="nx">title</span><span class="p">=</span><span class="s">"There may be pirates"</span> <span class="nx">icon</span><span class="p">=</span><span class="s">"skull-crossbones"</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nx">It</span> <span class="nx">is</span> <span class="nx">all</span> <span class="nx">about</span> <span class="nx">the</span> <span class="nx">boxes</span><span class="p">.</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">notice</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div></div>
|
||
</div>
|
||
<div
|
||
data-tab-item="shortcode-positional"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><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">notice</span> <span class="nx">primary</span> <span class="s">"There may be pirates"</span> <span class="s">"skull-crossbones"</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nx">It</span> <span class="nx">is</span> <span class="nx">all</span> <span class="nx">about</span> <span class="nx">the</span> <span class="nx">boxes</span><span class="p">.</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">notice</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div></div>
|
||
</div>
|
||
<div
|
||
data-tab-item="partial"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><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/notice.html"</span> <span class="p">(</span><span class="nx">dict</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"page"</span> <span class="p">.</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"style"</span> <span class="s">"primary"</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"title"</span> <span class="s">"There may be pirates"</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"icon"</span> <span class="s">"skull-crossbones"</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"content"</span> <span class="s">"It is all about the boxes."</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">)}}</span></span></span></code></pre></div></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<h3 id="parameter">Parameter</h3>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Name</th>
|
||
<th>Position</th>
|
||
<th>Default</th>
|
||
<th>Notes</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td><strong>style</strong></td>
|
||
<td>1</td>
|
||
<td><code>default</code></td>
|
||
<td>The style scheme used for the box.<br><br>- by severity: <code>info</code>, <code>note</code>, <code>tip</code>, <code>warning</code><br>- by brand color: <code>primary</code>, <code>secondary</code>, <code>accent</code><br>- by color: <code>blue</code>, <code>green</code>, <code>grey</code>, <code>orange</code>, <code>red</code><br>- by special color: <code>default</code>, <code>transparent</code>, <code>code</code></td>
|
||
</tr>
|
||
<tr>
|
||
<td><strong>color</strong></td>
|
||
<td></td>
|
||
<td>see notes</td>
|
||
<td>The <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/color_value" rel="external" target="_self">CSS color value</a> to be used. If not set, the chosen color depends on the <strong>style</strong>. Any given value will overwrite the default.<br><br>- for severity styles: a nice matching color for the severity<br>- for all other styles: the corresponding color</td>
|
||
</tr>
|
||
<tr>
|
||
<td><strong>title</strong></td>
|
||
<td>2</td>
|
||
<td>see notes</td>
|
||
<td>Arbitrary text for the box title. Depending on the <strong>style</strong> there may be a default title. Any given value will overwrite the default.<br><br>- for severity styles: the matching title for the severity<br>- for all other styles: <em><empty></em><br><br>If you want no title for a severity style, you have to set this parameter to <code>" "</code> (a non empty string filled with spaces)</td>
|
||
</tr>
|
||
<tr>
|
||
<td><strong>icon</strong></td>
|
||
<td>3</td>
|
||
<td>see notes</td>
|
||
<td><a href="/hugo-theme-relearn/shortcodes/icon/index.html#finding-an-icon">Font Awesome icon name</a> set to the left of the title. Depending on the <strong>style</strong> there may be a default icon. Any given value will overwrite the default.<br><br>- for severity styles: a nice matching icon for the severity<br>- for all other styles: <em><empty></em><br><br>If you want no icon for a severity style, you have to set this parameter to <code>" "</code> (a non empty string filled with spaces)</td>
|
||
</tr>
|
||
<tr>
|
||
<td><em><strong><content></strong></em></td>
|
||
<td></td>
|
||
<td><em><empty></em></td>
|
||
<td>Arbitrary text to be displayed in box.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h2 id="examples">Examples</h2>
|
||
<h3 id="by-severity">By Severity</h3>
|
||
<h4 id="info-with-markup">Info with markup</h4>
|
||
<div class="highlight wrap-code"><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">notice</span> <span class="nx">style</span><span class="p">=</span><span class="s">"info"</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nx">An</span> <span class="o">**</span><span class="nx">information</span><span class="o">**</span> <span class="nx">disclaimer</span>
|
||
</span></span><span class="line"><span class="cl">
|
||
</span></span><span class="line"><span class="cl"><span class="nx">You</span> <span class="nx">can</span> <span class="nx">add</span> <span class="nx">standard</span> <span class="nx">markdown</span> <span class="nx">syntax</span><span class="p">:</span>
|
||
</span></span><span class="line"><span class="cl">
|
||
</span></span><span class="line"><span class="cl"><span class="o">-</span> <span class="nx">multiple</span> <span class="nx">paragraphs</span>
|
||
</span></span><span class="line"><span class="cl"><span class="o">-</span> <span class="nx">bullet</span> <span class="nx">point</span> <span class="nx">lists</span>
|
||
</span></span><span class="line"><span class="cl"><span class="o">-</span> <span class="nx">_emphasized_</span><span class="p">,</span> <span class="o">**</span><span class="nx">bold</span><span class="o">**</span> <span class="nx">and</span> <span class="nx">even</span> <span class="o">***</span><span class="nx">bold</span> <span class="nx">emphasized</span><span class="o">***</span> <span class="nx">text</span>
|
||
</span></span><span class="line"><span class="cl"><span class="o">-</span> <span class="p">[</span><span class="nx">links</span><span class="p">](</span><span class="nx">https</span><span class="p">:</span><span class="c1">//example.com)
|
||
</span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="o">-</span> <span class="nx">etc</span><span class="p">.</span>
|
||
</span></span><span class="line"><span class="cl">
|
||
</span></span><span class="line"><span class="cl"><span class="s">```plaintext
|
||
</span></span></span><span class="line"><span class="cl"><span class="s">...and even source code
|
||
</span></span></span><span class="line"><span class="cl"><span class="s">```</span>
|
||
</span></span><span class="line"><span class="cl">
|
||
</span></span><span class="line"><span class="cl"><span class="p">></span> <span class="nx">the</span> <span class="nx">possibilities</span> <span class="nx">are</span> <span class="nf">endless</span> <span class="p">(</span><span class="nx">almost</span> <span class="o">-</span> <span class="nx">including</span> <span class="nx">other</span> <span class="nx">shortcodes</span> <span class="nx">may</span> <span class="nx">or</span> <span class="nx">may</span> <span class="nx">not</span> <span class="nx">work</span><span class="p">)</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">notice</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div>
|
||
<div class="box notices cstyle info">
|
||
<div class="box-label"><i class="fa-fw fas fa-info-circle"></i> Info</div>
|
||
<div class="box-content">
|
||
|
||
<p>An <strong>information</strong> disclaimer</p>
|
||
<p>You can add standard markdown syntax:</p>
|
||
<ul>
|
||
<li>multiple paragraphs</li>
|
||
<li>bullet point lists</li>
|
||
<li><em>emphasized</em>, <strong>bold</strong> and even <strong><em>bold emphasized</em></strong> text</li>
|
||
<li><a href="https://example.com" rel="external" target="_self">links</a></li>
|
||
<li>etc.</li>
|
||
</ul>
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-plaintext" data-lang="plaintext"><span class="line"><span class="cl">...and even source code</span></span></code></pre></div><blockquote>
|
||
<p>the possibilities are endless (almost - including other shortcodes may or may not work)</p>
|
||
</blockquote>
|
||
</div>
|
||
</div>
|
||
<h4 id="note">Note</h4>
|
||
<div class="highlight wrap-code"><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">notice</span> <span class="nx">style</span><span class="p">=</span><span class="s">"note"</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nx">A</span> <span class="o">**</span><span class="nx">notice</span><span class="o">**</span> <span class="nx">disclaimer</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">notice</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div>
|
||
<div class="box notices cstyle note">
|
||
<div class="box-label"><i class="fa-fw fas fa-exclamation-circle"></i> Note</div>
|
||
<div class="box-content">
|
||
|
||
<p>A <strong>notice</strong> disclaimer</p>
|
||
</div>
|
||
</div>
|
||
<h4 id="tip">Tip</h4>
|
||
<div class="highlight wrap-code"><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">notice</span> <span class="nx">style</span><span class="p">=</span><span class="s">"tip"</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nx">A</span> <span class="o">**</span><span class="nx">tip</span><span class="o">**</span> <span class="nx">disclaimer</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">notice</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div>
|
||
<div class="box notices cstyle tip">
|
||
<div class="box-label"><i class="fa-fw fas fa-lightbulb"></i> Tip</div>
|
||
<div class="box-content">
|
||
|
||
<p>A <strong>tip</strong> disclaimer</p>
|
||
</div>
|
||
</div>
|
||
<h4 id="warning">Warning</h4>
|
||
<div class="highlight wrap-code"><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">notice</span> <span class="nx">style</span><span class="p">=</span><span class="s">"warning"</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nx">A</span> <span class="o">**</span><span class="nx">warning</span><span class="o">**</span> <span class="nx">disclaimer</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">notice</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div>
|
||
<div class="box notices cstyle warning">
|
||
<div class="box-label"><i class="fa-fw fas fa-exclamation-triangle"></i> Warning</div>
|
||
<div class="box-content">
|
||
|
||
<p>A <strong>warning</strong> disclaimer</p>
|
||
</div>
|
||
</div>
|
||
<h4 id="warning-with-non-default-title-and-icon">Warning with Non-Default Title and Icon</h4>
|
||
<div class="highlight wrap-code"><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">notice</span> <span class="nx">style</span><span class="p">=</span><span class="s">"warning"</span> <span class="nx">title</span><span class="p">=</span><span class="s">"Here are dragons"</span> <span class="nx">icon</span><span class="p">=</span><span class="s">"dragon"</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nx">A</span> <span class="o">**</span><span class="nx">warning</span><span class="o">**</span> <span class="nx">disclaimer</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">notice</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div>
|
||
<div class="box notices cstyle warning">
|
||
<div class="box-label"><i class="fa-fw fas fa-dragon"></i> Here are dragons</div>
|
||
<div class="box-content">
|
||
|
||
<p>A <strong>warning</strong> disclaimer</p>
|
||
</div>
|
||
</div>
|
||
<h4 id="warning-without-a-title-and-icon">Warning without a Title and Icon</h4>
|
||
<div class="highlight wrap-code"><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">notice</span> <span class="nx">style</span><span class="p">=</span><span class="s">"warning"</span> <span class="nx">title</span><span class="p">=</span><span class="s">" "</span> <span class="nx">icon</span><span class="p">=</span><span class="s">" "</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nx">A</span> <span class="o">**</span><span class="nx">warning</span><span class="o">**</span> <span class="nx">disclaimer</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">notice</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div>
|
||
<div class="box notices cstyle warning">
|
||
<div class="box-label"></div>
|
||
<div class="box-content">
|
||
|
||
<p>A <strong>warning</strong> disclaimer</p>
|
||
</div>
|
||
</div>
|
||
<h3 id="by-brand-colors">By Brand Colors</h3>
|
||
<h4 id="primary-with-title-only">Primary with Title only</h4>
|
||
<div class="highlight wrap-code"><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">notice</span> <span class="nx">style</span><span class="p">=</span><span class="s">"primary"</span> <span class="nx">title</span><span class="p">=</span><span class="s">"Primary"</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nx">A</span> <span class="o">**</span><span class="nx">primary</span><span class="o">**</span> <span class="nx">disclaimer</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">notice</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div>
|
||
<div class="box notices cstyle primary">
|
||
<div class="box-label">Primary</div>
|
||
<div class="box-content">
|
||
|
||
<p>A <strong>primary</strong> disclaimer</p>
|
||
</div>
|
||
</div>
|
||
<h4 id="secondary-with-icon-only">Secondary with Icon only</h4>
|
||
<div class="highlight wrap-code"><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">notice</span> <span class="nx">style</span><span class="p">=</span><span class="s">"secondary"</span> <span class="nx">icon</span><span class="p">=</span><span class="s">"stopwatch"</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nx">A</span> <span class="o">**</span><span class="nx">secondary</span><span class="o">**</span> <span class="nx">disclaimer</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">notice</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div>
|
||
<div class="box notices cstyle secondary">
|
||
<div class="box-label"><i class="fa-fw fas fa-stopwatch"></i></div>
|
||
<div class="box-content">
|
||
|
||
<p>A <strong>secondary</strong> disclaimer</p>
|
||
</div>
|
||
</div>
|
||
<h4 id="accent">Accent</h4>
|
||
<div class="highlight wrap-code"><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">notice</span> <span class="nx">style</span><span class="p">=</span><span class="s">"accent"</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nx">An</span> <span class="o">**</span><span class="nx">accent</span><span class="o">**</span> <span class="nx">disclaimer</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">notice</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div>
|
||
<div class="box notices cstyle accent">
|
||
<div class="box-label"></div>
|
||
<div class="box-content">
|
||
|
||
<p>An <strong>accent</strong> disclaimer</p>
|
||
</div>
|
||
</div>
|
||
<h3 id="by-color">By Color</h3>
|
||
<h4 id="blue-without-a-title-and-icon">Blue without a Title and Icon</h4>
|
||
<div class="highlight wrap-code"><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">notice</span> <span class="nx">style</span><span class="p">=</span><span class="s">"blue"</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nx">A</span> <span class="o">**</span><span class="nx">blue</span><span class="o">**</span> <span class="nx">disclaimer</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">notice</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div>
|
||
<div class="box notices cstyle blue">
|
||
<div class="box-label"></div>
|
||
<div class="box-content">
|
||
|
||
<p>A <strong>blue</strong> disclaimer</p>
|
||
</div>
|
||
</div>
|
||
<h4 id="green-with-title-only">Green with Title only</h4>
|
||
<div class="highlight wrap-code"><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">notice</span> <span class="nx">style</span><span class="p">=</span><span class="s">"green"</span> <span class="nx">title</span><span class="p">=</span><span class="s">"Green"</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nx">A</span> <span class="o">**</span><span class="nx">green</span><span class="o">**</span> <span class="nx">disclaimer</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">notice</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div>
|
||
<div class="box notices cstyle green">
|
||
<div class="box-label">Green</div>
|
||
<div class="box-content">
|
||
|
||
<p>A <strong>green</strong> disclaimer</p>
|
||
</div>
|
||
</div>
|
||
<h4 id="grey-with-icon-only">Grey with Icon only</h4>
|
||
<div class="highlight wrap-code"><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">notice</span> <span class="nx">style</span><span class="p">=</span><span class="s">"grey"</span> <span class="nx">icon</span><span class="p">=</span><span class="s">"bug"</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nx">A</span> <span class="o">**</span><span class="nx">grey</span><span class="o">**</span> <span class="nx">disclaimer</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">notice</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div>
|
||
<div class="box notices cstyle grey">
|
||
<div class="box-label"><i class="fa-fw fas fa-bug"></i></div>
|
||
<div class="box-content">
|
||
|
||
<p>A <strong>grey</strong> disclaimer</p>
|
||
</div>
|
||
</div>
|
||
<h4 id="orange-with-title-and-icon">Orange with Title and Icon</h4>
|
||
<div class="highlight wrap-code"><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">notice</span> <span class="nx">style</span><span class="p">=</span><span class="s">"orange"</span> <span class="nx">title</span><span class="p">=</span><span class="s">"Orange"</span> <span class="nx">icon</span><span class="p">=</span><span class="s">"bug"</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nx">A</span> <span class="o">**</span><span class="nx">orange</span><span class="o">**</span> <span class="nx">disclaimer</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">notice</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div>
|
||
<div class="box notices cstyle orange">
|
||
<div class="box-label"><i class="fa-fw fas fa-bug"></i> Orange</div>
|
||
<div class="box-content">
|
||
|
||
<p>A <strong>orange</strong> disclaimer</p>
|
||
</div>
|
||
</div>
|
||
<h4 id="red-without-a-title-and-icon">Red without a Title and Icon</h4>
|
||
<div class="highlight wrap-code"><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">notice</span> <span class="nx">style</span><span class="p">=</span><span class="s">"red"</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nx">A</span> <span class="o">**</span><span class="nx">red</span><span class="o">**</span> <span class="nx">disclaimer</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">notice</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div>
|
||
<div class="box notices cstyle red">
|
||
<div class="box-label"></div>
|
||
<div class="box-content">
|
||
|
||
<p>A <strong>red</strong> disclaimer</p>
|
||
</div>
|
||
</div>
|
||
<h3 id="by-special-color">By Special Color</h3>
|
||
<h4 id="default-with-positional-parameter">Default with Positional Parameter</h4>
|
||
<div class="highlight wrap-code"><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">notice</span> <span class="k">default</span> <span class="s">"Pay Attention to this Note!"</span> <span class="s">"skull-crossbones"</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nx">Some</span> <span class="nx">serious</span> <span class="nx">information</span><span class="p">.</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">notice</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div>
|
||
<div class="box notices cstyle default">
|
||
<div class="box-label"><i class="fa-fw fas fa-skull-crossbones"></i> Pay Attention to this Note!</div>
|
||
<div class="box-content">
|
||
|
||
<p>Some serious information.</p>
|
||
</div>
|
||
</div>
|
||
<h4 id="transparent-with-title-and-icon">Transparent with Title and Icon</h4>
|
||
<div class="highlight wrap-code"><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">notice</span> <span class="nx">style</span><span class="p">=</span><span class="s">"transparent"</span> <span class="nx">title</span><span class="p">=</span><span class="s">"Pay Attention to this Note!"</span> <span class="nx">icon</span><span class="p">=</span><span class="s">"skull-crossbones"</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nx">Some</span> <span class="nx">serious</span> <span class="nx">information</span><span class="p">.</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">notice</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div>
|
||
<div class="box notices cstyle transparent">
|
||
<div class="box-label"><i class="fa-fw fas fa-skull-crossbones"></i> Pay Attention to this Note!</div>
|
||
<div class="box-content">
|
||
|
||
<p>Some serious information.</p>
|
||
</div>
|
||
</div>
|
||
<h3 id="with-user-defined-color-font-awesome-brand-icon-and-markdown-title">With User-Defined Color, Font Awesome Brand Icon and Markdown Title</h3>
|
||
<div class="highlight wrap-code"><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">notice</span> <span class="nx">color</span><span class="p">=</span><span class="s">"fuchsia"</span> <span class="nx">title</span><span class="p">=</span><span class="s">"**Hugo**"</span> <span class="nx">icon</span><span class="p">=</span><span class="s">"fa-fw fab fa-hackerrank"</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nx">Victor</span><span class="err">?</span> <span class="nx">Is</span> <span class="nx">it</span> <span class="nx">you</span><span class="err">?</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="o">/</span><span class="nx">notice</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div>
|
||
<div class="box notices cstyle default" style="--VARIABLE-BOX-color: fuchsia;">
|
||
<div class="box-label"><i class="fa-fw fab fa-hackerrank"></i> <strong>Hugo</strong></div>
|
||
<div class="box-content">
|
||
|
||
<p>Victor? Is it you?</p>
|
||
</div>
|
||
</div>
|
||
|
||
<footer class="footline">
|
||
</footer>
|
||
</article>
|
||
|
||
<article class="default">
|
||
<header class="headline">
|
||
</header>
|
||
|
||
<h1 id="openapi">OpenAPI</h1>
|
||
|
||
<p>The <code>openapi</code> shortcode uses the <a href="https://github.com/swagger-api/swagger-ui" rel="external" target="_self">Swagger UI</a> library to display your OpenAPI / Swagger specifications.</p>
|
||
<h2 id="usage">Usage</h2>
|
||
<p>While the examples are using shortcodes with named parameter you are free to also call this shortcode from your own partials.</p>
|
||
|
||
<div class="tab-panel" data-tab-group="shortcode-parameter">
|
||
<div class="tab-nav">
|
||
<div class="tab-nav-title">​</div>
|
||
<button
|
||
data-tab-item="shortcode"
|
||
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
|
||
onclick="switchTab('shortcode-parameter','shortcode')"
|
||
>
|
||
<span class="tab-nav-text">shortcode</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="partial"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('shortcode-parameter','partial')"
|
||
>
|
||
<span class="tab-nav-text">partial</span>
|
||
</button>
|
||
</div>
|
||
<div class="tab-content-container">
|
||
<div
|
||
data-tab-item="shortcode"
|
||
class="tab-content tab-panel-style cstyle initial active">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><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">openapi</span> <span class="nx">src</span><span class="p">=</span><span class="s">"https://petstore3.openapi.io/api/v3/openapi.json"</span> <span class="p">>}}</span></span></span></code></pre></div></div>
|
||
</div>
|
||
<div
|
||
data-tab-item="partial"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><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/openapi.html"</span> <span class="p">(</span><span class="nx">dict</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"page"</span> <span class="p">.</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"src"</span> <span class="s">"https://petstore3.openapi.io/api/v3/openapi.json"</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">)}}</span></span></span></code></pre></div></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<h3 id="parameter">Parameter</h3>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Name</th>
|
||
<th>Default</th>
|
||
<th>Notes</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td><strong>src</strong></td>
|
||
<td><em><empty></em></td>
|
||
<td>The URL to the OpenAPI specification file. This can be relative to the URL of your page if it is a leaf or branch bundle.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
|
||
<div class="box notices cstyle note">
|
||
<div class="box-label"><i class="fa-fw fas fa-exclamation-circle"></i> Note</div>
|
||
<div class="box-content">
|
||
|
||
<p>If you want to print out (or generate a PDF) from your OpenAPI documentation, don’t initiate printing directly from the page because the elements are optimized for interactive usage in a browser.</p>
|
||
<p>Instead, open the <a href="/hugo-theme-relearn/basics/customization/index.html#activate-print-support">print preview</a> in your browser and initiate printing from that page. This page is optimized for reading and expands most of the available sections.</p>
|
||
</div>
|
||
</div>
|
||
<h2 id="example">Example</h2>
|
||
<h3 id="using-local-file">Using Local File</h3>
|
||
<div class="highlight wrap-code"><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">openapi</span> <span class="nx">src</span><span class="p">=</span><span class="s">"petstore.json"</span> <span class="p">>}}</span></span></span></code></pre></div>
|
||
<div class="sc-openapi-wrapper is-loading helper-loading-container">
|
||
<div
|
||
class="sc-openapi-container"
|
||
id="R-openapi-5226ffa5f03572eb29088757956127d4"
|
||
data-openapi-url="petstore.json"
|
||
data-openapi-spec="{
|
||
"openapi": "3.0.2",
|
||
"info": {
|
||
"title": "Swagger Petstore - OpenAPI 3.0",
|
||
"description": "This is a sample Pet Store Server based on the OpenAPI 3.0 specification. You can find out more about\nSwagger at [http://swagger.io](http://swagger.io). In the third iteration of the pet store, we've switched to the design first approach!\nYou can now help us improve the API whether it's by making changes to the definition itself or to the code.\nThat way, with time, we can improve the API in general, and expose some of the new features in OAS3.\n\nSome useful links:\n- [The Pet Store repository](https://github.com/swagger-api/swagger-petstore)\n- [The source API definition for the Pet Store](https://github.com/swagger-api/swagger-petstore/blob/master/src/main/resources/openapi.yaml)",
|
||
"termsOfService": "http://swagger.io/terms/",
|
||
"contact": {
|
||
"email": "apiteam@swagger.io"
|
||
},
|
||
"license": {
|
||
"name": "Apache 2.0",
|
||
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
|
||
},
|
||
"version": "1.0.18"
|
||
},
|
||
"externalDocs": {
|
||
"description": "Find out more about Swagger",
|
||
"url": "http://swagger.io"
|
||
},
|
||
"servers": [
|
||
{
|
||
"url": "/api/v3"
|
||
}
|
||
],
|
||
"tags": [
|
||
{
|
||
"name": "pet",
|
||
"description": "Everything about your Pets",
|
||
"externalDocs": {
|
||
"description": "Find out more",
|
||
"url": "http://swagger.io"
|
||
}
|
||
},
|
||
{
|
||
"name": "store",
|
||
"description": "Access to Petstore orders",
|
||
"externalDocs": {
|
||
"description": "Find out more about our store",
|
||
"url": "http://swagger.io"
|
||
}
|
||
},
|
||
{
|
||
"name": "user",
|
||
"description": "Operations about user"
|
||
}
|
||
],
|
||
"paths": {
|
||
"/pet": {
|
||
"put": {
|
||
"tags": [
|
||
"pet"
|
||
],
|
||
"summary": "Update an existing pet",
|
||
"description": "Update an existing pet by Id",
|
||
"operationId": "updatePet",
|
||
"requestBody": {
|
||
"description": "Update an existent pet in the store",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/Pet"
|
||
}
|
||
},
|
||
"application/xml": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/Pet"
|
||
}
|
||
},
|
||
"application/x-www-form-urlencoded": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/Pet"
|
||
}
|
||
}
|
||
},
|
||
"required": true
|
||
},
|
||
"responses": {
|
||
"200": {
|
||
"description": "Successful operation",
|
||
"content": {
|
||
"application/xml": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/Pet"
|
||
}
|
||
},
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/Pet"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Invalid ID supplied"
|
||
},
|
||
"404": {
|
||
"description": "Pet not found"
|
||
},
|
||
"405": {
|
||
"description": "Validation exception"
|
||
}
|
||
},
|
||
"security": [
|
||
{
|
||
"petstore_auth": [
|
||
"write:pets",
|
||
"read:pets"
|
||
]
|
||
}
|
||
]
|
||
},
|
||
"post": {
|
||
"tags": [
|
||
"pet"
|
||
],
|
||
"summary": "Add a new pet to the store",
|
||
"description": "Add a new pet to the store",
|
||
"operationId": "addPet",
|
||
"requestBody": {
|
||
"description": "Create a new pet in the store",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/Pet"
|
||
}
|
||
},
|
||
"application/xml": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/Pet"
|
||
}
|
||
},
|
||
"application/x-www-form-urlencoded": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/Pet"
|
||
}
|
||
}
|
||
},
|
||
"required": true
|
||
},
|
||
"responses": {
|
||
"200": {
|
||
"description": "Successful operation",
|
||
"content": {
|
||
"application/xml": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/Pet"
|
||
}
|
||
},
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/Pet"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"405": {
|
||
"description": "Invalid input"
|
||
}
|
||
},
|
||
"security": [
|
||
{
|
||
"petstore_auth": [
|
||
"write:pets",
|
||
"read:pets"
|
||
]
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"/pet/findByStatus": {
|
||
"get": {
|
||
"tags": [
|
||
"pet"
|
||
],
|
||
"summary": "Finds Pets by status",
|
||
"description": "Multiple status values can be provided with comma separated strings",
|
||
"operationId": "findPetsByStatus",
|
||
"parameters": [
|
||
{
|
||
"name": "status",
|
||
"in": "query",
|
||
"description": "Status values that need to be considered for filter",
|
||
"required": false,
|
||
"explode": true,
|
||
"schema": {
|
||
"type": "string",
|
||
"default": "available",
|
||
"enum": [
|
||
"available",
|
||
"pending",
|
||
"sold"
|
||
]
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "successful operation",
|
||
"content": {
|
||
"application/xml": {
|
||
"schema": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/components/schemas/Pet"
|
||
}
|
||
}
|
||
},
|
||
"application/json": {
|
||
"schema": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/components/schemas/Pet"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Invalid status value"
|
||
}
|
||
},
|
||
"security": [
|
||
{
|
||
"petstore_auth": [
|
||
"write:pets",
|
||
"read:pets"
|
||
]
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"/pet/findByTags": {
|
||
"get": {
|
||
"tags": [
|
||
"pet"
|
||
],
|
||
"summary": "Finds Pets by tags",
|
||
"description": "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
|
||
"operationId": "findPetsByTags",
|
||
"parameters": [
|
||
{
|
||
"name": "tags",
|
||
"in": "query",
|
||
"description": "Tags to filter by",
|
||
"required": false,
|
||
"explode": true,
|
||
"schema": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "successful operation",
|
||
"content": {
|
||
"application/xml": {
|
||
"schema": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/components/schemas/Pet"
|
||
}
|
||
}
|
||
},
|
||
"application/json": {
|
||
"schema": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/components/schemas/Pet"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Invalid tag value"
|
||
}
|
||
},
|
||
"security": [
|
||
{
|
||
"petstore_auth": [
|
||
"write:pets",
|
||
"read:pets"
|
||
]
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"/pet/{petId}": {
|
||
"get": {
|
||
"tags": [
|
||
"pet"
|
||
],
|
||
"summary": "Find pet by ID",
|
||
"description": "Returns a single pet",
|
||
"operationId": "getPetById",
|
||
"parameters": [
|
||
{
|
||
"name": "petId",
|
||
"in": "path",
|
||
"description": "ID of pet to return",
|
||
"required": true,
|
||
"schema": {
|
||
"type": "integer",
|
||
"format": "int64"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "successful operation",
|
||
"content": {
|
||
"application/xml": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/Pet"
|
||
}
|
||
},
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/Pet"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Invalid ID supplied"
|
||
},
|
||
"404": {
|
||
"description": "Pet not found"
|
||
}
|
||
},
|
||
"security": [
|
||
{
|
||
"api_key": []
|
||
},
|
||
{
|
||
"petstore_auth": [
|
||
"write:pets",
|
||
"read:pets"
|
||
]
|
||
}
|
||
]
|
||
},
|
||
"post": {
|
||
"tags": [
|
||
"pet"
|
||
],
|
||
"summary": "Updates a pet in the store with form data",
|
||
"description": "",
|
||
"operationId": "updatePetWithForm",
|
||
"parameters": [
|
||
{
|
||
"name": "petId",
|
||
"in": "path",
|
||
"description": "ID of pet that needs to be updated",
|
||
"required": true,
|
||
"schema": {
|
||
"type": "integer",
|
||
"format": "int64"
|
||
}
|
||
},
|
||
{
|
||
"name": "name",
|
||
"in": "query",
|
||
"description": "Name of pet that needs to be updated",
|
||
"schema": {
|
||
"type": "string"
|
||
}
|
||
},
|
||
{
|
||
"name": "status",
|
||
"in": "query",
|
||
"description": "Status of pet that needs to be updated",
|
||
"schema": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"405": {
|
||
"description": "Invalid input"
|
||
}
|
||
},
|
||
"security": [
|
||
{
|
||
"petstore_auth": [
|
||
"write:pets",
|
||
"read:pets"
|
||
]
|
||
}
|
||
]
|
||
},
|
||
"delete": {
|
||
"tags": [
|
||
"pet"
|
||
],
|
||
"summary": "Deletes a pet",
|
||
"description": "",
|
||
"operationId": "deletePet",
|
||
"parameters": [
|
||
{
|
||
"name": "api_key",
|
||
"in": "header",
|
||
"description": "",
|
||
"required": false,
|
||
"schema": {
|
||
"type": "string"
|
||
}
|
||
},
|
||
{
|
||
"name": "petId",
|
||
"in": "path",
|
||
"description": "Pet id to delete",
|
||
"required": true,
|
||
"schema": {
|
||
"type": "integer",
|
||
"format": "int64"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"400": {
|
||
"description": "Invalid pet value"
|
||
}
|
||
},
|
||
"security": [
|
||
{
|
||
"petstore_auth": [
|
||
"write:pets",
|
||
"read:pets"
|
||
]
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"/pet/{petId}/uploadImage": {
|
||
"post": {
|
||
"tags": [
|
||
"pet"
|
||
],
|
||
"summary": "uploads an image",
|
||
"description": "",
|
||
"operationId": "uploadFile",
|
||
"parameters": [
|
||
{
|
||
"name": "petId",
|
||
"in": "path",
|
||
"description": "ID of pet to update",
|
||
"required": true,
|
||
"schema": {
|
||
"type": "integer",
|
||
"format": "int64"
|
||
}
|
||
},
|
||
{
|
||
"name": "additionalMetadata",
|
||
"in": "query",
|
||
"description": "Additional Metadata",
|
||
"required": false,
|
||
"schema": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
],
|
||
"requestBody": {
|
||
"content": {
|
||
"application/octet-stream": {
|
||
"schema": {
|
||
"type": "string",
|
||
"format": "binary"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"responses": {
|
||
"200": {
|
||
"description": "successful operation",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/ApiResponse"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"security": [
|
||
{
|
||
"petstore_auth": [
|
||
"write:pets",
|
||
"read:pets"
|
||
]
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"/store/inventory": {
|
||
"get": {
|
||
"tags": [
|
||
"store"
|
||
],
|
||
"summary": "Returns pet inventories by status",
|
||
"description": "Returns a map of status codes to quantities",
|
||
"operationId": "getInventory",
|
||
"responses": {
|
||
"200": {
|
||
"description": "successful operation",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"type": "object",
|
||
"additionalProperties": {
|
||
"type": "integer",
|
||
"format": "int32"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"security": [
|
||
{
|
||
"api_key": []
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"/store/order": {
|
||
"post": {
|
||
"tags": [
|
||
"store"
|
||
],
|
||
"summary": "Place an order for a pet",
|
||
"description": "Place a new order in the store",
|
||
"operationId": "placeOrder",
|
||
"requestBody": {
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/Order"
|
||
}
|
||
},
|
||
"application/xml": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/Order"
|
||
}
|
||
},
|
||
"application/x-www-form-urlencoded": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/Order"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"responses": {
|
||
"200": {
|
||
"description": "successful operation",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/Order"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"405": {
|
||
"description": "Invalid input"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/store/order/{orderId}": {
|
||
"get": {
|
||
"tags": [
|
||
"store"
|
||
],
|
||
"summary": "Find purchase order by ID",
|
||
"description": "For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions.",
|
||
"operationId": "getOrderById",
|
||
"parameters": [
|
||
{
|
||
"name": "orderId",
|
||
"in": "path",
|
||
"description": "ID of order that needs to be fetched",
|
||
"required": true,
|
||
"schema": {
|
||
"type": "integer",
|
||
"format": "int64"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "successful operation",
|
||
"content": {
|
||
"application/xml": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/Order"
|
||
}
|
||
},
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/Order"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Invalid ID supplied"
|
||
},
|
||
"404": {
|
||
"description": "Order not found"
|
||
}
|
||
}
|
||
},
|
||
"delete": {
|
||
"tags": [
|
||
"store"
|
||
],
|
||
"summary": "Delete purchase order by ID",
|
||
"description": "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors",
|
||
"operationId": "deleteOrder",
|
||
"parameters": [
|
||
{
|
||
"name": "orderId",
|
||
"in": "path",
|
||
"description": "ID of the order that needs to be deleted",
|
||
"required": true,
|
||
"schema": {
|
||
"type": "integer",
|
||
"format": "int64"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"400": {
|
||
"description": "Invalid ID supplied"
|
||
},
|
||
"404": {
|
||
"description": "Order not found"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/user": {
|
||
"post": {
|
||
"tags": [
|
||
"user"
|
||
],
|
||
"summary": "Create user",
|
||
"description": "This can only be done by the logged in user.",
|
||
"operationId": "createUser",
|
||
"requestBody": {
|
||
"description": "Created user object",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/User"
|
||
}
|
||
},
|
||
"application/xml": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/User"
|
||
}
|
||
},
|
||
"application/x-www-form-urlencoded": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/User"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"responses": {
|
||
"default": {
|
||
"description": "successful operation",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/User"
|
||
}
|
||
},
|
||
"application/xml": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/User"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/user/createWithList": {
|
||
"post": {
|
||
"tags": [
|
||
"user"
|
||
],
|
||
"summary": "Creates list of users with given input array",
|
||
"description": "Creates list of users with given input array",
|
||
"operationId": "createUsersWithListInput",
|
||
"requestBody": {
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/components/schemas/User"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"responses": {
|
||
"200": {
|
||
"description": "Successful operation",
|
||
"content": {
|
||
"application/xml": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/User"
|
||
}
|
||
},
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/User"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"default": {
|
||
"description": "successful operation"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/user/login": {
|
||
"get": {
|
||
"tags": [
|
||
"user"
|
||
],
|
||
"summary": "Logs user into the system",
|
||
"description": "",
|
||
"operationId": "loginUser",
|
||
"parameters": [
|
||
{
|
||
"name": "username",
|
||
"in": "query",
|
||
"description": "The user name for login",
|
||
"required": false,
|
||
"schema": {
|
||
"type": "string"
|
||
}
|
||
},
|
||
{
|
||
"name": "password",
|
||
"in": "query",
|
||
"description": "The password for login in clear text",
|
||
"required": false,
|
||
"schema": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "successful operation",
|
||
"headers": {
|
||
"X-Rate-Limit": {
|
||
"description": "calls per hour allowed by the user",
|
||
"schema": {
|
||
"type": "integer",
|
||
"format": "int32"
|
||
}
|
||
},
|
||
"X-Expires-After": {
|
||
"description": "date in UTC when token expires",
|
||
"schema": {
|
||
"type": "string",
|
||
"format": "date-time"
|
||
}
|
||
}
|
||
},
|
||
"content": {
|
||
"application/xml": {
|
||
"schema": {
|
||
"type": "string"
|
||
}
|
||
},
|
||
"application/json": {
|
||
"schema": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Invalid username/password supplied"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/user/logout": {
|
||
"get": {
|
||
"tags": [
|
||
"user"
|
||
],
|
||
"summary": "Logs out current logged in user session",
|
||
"description": "",
|
||
"operationId": "logoutUser",
|
||
"parameters": [],
|
||
"responses": {
|
||
"default": {
|
||
"description": "successful operation"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/user/{username}": {
|
||
"get": {
|
||
"tags": [
|
||
"user"
|
||
],
|
||
"summary": "Get user by user name",
|
||
"description": "",
|
||
"operationId": "getUserByName",
|
||
"parameters": [
|
||
{
|
||
"name": "username",
|
||
"in": "path",
|
||
"description": "The name that needs to be fetched. Use user1 for testing. ",
|
||
"required": true,
|
||
"schema": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "successful operation",
|
||
"content": {
|
||
"application/xml": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/User"
|
||
}
|
||
},
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/User"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Invalid username supplied"
|
||
},
|
||
"404": {
|
||
"description": "User not found"
|
||
}
|
||
}
|
||
},
|
||
"put": {
|
||
"tags": [
|
||
"user"
|
||
],
|
||
"summary": "Update user",
|
||
"description": "This can only be done by the logged in user.",
|
||
"operationId": "updateUser",
|
||
"parameters": [
|
||
{
|
||
"name": "username",
|
||
"in": "path",
|
||
"description": "name that needs to be updated",
|
||
"required": true,
|
||
"schema": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
],
|
||
"requestBody": {
|
||
"description": "Update an existent user in the store",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/User"
|
||
}
|
||
},
|
||
"application/xml": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/User"
|
||
}
|
||
},
|
||
"application/x-www-form-urlencoded": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/User"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"responses": {
|
||
"default": {
|
||
"description": "successful operation"
|
||
}
|
||
}
|
||
},
|
||
"delete": {
|
||
"tags": [
|
||
"user"
|
||
],
|
||
"summary": "Delete user",
|
||
"description": "This can only be done by the logged in user.",
|
||
"operationId": "deleteUser",
|
||
"parameters": [
|
||
{
|
||
"name": "username",
|
||
"in": "path",
|
||
"description": "The name that needs to be deleted",
|
||
"required": true,
|
||
"schema": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"400": {
|
||
"description": "Invalid username supplied"
|
||
},
|
||
"404": {
|
||
"description": "User not found"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"components": {
|
||
"schemas": {
|
||
"Order": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "integer",
|
||
"format": "int64",
|
||
"example": 10
|
||
},
|
||
"petId": {
|
||
"type": "integer",
|
||
"format": "int64",
|
||
"example": 198772
|
||
},
|
||
"quantity": {
|
||
"type": "integer",
|
||
"format": "int32",
|
||
"example": 7
|
||
},
|
||
"shipDate": {
|
||
"type": "string",
|
||
"format": "date-time"
|
||
},
|
||
"status": {
|
||
"type": "string",
|
||
"description": "Order Status",
|
||
"example": "approved",
|
||
"enum": [
|
||
"placed",
|
||
"approved",
|
||
"delivered"
|
||
]
|
||
},
|
||
"complete": {
|
||
"type": "boolean"
|
||
}
|
||
},
|
||
"xml": {
|
||
"name": "order"
|
||
}
|
||
},
|
||
"petId": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "integer",
|
||
"format": "int64",
|
||
"example": 10
|
||
},
|
||
"petId": {
|
||
"type": "integer",
|
||
"format": "int64",
|
||
"example": 198772
|
||
},
|
||
"quantity": {
|
||
"type": "integer",
|
||
"format": "int32",
|
||
"example": 7
|
||
},
|
||
"shipDate": {
|
||
"type": "string",
|
||
"format": "date-time"
|
||
},
|
||
"status": {
|
||
"type": "string",
|
||
"description": "Order Status",
|
||
"example": "approved",
|
||
"enum": [
|
||
"placed",
|
||
"approved",
|
||
"delivered"
|
||
]
|
||
},
|
||
"complete": {
|
||
"type": "boolean"
|
||
}
|
||
},
|
||
"xml": {
|
||
"name": "order"
|
||
}
|
||
},
|
||
"quantity": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "integer",
|
||
"format": "int64",
|
||
"example": 10
|
||
},
|
||
"petId": {
|
||
"type": "integer",
|
||
"format": "int64",
|
||
"example": 198772
|
||
},
|
||
"quantity": {
|
||
"type": "integer",
|
||
"format": "int32",
|
||
"example": 7
|
||
},
|
||
"shipDate": {
|
||
"type": "string",
|
||
"format": "date-time"
|
||
},
|
||
"status": {
|
||
"type": "string",
|
||
"description": "Order Status",
|
||
"example": "approved",
|
||
"enum": [
|
||
"placed",
|
||
"approved",
|
||
"delivered"
|
||
]
|
||
},
|
||
"complete": {
|
||
"type": "boolean"
|
||
}
|
||
},
|
||
"xml": {
|
||
"name": "order"
|
||
}
|
||
},
|
||
"shipDate": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "integer",
|
||
"format": "int64",
|
||
"example": 10
|
||
},
|
||
"petId": {
|
||
"type": "integer",
|
||
"format": "int64",
|
||
"example": 198772
|
||
},
|
||
"quantity": {
|
||
"type": "integer",
|
||
"format": "int32",
|
||
"example": 7
|
||
},
|
||
"shipDate": {
|
||
"type": "string",
|
||
"format": "date-time"
|
||
},
|
||
"status": {
|
||
"type": "string",
|
||
"description": "Order Status",
|
||
"example": "approved",
|
||
"enum": [
|
||
"placed",
|
||
"approved",
|
||
"delivered"
|
||
]
|
||
},
|
||
"complete": {
|
||
"type": "boolean"
|
||
}
|
||
},
|
||
"xml": {
|
||
"name": "order"
|
||
}
|
||
},
|
||
"status": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "integer",
|
||
"format": "int64",
|
||
"example": 10
|
||
},
|
||
"petId": {
|
||
"type": "integer",
|
||
"format": "int64",
|
||
"example": 198772
|
||
},
|
||
"quantity": {
|
||
"type": "integer",
|
||
"format": "int32",
|
||
"example": 7
|
||
},
|
||
"shipDate": {
|
||
"type": "string",
|
||
"format": "date-time"
|
||
},
|
||
"status": {
|
||
"type": "string",
|
||
"description": "Order Status",
|
||
"example": "approved",
|
||
"enum": [
|
||
"placed",
|
||
"approved",
|
||
"delivered"
|
||
]
|
||
},
|
||
"complete": {
|
||
"type": "boolean"
|
||
}
|
||
},
|
||
"xml": {
|
||
"name": "order"
|
||
}
|
||
},
|
||
"complete": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "integer",
|
||
"format": "int64",
|
||
"example": 10
|
||
},
|
||
"petId": {
|
||
"type": "integer",
|
||
"format": "int64",
|
||
"example": 198772
|
||
},
|
||
"quantity": {
|
||
"type": "integer",
|
||
"format": "int32",
|
||
"example": 7
|
||
},
|
||
"shipDate": {
|
||
"type": "string",
|
||
"format": "date-time"
|
||
},
|
||
"status": {
|
||
"type": "string",
|
||
"description": "Order Status",
|
||
"example": "approved",
|
||
"enum": [
|
||
"placed",
|
||
"approved",
|
||
"delivered"
|
||
]
|
||
},
|
||
"complete": {
|
||
"type": "boolean"
|
||
}
|
||
},
|
||
"xml": {
|
||
"name": "order"
|
||
}
|
||
}
|
||
},
|
||
"xml": {
|
||
"name": "order"
|
||
}
|
||
},
|
||
"Customer": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "integer",
|
||
"format": "int64",
|
||
"example": 100000
|
||
},
|
||
"username": {
|
||
"type": "string",
|
||
"example": "fehguy"
|
||
},
|
||
"address": {
|
||
"type": "array",
|
||
"xml": {
|
||
"name": "addresses",
|
||
"wrapped": true
|
||
},
|
||
"items": {
|
||
"$ref": "#/components/schemas/Address"
|
||
}
|
||
}
|
||
},
|
||
"xml": {
|
||
"name": "customer"
|
||
}
|
||
},
|
||
"username": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "integer",
|
||
"format": "int64",
|
||
"example": 100000
|
||
},
|
||
"username": {
|
||
"type": "string",
|
||
"example": "fehguy"
|
||
},
|
||
"address": {
|
||
"type": "array",
|
||
"xml": {
|
||
"name": "addresses",
|
||
"wrapped": true
|
||
},
|
||
"items": {
|
||
"$ref": "#/components/schemas/Address"
|
||
}
|
||
}
|
||
},
|
||
"xml": {
|
||
"name": "customer"
|
||
}
|
||
},
|
||
"address": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "integer",
|
||
"format": "int64",
|
||
"example": 100000
|
||
},
|
||
"username": {
|
||
"type": "string",
|
||
"example": "fehguy"
|
||
},
|
||
"address": {
|
||
"type": "array",
|
||
"xml": {
|
||
"name": "addresses",
|
||
"wrapped": true
|
||
},
|
||
"items": {
|
||
"$ref": "#/components/schemas/Address"
|
||
}
|
||
}
|
||
},
|
||
"xml": {
|
||
"name": "customer"
|
||
}
|
||
}
|
||
},
|
||
"xml": {
|
||
"name": "customer"
|
||
}
|
||
},
|
||
"Address": {
|
||
"type": "object",
|
||
"properties": {
|
||
"street": {
|
||
"type": "object",
|
||
"properties": {
|
||
"street": {
|
||
"type": "string",
|
||
"example": "437 Lytton"
|
||
},
|
||
"city": {
|
||
"type": "string",
|
||
"example": "Palo Alto"
|
||
},
|
||
"state": {
|
||
"type": "string",
|
||
"example": "CA"
|
||
},
|
||
"zip": {
|
||
"type": "string",
|
||
"example": "94301"
|
||
}
|
||
},
|
||
"xml": {
|
||
"name": "address"
|
||
}
|
||
},
|
||
"city": {
|
||
"type": "object",
|
||
"properties": {
|
||
"street": {
|
||
"type": "string",
|
||
"example": "437 Lytton"
|
||
},
|
||
"city": {
|
||
"type": "string",
|
||
"example": "Palo Alto"
|
||
},
|
||
"state": {
|
||
"type": "string",
|
||
"example": "CA"
|
||
},
|
||
"zip": {
|
||
"type": "string",
|
||
"example": "94301"
|
||
}
|
||
},
|
||
"xml": {
|
||
"name": "address"
|
||
}
|
||
},
|
||
"state": {
|
||
"type": "object",
|
||
"properties": {
|
||
"street": {
|
||
"type": "string",
|
||
"example": "437 Lytton"
|
||
},
|
||
"city": {
|
||
"type": "string",
|
||
"example": "Palo Alto"
|
||
},
|
||
"state": {
|
||
"type": "string",
|
||
"example": "CA"
|
||
},
|
||
"zip": {
|
||
"type": "string",
|
||
"example": "94301"
|
||
}
|
||
},
|
||
"xml": {
|
||
"name": "address"
|
||
}
|
||
},
|
||
"zip": {
|
||
"type": "object",
|
||
"properties": {
|
||
"street": {
|
||
"type": "string",
|
||
"example": "437 Lytton"
|
||
},
|
||
"city": {
|
||
"type": "string",
|
||
"example": "Palo Alto"
|
||
},
|
||
"state": {
|
||
"type": "string",
|
||
"example": "CA"
|
||
},
|
||
"zip": {
|
||
"type": "string",
|
||
"example": "94301"
|
||
}
|
||
},
|
||
"xml": {
|
||
"name": "address"
|
||
}
|
||
}
|
||
},
|
||
"xml": {
|
||
"name": "address"
|
||
}
|
||
},
|
||
"Category": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "integer",
|
||
"format": "int64",
|
||
"example": 1
|
||
},
|
||
"name": {
|
||
"type": "string",
|
||
"example": "Dogs"
|
||
}
|
||
},
|
||
"xml": {
|
||
"name": "category"
|
||
}
|
||
},
|
||
"name": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "integer",
|
||
"format": "int64",
|
||
"example": 1
|
||
},
|
||
"name": {
|
||
"type": "string",
|
||
"example": "Dogs"
|
||
}
|
||
},
|
||
"xml": {
|
||
"name": "category"
|
||
}
|
||
}
|
||
},
|
||
"xml": {
|
||
"name": "category"
|
||
}
|
||
},
|
||
"User": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "integer",
|
||
"format": "int64",
|
||
"example": 10
|
||
},
|
||
"username": {
|
||
"type": "string",
|
||
"example": "theUser"
|
||
},
|
||
"firstName": {
|
||
"type": "string",
|
||
"example": "John"
|
||
},
|
||
"lastName": {
|
||
"type": "string",
|
||
"example": "James"
|
||
},
|
||
"email": {
|
||
"type": "string",
|
||
"example": "john@email.com"
|
||
},
|
||
"password": {
|
||
"type": "string",
|
||
"example": "12345"
|
||
},
|
||
"phone": {
|
||
"type": "string",
|
||
"example": "12345"
|
||
},
|
||
"userStatus": {
|
||
"type": "integer",
|
||
"description": "User Status",
|
||
"format": "int32",
|
||
"example": 1
|
||
}
|
||
},
|
||
"xml": {
|
||
"name": "user"
|
||
}
|
||
},
|
||
"username": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "integer",
|
||
"format": "int64",
|
||
"example": 10
|
||
},
|
||
"username": {
|
||
"type": "string",
|
||
"example": "theUser"
|
||
},
|
||
"firstName": {
|
||
"type": "string",
|
||
"example": "John"
|
||
},
|
||
"lastName": {
|
||
"type": "string",
|
||
"example": "James"
|
||
},
|
||
"email": {
|
||
"type": "string",
|
||
"example": "john@email.com"
|
||
},
|
||
"password": {
|
||
"type": "string",
|
||
"example": "12345"
|
||
},
|
||
"phone": {
|
||
"type": "string",
|
||
"example": "12345"
|
||
},
|
||
"userStatus": {
|
||
"type": "integer",
|
||
"description": "User Status",
|
||
"format": "int32",
|
||
"example": 1
|
||
}
|
||
},
|
||
"xml": {
|
||
"name": "user"
|
||
}
|
||
},
|
||
"firstName": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "integer",
|
||
"format": "int64",
|
||
"example": 10
|
||
},
|
||
"username": {
|
||
"type": "string",
|
||
"example": "theUser"
|
||
},
|
||
"firstName": {
|
||
"type": "string",
|
||
"example": "John"
|
||
},
|
||
"lastName": {
|
||
"type": "string",
|
||
"example": "James"
|
||
},
|
||
"email": {
|
||
"type": "string",
|
||
"example": "john@email.com"
|
||
},
|
||
"password": {
|
||
"type": "string",
|
||
"example": "12345"
|
||
},
|
||
"phone": {
|
||
"type": "string",
|
||
"example": "12345"
|
||
},
|
||
"userStatus": {
|
||
"type": "integer",
|
||
"description": "User Status",
|
||
"format": "int32",
|
||
"example": 1
|
||
}
|
||
},
|
||
"xml": {
|
||
"name": "user"
|
||
}
|
||
},
|
||
"lastName": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "integer",
|
||
"format": "int64",
|
||
"example": 10
|
||
},
|
||
"username": {
|
||
"type": "string",
|
||
"example": "theUser"
|
||
},
|
||
"firstName": {
|
||
"type": "string",
|
||
"example": "John"
|
||
},
|
||
"lastName": {
|
||
"type": "string",
|
||
"example": "James"
|
||
},
|
||
"email": {
|
||
"type": "string",
|
||
"example": "john@email.com"
|
||
},
|
||
"password": {
|
||
"type": "string",
|
||
"example": "12345"
|
||
},
|
||
"phone": {
|
||
"type": "string",
|
||
"example": "12345"
|
||
},
|
||
"userStatus": {
|
||
"type": "integer",
|
||
"description": "User Status",
|
||
"format": "int32",
|
||
"example": 1
|
||
}
|
||
},
|
||
"xml": {
|
||
"name": "user"
|
||
}
|
||
},
|
||
"email": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "integer",
|
||
"format": "int64",
|
||
"example": 10
|
||
},
|
||
"username": {
|
||
"type": "string",
|
||
"example": "theUser"
|
||
},
|
||
"firstName": {
|
||
"type": "string",
|
||
"example": "John"
|
||
},
|
||
"lastName": {
|
||
"type": "string",
|
||
"example": "James"
|
||
},
|
||
"email": {
|
||
"type": "string",
|
||
"example": "john@email.com"
|
||
},
|
||
"password": {
|
||
"type": "string",
|
||
"example": "12345"
|
||
},
|
||
"phone": {
|
||
"type": "string",
|
||
"example": "12345"
|
||
},
|
||
"userStatus": {
|
||
"type": "integer",
|
||
"description": "User Status",
|
||
"format": "int32",
|
||
"example": 1
|
||
}
|
||
},
|
||
"xml": {
|
||
"name": "user"
|
||
}
|
||
},
|
||
"password": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "integer",
|
||
"format": "int64",
|
||
"example": 10
|
||
},
|
||
"username": {
|
||
"type": "string",
|
||
"example": "theUser"
|
||
},
|
||
"firstName": {
|
||
"type": "string",
|
||
"example": "John"
|
||
},
|
||
"lastName": {
|
||
"type": "string",
|
||
"example": "James"
|
||
},
|
||
"email": {
|
||
"type": "string",
|
||
"example": "john@email.com"
|
||
},
|
||
"password": {
|
||
"type": "string",
|
||
"example": "12345"
|
||
},
|
||
"phone": {
|
||
"type": "string",
|
||
"example": "12345"
|
||
},
|
||
"userStatus": {
|
||
"type": "integer",
|
||
"description": "User Status",
|
||
"format": "int32",
|
||
"example": 1
|
||
}
|
||
},
|
||
"xml": {
|
||
"name": "user"
|
||
}
|
||
},
|
||
"phone": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "integer",
|
||
"format": "int64",
|
||
"example": 10
|
||
},
|
||
"username": {
|
||
"type": "string",
|
||
"example": "theUser"
|
||
},
|
||
"firstName": {
|
||
"type": "string",
|
||
"example": "John"
|
||
},
|
||
"lastName": {
|
||
"type": "string",
|
||
"example": "James"
|
||
},
|
||
"email": {
|
||
"type": "string",
|
||
"example": "john@email.com"
|
||
},
|
||
"password": {
|
||
"type": "string",
|
||
"example": "12345"
|
||
},
|
||
"phone": {
|
||
"type": "string",
|
||
"example": "12345"
|
||
},
|
||
"userStatus": {
|
||
"type": "integer",
|
||
"description": "User Status",
|
||
"format": "int32",
|
||
"example": 1
|
||
}
|
||
},
|
||
"xml": {
|
||
"name": "user"
|
||
}
|
||
},
|
||
"userStatus": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "integer",
|
||
"format": "int64",
|
||
"example": 10
|
||
},
|
||
"username": {
|
||
"type": "string",
|
||
"example": "theUser"
|
||
},
|
||
"firstName": {
|
||
"type": "string",
|
||
"example": "John"
|
||
},
|
||
"lastName": {
|
||
"type": "string",
|
||
"example": "James"
|
||
},
|
||
"email": {
|
||
"type": "string",
|
||
"example": "john@email.com"
|
||
},
|
||
"password": {
|
||
"type": "string",
|
||
"example": "12345"
|
||
},
|
||
"phone": {
|
||
"type": "string",
|
||
"example": "12345"
|
||
},
|
||
"userStatus": {
|
||
"type": "integer",
|
||
"description": "User Status",
|
||
"format": "int32",
|
||
"example": 1
|
||
}
|
||
},
|
||
"xml": {
|
||
"name": "user"
|
||
}
|
||
}
|
||
},
|
||
"xml": {
|
||
"name": "user"
|
||
}
|
||
},
|
||
"Tag": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "integer",
|
||
"format": "int64"
|
||
},
|
||
"name": {
|
||
"type": "string"
|
||
}
|
||
},
|
||
"xml": {
|
||
"name": "tag"
|
||
}
|
||
},
|
||
"name": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "integer",
|
||
"format": "int64"
|
||
},
|
||
"name": {
|
||
"type": "string"
|
||
}
|
||
},
|
||
"xml": {
|
||
"name": "tag"
|
||
}
|
||
}
|
||
},
|
||
"xml": {
|
||
"name": "tag"
|
||
}
|
||
},
|
||
"Pet": {
|
||
"required": [
|
||
"name",
|
||
"photoUrls"
|
||
],
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"required": [
|
||
"name",
|
||
"photoUrls"
|
||
],
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "integer",
|
||
"format": "int64",
|
||
"example": 10
|
||
},
|
||
"name": {
|
||
"type": "string",
|
||
"example": "doggie"
|
||
},
|
||
"category": {
|
||
"$ref": "#/components/schemas/Category"
|
||
},
|
||
"photoUrls": {
|
||
"type": "array",
|
||
"xml": {
|
||
"wrapped": true
|
||
},
|
||
"items": {
|
||
"type": "string",
|
||
"xml": {
|
||
"name": "photoUrl"
|
||
}
|
||
}
|
||
},
|
||
"tags": {
|
||
"type": "array",
|
||
"xml": {
|
||
"wrapped": true
|
||
},
|
||
"items": {
|
||
"$ref": "#/components/schemas/Tag"
|
||
}
|
||
},
|
||
"status": {
|
||
"type": "string",
|
||
"description": "pet status in the store",
|
||
"enum": [
|
||
"available",
|
||
"pending",
|
||
"sold"
|
||
]
|
||
}
|
||
},
|
||
"xml": {
|
||
"name": "pet"
|
||
}
|
||
},
|
||
"name": {
|
||
"required": [
|
||
"name",
|
||
"photoUrls"
|
||
],
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "integer",
|
||
"format": "int64",
|
||
"example": 10
|
||
},
|
||
"name": {
|
||
"type": "string",
|
||
"example": "doggie"
|
||
},
|
||
"category": {
|
||
"$ref": "#/components/schemas/Category"
|
||
},
|
||
"photoUrls": {
|
||
"type": "array",
|
||
"xml": {
|
||
"wrapped": true
|
||
},
|
||
"items": {
|
||
"type": "string",
|
||
"xml": {
|
||
"name": "photoUrl"
|
||
}
|
||
}
|
||
},
|
||
"tags": {
|
||
"type": "array",
|
||
"xml": {
|
||
"wrapped": true
|
||
},
|
||
"items": {
|
||
"$ref": "#/components/schemas/Tag"
|
||
}
|
||
},
|
||
"status": {
|
||
"type": "string",
|
||
"description": "pet status in the store",
|
||
"enum": [
|
||
"available",
|
||
"pending",
|
||
"sold"
|
||
]
|
||
}
|
||
},
|
||
"xml": {
|
||
"name": "pet"
|
||
}
|
||
},
|
||
"category": {
|
||
"required": [
|
||
"name",
|
||
"photoUrls"
|
||
],
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "integer",
|
||
"format": "int64",
|
||
"example": 10
|
||
},
|
||
"name": {
|
||
"type": "string",
|
||
"example": "doggie"
|
||
},
|
||
"category": {
|
||
"$ref": "#/components/schemas/Category"
|
||
},
|
||
"photoUrls": {
|
||
"type": "array",
|
||
"xml": {
|
||
"wrapped": true
|
||
},
|
||
"items": {
|
||
"type": "string",
|
||
"xml": {
|
||
"name": "photoUrl"
|
||
}
|
||
}
|
||
},
|
||
"tags": {
|
||
"type": "array",
|
||
"xml": {
|
||
"wrapped": true
|
||
},
|
||
"items": {
|
||
"$ref": "#/components/schemas/Tag"
|
||
}
|
||
},
|
||
"status": {
|
||
"type": "string",
|
||
"description": "pet status in the store",
|
||
"enum": [
|
||
"available",
|
||
"pending",
|
||
"sold"
|
||
]
|
||
}
|
||
},
|
||
"xml": {
|
||
"name": "pet"
|
||
}
|
||
},
|
||
"photoUrls": {
|
||
"required": [
|
||
"name",
|
||
"photoUrls"
|
||
],
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "integer",
|
||
"format": "int64",
|
||
"example": 10
|
||
},
|
||
"name": {
|
||
"type": "string",
|
||
"example": "doggie"
|
||
},
|
||
"category": {
|
||
"$ref": "#/components/schemas/Category"
|
||
},
|
||
"photoUrls": {
|
||
"type": "array",
|
||
"xml": {
|
||
"wrapped": true
|
||
},
|
||
"items": {
|
||
"type": "string",
|
||
"xml": {
|
||
"name": "photoUrl"
|
||
}
|
||
}
|
||
},
|
||
"tags": {
|
||
"type": "array",
|
||
"xml": {
|
||
"wrapped": true
|
||
},
|
||
"items": {
|
||
"$ref": "#/components/schemas/Tag"
|
||
}
|
||
},
|
||
"status": {
|
||
"type": "string",
|
||
"description": "pet status in the store",
|
||
"enum": [
|
||
"available",
|
||
"pending",
|
||
"sold"
|
||
]
|
||
}
|
||
},
|
||
"xml": {
|
||
"name": "pet"
|
||
}
|
||
},
|
||
"tags": {
|
||
"required": [
|
||
"name",
|
||
"photoUrls"
|
||
],
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "integer",
|
||
"format": "int64",
|
||
"example": 10
|
||
},
|
||
"name": {
|
||
"type": "string",
|
||
"example": "doggie"
|
||
},
|
||
"category": {
|
||
"$ref": "#/components/schemas/Category"
|
||
},
|
||
"photoUrls": {
|
||
"type": "array",
|
||
"xml": {
|
||
"wrapped": true
|
||
},
|
||
"items": {
|
||
"type": "string",
|
||
"xml": {
|
||
"name": "photoUrl"
|
||
}
|
||
}
|
||
},
|
||
"tags": {
|
||
"type": "array",
|
||
"xml": {
|
||
"wrapped": true
|
||
},
|
||
"items": {
|
||
"$ref": "#/components/schemas/Tag"
|
||
}
|
||
},
|
||
"status": {
|
||
"type": "string",
|
||
"description": "pet status in the store",
|
||
"enum": [
|
||
"available",
|
||
"pending",
|
||
"sold"
|
||
]
|
||
}
|
||
},
|
||
"xml": {
|
||
"name": "pet"
|
||
}
|
||
},
|
||
"status": {
|
||
"required": [
|
||
"name",
|
||
"photoUrls"
|
||
],
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "integer",
|
||
"format": "int64",
|
||
"example": 10
|
||
},
|
||
"name": {
|
||
"type": "string",
|
||
"example": "doggie"
|
||
},
|
||
"category": {
|
||
"$ref": "#/components/schemas/Category"
|
||
},
|
||
"photoUrls": {
|
||
"type": "array",
|
||
"xml": {
|
||
"wrapped": true
|
||
},
|
||
"items": {
|
||
"type": "string",
|
||
"xml": {
|
||
"name": "photoUrl"
|
||
}
|
||
}
|
||
},
|
||
"tags": {
|
||
"type": "array",
|
||
"xml": {
|
||
"wrapped": true
|
||
},
|
||
"items": {
|
||
"$ref": "#/components/schemas/Tag"
|
||
}
|
||
},
|
||
"status": {
|
||
"type": "string",
|
||
"description": "pet status in the store",
|
||
"enum": [
|
||
"available",
|
||
"pending",
|
||
"sold"
|
||
]
|
||
}
|
||
},
|
||
"xml": {
|
||
"name": "pet"
|
||
}
|
||
}
|
||
},
|
||
"xml": {
|
||
"name": "pet"
|
||
}
|
||
},
|
||
"ApiResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"code": {
|
||
"type": "object",
|
||
"properties": {
|
||
"code": {
|
||
"type": "integer",
|
||
"format": "int32"
|
||
},
|
||
"type": {
|
||
"type": "string"
|
||
},
|
||
"message": {
|
||
"type": "string"
|
||
}
|
||
},
|
||
"xml": {
|
||
"name": "##default"
|
||
}
|
||
},
|
||
"type": {
|
||
"type": "object",
|
||
"properties": {
|
||
"code": {
|
||
"type": "integer",
|
||
"format": "int32"
|
||
},
|
||
"type": {
|
||
"type": "string"
|
||
},
|
||
"message": {
|
||
"type": "string"
|
||
}
|
||
},
|
||
"xml": {
|
||
"name": "##default"
|
||
}
|
||
},
|
||
"message": {
|
||
"type": "object",
|
||
"properties": {
|
||
"code": {
|
||
"type": "integer",
|
||
"format": "int32"
|
||
},
|
||
"type": {
|
||
"type": "string"
|
||
},
|
||
"message": {
|
||
"type": "string"
|
||
}
|
||
},
|
||
"xml": {
|
||
"name": "##default"
|
||
}
|
||
}
|
||
},
|
||
"xml": {
|
||
"name": "##default"
|
||
}
|
||
}
|
||
},
|
||
"requestBodies": {
|
||
"Pet": {
|
||
"description": "Pet object that needs to be added to the store",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/Pet"
|
||
}
|
||
},
|
||
"application/xml": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/Pet"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"UserArray": {
|
||
"description": "List of user object",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/components/schemas/User"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"securitySchemes": {
|
||
"petstore_auth": {
|
||
"type": "oauth2",
|
||
"flows": {
|
||
"implicit": {
|
||
"authorizationUrl": "https://petstore3.swagger.io/oauth/authorize",
|
||
"scopes": {
|
||
"write:pets": "modify pets in your account",
|
||
"read:pets": "read your pets"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"api_key": {
|
||
"type": "apiKey",
|
||
"name": "api_key",
|
||
"in": "header"
|
||
}
|
||
}
|
||
}
|
||
}"
|
||
></div>
|
||
</div>
|
||
|
||
<footer class="footline">
|
||
</footer>
|
||
</article>
|
||
|
||
<article class="default">
|
||
<header class="headline">
|
||
</header>
|
||
|
||
<h1 id="resources">Resources</h1>
|
||
|
||
<p>The <code>resources</code> shortcode displays the <a href="https://gohugo.io/methods/resource/title/" rel="external" target="_self">titles</a> of resources contained in a <a href="https://gohugo.io/content-management/page-bundles/" rel="external" target="_self">page bundle</a>.</p>
|
||
|
||
<div class="box attachments cstyle transparent">
|
||
<div class="box-label"><i class="fa-fw fas fa-paperclip"></i> Attachments</div>
|
||
<ul class="box-content attachments-files">
|
||
<li><a href="/hugo-theme-relearn/shortcodes/resources/hugo.png">hugo.png</a> (17 KB)</li>
|
||
<li><a href="/hugo-theme-relearn/shortcodes/resources/MaybeTreasure.en.txt">MaybeTreasure.txt</a> (23 B)</li>
|
||
<li><a href="/hugo-theme-relearn/shortcodes/resources/NoTreasure.en.txt">NoTreasure.en.txt</a> (23 B)</li>
|
||
<li><a href="/hugo-theme-relearn/shortcodes/resources/Treasure.pir.txt">Treasure.pir.txt</a> (31 B)</li>
|
||
</ul>
|
||
</div>
|
||
<h2 id="usage">Usage</h2>
|
||
<p>While the examples are using shortcodes with named parameter you are free to also call this shortcode from your own partials.</p>
|
||
|
||
<div class="tab-panel" data-tab-group="shortcode-parameter">
|
||
<div class="tab-nav">
|
||
<div class="tab-nav-title">​</div>
|
||
<button
|
||
data-tab-item="shortcode"
|
||
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
|
||
onclick="switchTab('shortcode-parameter','shortcode')"
|
||
>
|
||
<span class="tab-nav-text">shortcode</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="partial"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('shortcode-parameter','partial')"
|
||
>
|
||
<span class="tab-nav-text">partial</span>
|
||
</button>
|
||
</div>
|
||
<div class="tab-content-container">
|
||
<div
|
||
data-tab-item="shortcode"
|
||
class="tab-content tab-panel-style cstyle initial active">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><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">resources</span> <span class="nx">sort</span><span class="p">=</span><span class="s">"asc"</span> <span class="o">/%</span><span class="p">}}</span></span></span></code></pre></div></div>
|
||
</div>
|
||
<div
|
||
data-tab-item="partial"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><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/resources.html"</span> <span class="p">(</span><span class="nx">dict</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"page"</span> <span class="p">.</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"sort"</span> <span class="s">"asc"</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">)}}</span></span></span></code></pre></div></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<p>Multilanguage features are not supported directly by the shortcode but rely on Hugo’s handling for resource translations applied when the theme iterates over all available resources.</p>
|
||
<h3 id="parameter">Parameter</h3>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Name</th>
|
||
<th>Default</th>
|
||
<th>Notes</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td><strong>style</strong></td>
|
||
<td><code>transparent</code></td>
|
||
<td>The style scheme used for the box.<br><br>- by severity: <code>info</code>, <code>note</code>, <code>tip</code>, <code>warning</code><br>- by brand color: <code>primary</code>, <code>secondary</code>, <code>accent</code><br>- by color: <code>blue</code>, <code>green</code>, <code>grey</code>, <code>orange</code>, <code>red</code><br>- by special color: <code>default</code>, <code>transparent</code>, <code>code</code></td>
|
||
</tr>
|
||
<tr>
|
||
<td><strong>color</strong></td>
|
||
<td>see notes</td>
|
||
<td>The <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/color_value" rel="external" target="_self">CSS color value</a> to be used. If not set, the chosen color depends on the <strong>style</strong>. Any given value will overwrite the default.<br><br>- for severity styles: a nice matching color for the severity<br>- for all other styles: the corresponding color</td>
|
||
</tr>
|
||
<tr>
|
||
<td><strong>title</strong></td>
|
||
<td>see notes</td>
|
||
<td>Arbitrary text for the box title. Depending on the <strong>style</strong> there may be a default title. Any given value will overwrite the default.<br><br>- for severity styles: the matching title for the severity<br>- for all other styles: <code>Resources</code><br><br>If you want no title for a severity style, you have to set this parameter to <code>" "</code> (a non empty string filled with spaces)</td>
|
||
</tr>
|
||
<tr>
|
||
<td><strong>icon</strong></td>
|
||
<td>see notes</td>
|
||
<td><a href="/hugo-theme-relearn/shortcodes/icon/index.html#finding-an-icon">Font Awesome icon name</a> set to the left of the title. Depending on the <strong>style</strong> there may be a default icon. Any given value will overwrite the default.<br><br>- for severity styles: a nice matching icon for the severity<br>- for all other styles: <code>paperclip</code><br><br>If you want no icon, you have to set this parameter to <code>" "</code> (a non empty d with spaces)</td>
|
||
</tr>
|
||
<tr>
|
||
<td><strong>sort</strong></td>
|
||
<td><code>asc</code></td>
|
||
<td>Sorting the output in <code>asc</code>ending or <code>desc</code>ending order.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><strong>pattern</strong></td>
|
||
<td><code>.*</code></td>
|
||
<td>A <a href="https://en.wikipedia.org/wiki/Regular_expression" rel="external" target="_self">regular expressions</a>, used to filter the resources <a href="https://gohugo.io/methods/resource/name/" rel="external" target="_self">by name</a>. For example:<br><br>- to match a file suffix of ‘jpg’, use <code>.*\.jpg</code> (not <code>*.\.jpg</code>)<br>- to match file names ending in <code>jpg</code> or <code>png</code>, use <code>.*\.(jpg|png)</code></td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h2 id="examples">Examples</h2>
|
||
<h3 id="custom-title-list-of-resources-ending-in-png-jpg-or-gif">Custom Title, List of Resources Ending in png, jpg or gif</h3>
|
||
<div class="highlight wrap-code"><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">resources</span> <span class="nx">title</span><span class="p">=</span><span class="s">"Related **files**"</span> <span class="nx">pattern</span><span class="p">=</span><span class="s">".*\.(png|jpg|gif)"</span> <span class="o">/%</span><span class="p">}}</span></span></span></code></pre></div>
|
||
<div class="box attachments cstyle transparent">
|
||
<div class="box-label"><i class="fa-fw fas fa-paperclip"></i> Related <strong>files</strong></div>
|
||
<ul class="box-content attachments-files">
|
||
<li><a href="/hugo-theme-relearn/shortcodes/resources/hugo.png">hugo.png</a> (17 KB)</li>
|
||
</ul>
|
||
</div>
|
||
<h3 id="info-styled-box-descending-sort-order">Info Styled Box, Descending Sort Order</h3>
|
||
<div class="highlight wrap-code"><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">resources</span> <span class="nx">style</span><span class="p">=</span><span class="s">"info"</span> <span class="nx">sort</span><span class="p">=</span><span class="s">"desc"</span> <span class="o">/%</span><span class="p">}}</span></span></span></code></pre></div>
|
||
<div class="box attachments cstyle info">
|
||
<div class="box-label"><i class="fa-fw fas fa-info-circle"></i> Info</div>
|
||
<ul class="box-content attachments-files">
|
||
<li><a href="/hugo-theme-relearn/shortcodes/resources/Treasure.pir.txt">Treasure.pir.txt</a> (31 B)</li>
|
||
<li><a href="/hugo-theme-relearn/shortcodes/resources/NoTreasure.en.txt">NoTreasure.en.txt</a> (23 B)</li>
|
||
<li><a href="/hugo-theme-relearn/shortcodes/resources/MaybeTreasure.en.txt">MaybeTreasure.txt</a> (23 B)</li>
|
||
<li><a href="/hugo-theme-relearn/shortcodes/resources/hugo.png">hugo.png</a> (17 KB)</li>
|
||
</ul>
|
||
</div>
|
||
<h3 id="with-user-defined-color-and-font-awesome-brand-icon">With User-Defined Color and Font Awesome Brand Icon</h3>
|
||
<div class="highlight wrap-code"><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">resources</span> <span class="nx">color</span><span class="p">=</span><span class="s">"fuchsia"</span> <span class="nx">icon</span><span class="p">=</span><span class="s">"fa-fw fab fa-hackerrank"</span> <span class="o">/%</span><span class="p">}}</span></span></span></code></pre></div>
|
||
<div class="box attachments cstyle default" style="--VARIABLE-BOX-color: fuchsia;">
|
||
<div class="box-label"><i class="fa-fw fab fa-hackerrank"></i> Attachments</div>
|
||
<ul class="box-content attachments-files">
|
||
<li><a href="/hugo-theme-relearn/shortcodes/resources/hugo.png">hugo.png</a> (17 KB)</li>
|
||
<li><a href="/hugo-theme-relearn/shortcodes/resources/MaybeTreasure.en.txt">MaybeTreasure.txt</a> (23 B)</li>
|
||
<li><a href="/hugo-theme-relearn/shortcodes/resources/NoTreasure.en.txt">NoTreasure.en.txt</a> (23 B)</li>
|
||
<li><a href="/hugo-theme-relearn/shortcodes/resources/Treasure.pir.txt">Treasure.pir.txt</a> (31 B)</li>
|
||
</ul>
|
||
</div>
|
||
<h3 id="style-color-title-and-icons">Style, Color, Title and Icons</h3>
|
||
<p>For further examples for <strong>style</strong>, <strong>color</strong>, <strong>title</strong> and <strong>icon</strong>, see the <a href="/hugo-theme-relearn/shortcodes/notice/index.html"><code>notice</code> shortcode</a> documentation. The parameter are working the same way for both shortcodes, besides having different defaults.</p>
|
||
|
||
<footer class="footline">
|
||
</footer>
|
||
</article>
|
||
|
||
<article class="default">
|
||
<header class="headline">
|
||
</header>
|
||
|
||
<h1 id="siteparam">SiteParam</h1>
|
||
|
||
<p>The <code>siteparam</code> shortcode prints values of site params.</p>
|
||
<h2 id="usage">Usage</h2>
|
||
<p>While the examples are using shortcodes with named parameter you are free to use positional as well or call this shortcode from your own partials.</p>
|
||
|
||
<div class="tab-panel" data-tab-group="shortcode-parameter">
|
||
<div class="tab-nav">
|
||
<div class="tab-nav-title">​</div>
|
||
<button
|
||
data-tab-item="shortcode"
|
||
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
|
||
onclick="switchTab('shortcode-parameter','shortcode')"
|
||
>
|
||
<span class="tab-nav-text">shortcode</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="shortcode-positional"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('shortcode-parameter','shortcode-positional')"
|
||
>
|
||
<span class="tab-nav-text">shortcode (positional)</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="partial"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('shortcode-parameter','partial')"
|
||
>
|
||
<span class="tab-nav-text">partial</span>
|
||
</button>
|
||
</div>
|
||
<div class="tab-content-container">
|
||
<div
|
||
data-tab-item="shortcode"
|
||
class="tab-content tab-panel-style cstyle initial active">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><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">siteparam</span> <span class="nx">name</span><span class="p">=</span><span class="s">"editURL"</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div></div>
|
||
</div>
|
||
<div
|
||
data-tab-item="shortcode-positional"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><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">siteparam</span> <span class="s">"editURL"</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div></div>
|
||
</div>
|
||
<div
|
||
data-tab-item="partial"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><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/siteparam.html"</span> <span class="p">(</span><span class="nx">dict</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"page"</span> <span class="p">.</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"name"</span> <span class="s">"editURL"</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">)}}</span></span></span></code></pre></div></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<h3 id="parameter">Parameter</h3>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Name</th>
|
||
<th>Position</th>
|
||
<th>Default</th>
|
||
<th>Notes</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td><strong>name</strong></td>
|
||
<td>1</td>
|
||
<td><em><empty></em></td>
|
||
<td>The name of the site param to be displayed.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h2 id="examples">Examples</h2>
|
||
<h3 id="editurl-from-hugotoml"><code>editURL</code> from <code>hugo.toml</code></h3>
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-go" data-lang="go"><span class="line"><span class="cl"><span class="s">`editURL`</span> <span class="nx">value</span><span class="p">:</span> <span class="p">{{</span><span class="o">%</span> <span class="nx">siteparam</span> <span class="nx">name</span><span class="p">=</span><span class="s">"editURL"</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div><p><code>editURL</code> value: <a href="https://github.com/McShelby/hugo-theme-relearn/edit/main/exampleSite/content/$%7BFilePath%7D" rel="external" target="_self">https://github.com/McShelby/hugo-theme-relearn/edit/main/exampleSite/content/${FilePath}</a></p>
|
||
<h3 id="nested-parameter-with-markdown-and-html-formatting">Nested parameter with Markdown and HTML formatting</h3>
|
||
<p>To use formatted parameter, add this in your <code>hugo.toml</code>:</p>
|
||
|
||
<div class="tab-panel" data-tab-group="config-code">
|
||
<div class="tab-nav">
|
||
<div class="tab-nav-title">hugo.</div>
|
||
<button
|
||
data-tab-item="toml"
|
||
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
|
||
onclick="switchTab('config-code','toml')"
|
||
>
|
||
<span class="tab-nav-text">toml</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="yaml"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('config-code','yaml')"
|
||
>
|
||
<span class="tab-nav-text">yaml</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="json"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('config-code','json')"
|
||
>
|
||
<span class="tab-nav-text">json</span>
|
||
</button>
|
||
</div>
|
||
<div class="tab-content-container">
|
||
<div
|
||
data-tab-item="toml"
|
||
class="tab-content tab-panel-style cstyle initial active">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-toml" data-lang="toml"><span class="line"><span class="cl"><span class="p">[</span><span class="nx">markup</span><span class="p">]</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="p">[</span><span class="nx">markup</span><span class="p">.</span><span class="nx">goldmark</span><span class="p">]</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="p">[</span><span class="nx">markup</span><span class="p">.</span><span class="nx">goldmark</span><span class="p">.</span><span class="nx">renderer</span><span class="p">]</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">unsafe</span> <span class="p">=</span> <span class="kc">true</span></span></span></code></pre></div></div>
|
||
</div>
|
||
<div
|
||
data-tab-item="yaml"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">markup</span><span class="p">:</span><span class="w">
|
||
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">goldmark</span><span class="p">:</span><span class="w">
|
||
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">renderer</span><span class="p">:</span><span class="w">
|
||
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">unsafe</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span></span></span></code></pre></div></div>
|
||
</div>
|
||
<div
|
||
data-tab-item="json"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nt">"markup"</span><span class="p">:</span> <span class="p">{</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nt">"goldmark"</span><span class="p">:</span> <span class="p">{</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nt">"renderer"</span><span class="p">:</span> <span class="p">{</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nt">"unsafe"</span><span class="p">:</span> <span class="kc">true</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="p">}</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="p">}</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="p">}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">}</span></span></span></code></pre></div></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<p>Now values containing Markdown will be formatted correctly.</p>
|
||
|
||
<div class="tab-panel" data-tab-group="config-code">
|
||
<div class="tab-nav">
|
||
<div class="tab-nav-title">hugo.</div>
|
||
<button
|
||
data-tab-item="toml"
|
||
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
|
||
onclick="switchTab('config-code','toml')"
|
||
>
|
||
<span class="tab-nav-text">toml</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="yaml"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('config-code','yaml')"
|
||
>
|
||
<span class="tab-nav-text">yaml</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="json"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('config-code','json')"
|
||
>
|
||
<span class="tab-nav-text">json</span>
|
||
</button>
|
||
</div>
|
||
<div class="tab-content-container">
|
||
<div
|
||
data-tab-item="toml"
|
||
class="tab-content tab-panel-style cstyle initial active">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-toml" data-lang="toml"><span class="line"><span class="cl"><span class="p">[</span><span class="nx">params</span><span class="p">]</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="p">[</span><span class="nx">params</span><span class="p">.</span><span class="nx">siteparam</span><span class="p">]</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="p">[</span><span class="nx">params</span><span class="p">.</span><span class="nx">siteparam</span><span class="p">.</span><span class="nx">test</span><span class="p">]</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">text</span> <span class="p">=</span> <span class="s1">'A **nested** parameter <b>with</b> formatting'</span></span></span></code></pre></div></div>
|
||
</div>
|
||
<div
|
||
data-tab-item="yaml"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">params</span><span class="p">:</span><span class="w">
|
||
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">siteparam</span><span class="p">:</span><span class="w">
|
||
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">test</span><span class="p">:</span><span class="w">
|
||
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">text</span><span class="p">:</span><span class="w"> </span><span class="l">A **nested** parameter <b>with</b> formatting</span></span></span></code></pre></div></div>
|
||
</div>
|
||
<div
|
||
data-tab-item="json"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nt">"params"</span><span class="p">:</span> <span class="p">{</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nt">"siteparam"</span><span class="p">:</span> <span class="p">{</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nt">"test"</span><span class="p">:</span> <span class="p">{</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nt">"text"</span><span class="p">:</span> <span class="s2">"A **nested** parameter \u003cb\u003ewith\u003c/b\u003e formatting"</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="p">}</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="p">}</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="p">}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">}</span></span></span></code></pre></div></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-go" data-lang="go"><span class="line"><span class="cl"><span class="nx">Formatted</span> <span class="nx">parameter</span><span class="p">:</span> <span class="p">{{</span><span class="o">%</span> <span class="nx">siteparam</span> <span class="nx">name</span><span class="p">=</span><span class="s">"siteparam.test.text"</span> <span class="o">%</span><span class="p">}}</span></span></span></code></pre></div><p>Formatted parameter: A <strong>nested</strong> option <b>with</b> formatting</p>
|
||
|
||
<footer class="footline">
|
||
</footer>
|
||
</article>
|
||
|
||
<article class="default">
|
||
<header class="headline">
|
||
</header>
|
||
|
||
<h1 id="tab">Tab</h1>
|
||
|
||
<p>You can use a <code>tab</code> shortcode to display a single tab.</p>
|
||
<p>This is especially useful if you want to flag your code example with an explicit language.</p>
|
||
<p>If you want multiple tabs grouped together you can wrap your tabs into the <a href="/hugo-theme-relearn/shortcodes/tabs/index.html"><code>tabs</code> shortcode</a>.</p>
|
||
|
||
<div class="tab-panel" data-tab-group="6df877166a7511e8c6e5159be5e76e3a">
|
||
<div class="tab-nav">
|
||
<div class="tab-nav-title">​</div>
|
||
<button
|
||
data-tab-item="c"
|
||
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
|
||
onclick="switchTab('6df877166a7511e8c6e5159be5e76e3a','c')"
|
||
>
|
||
<span class="tab-nav-text">c</span>
|
||
</button>
|
||
</div>
|
||
<div class="tab-content-container">
|
||
<div
|
||
data-tab-item="c"
|
||
class="tab-content tab-panel-style cstyle initial active">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><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>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<h2 id="usage">Usage</h2>
|
||
<p>While the examples are using shortcodes with named parameter you are free to also call this shortcode from your own partials.</p>
|
||
|
||
<div class="tab-panel" data-tab-group="shortcode-parameter">
|
||
<div class="tab-nav">
|
||
<div class="tab-nav-title">​</div>
|
||
<button
|
||
data-tab-item="shortcode"
|
||
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
|
||
onclick="switchTab('shortcode-parameter','shortcode')"
|
||
>
|
||
<span class="tab-nav-text">shortcode</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="partial"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('shortcode-parameter','partial')"
|
||
>
|
||
<span class="tab-nav-text">partial</span>
|
||
</button>
|
||
</div>
|
||
<div class="tab-content-container">
|
||
<div
|
||
data-tab-item="shortcode"
|
||
class="tab-content tab-panel-style cstyle initial active">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><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">title</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>
|
||
</div>
|
||
<div
|
||
data-tab-item="partial"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><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">"page"</span> <span class="p">.</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"title"</span> <span class="s">"c"</span>
|
||
</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">RenderString</span><span class="p">)</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">)}}</span></span></span></code></pre></div></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<h3 id="parameter">Parameter</h3>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Name</th>
|
||
<th>Default</th>
|
||
<th>Notes</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td><strong>style</strong></td>
|
||
<td>see notes</td>
|
||
<td>The style scheme used for the tab. If you don’t set a style and you display a single code block inside of the tab, its default styling will adapt to that of a <code>code</code> block. Otherwise <code>default</code> is used.<br><br>- by severity: <code>info</code>, <code>note</code>, <code>tip</code>, <code>warning</code><br>- by brand color: <code>primary</code>, <code>secondary</code>, <code>accent</code><br>- by color: <code>blue</code>, <code>green</code>, <code>grey</code>, <code>orange</code>, <code>red</code><br>- by special color: <code>default</code>, <code>transparent</code>, <code>code</code></td>
|
||
</tr>
|
||
<tr>
|
||
<td><strong>color</strong></td>
|
||
<td>see notes</td>
|
||
<td>The <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/color_value" rel="external" target="_self">CSS color value</a> to be used. If not set, the chosen color depends on the <strong>style</strong>. Any given value will overwrite the default.<br><br>- for severity styles: a nice matching color for the severity<br>- for all other styles: the corresponding color</td>
|
||
</tr>
|
||
<tr>
|
||
<td><strong>title</strong></td>
|
||
<td>see notes</td>
|
||
<td>Arbitrary title for the tab. Depending on the <strong>style</strong> there may be a default title. Any given value will overwrite the default.<br><br>- for severity styles: the matching title for the severity<br>- for all other styles: <em><empty></em><br><br>If you want no title for a severity style, you have to set this parameter to <code>" "</code> (a non empty string filled with spaces)</td>
|
||
</tr>
|
||
<tr>
|
||
<td><strong>icon</strong></td>
|
||
<td>see notes</td>
|
||
<td><a href="/hugo-theme-relearn/shortcodes/icon/index.html#finding-an-icon">Font Awesome icon name</a> set to the left of the title. Depending on the <strong>style</strong> there may be a default icon. Any given value will overwrite the default.<br><br>- for severity styles: a nice matching icon for the severity<br>- for all other styles: <em><empty></em><br><br>If you want no icon for a severity style, you have to set this parameter to <code>" "</code> (a non empty string filled with spaces)</td>
|
||
</tr>
|
||
<tr>
|
||
<td><em><strong><content></strong></em></td>
|
||
<td><em><empty></em></td>
|
||
<td>Arbitrary text to be displayed in the tab.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h2 id="examples">Examples</h2>
|
||
<h3 id="single-code-block-with-collapsed-margins">Single Code Block with Collapsed Margins</h3>
|
||
<div class="highlight wrap-code"><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">title</span><span class="p">=</span><span class="s">"Code"</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="s">```python
|
||
</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 class="tab-panel" data-tab-group="57e065963c820186a0fc568a3ccd743f">
|
||
<div class="tab-nav">
|
||
<div class="tab-nav-title">​</div>
|
||
<button
|
||
data-tab-item="code"
|
||
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
|
||
onclick="switchTab('57e065963c820186a0fc568a3ccd743f','code')"
|
||
>
|
||
<span class="tab-nav-text">Code</span>
|
||
</button>
|
||
</div>
|
||
<div class="tab-content-container">
|
||
<div
|
||
data-tab-item="code"
|
||
class="tab-content tab-panel-style cstyle initial active">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><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>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<h3 id="mixed-markdown-content">Mixed Markdown Content</h3>
|
||
<div class="highlight wrap-code"><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">title</span><span class="p">=</span><span class="s">"_**Mixed**_"</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nx">A</span> <span class="nx">tab</span> <span class="nx">can</span> <span class="nx">not</span> <span class="nx">only</span> <span class="nx">contain</span> <span class="nx">code</span> <span class="nx">but</span> <span class="nx">arbitrary</span> <span class="nx">text</span><span class="p">.</span> <span class="nx">In</span> <span class="nx">this</span> <span class="k">case</span> <span class="nx">text</span> <span class="o">**</span><span class="nx">and</span><span class="o">**</span> <span class="nx">code</span> <span class="nx">will</span> <span class="nx">get</span> <span class="nx">a</span> <span class="nx">margin</span><span class="p">.</span>
|
||
</span></span><span class="line"><span class="cl"><span class="s">```python
|
||
</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 class="tab-panel" data-tab-group="100726a35e4578fbb943a4c29449ee9e">
|
||
<div class="tab-nav">
|
||
<div class="tab-nav-title">​</div>
|
||
<button
|
||
data-tab-item="mixed"
|
||
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
|
||
onclick="switchTab('100726a35e4578fbb943a4c29449ee9e','mixed')"
|
||
>
|
||
<span class="tab-nav-text"><em><strong>Mixed</strong></em></span>
|
||
</button>
|
||
</div>
|
||
<div class="tab-content-container">
|
||
<div
|
||
data-tab-item="mixed"
|
||
class="tab-content tab-panel-style cstyle initial active">
|
||
<div class="tab-content-text">
|
||
|
||
<p>A tab can not only contain code but arbitrary text. In this case text <strong>and</strong> code will get a margin.</p>
|
||
<div class="highlight wrap-code"><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>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<h3 id="understanding-style-and-color-behavior">Understanding <code>style</code> and <code>color</code> Behavior</h3>
|
||
<p>The <code>style</code> parameter affects how the <code>color</code> parameter is applied.</p>
|
||
<div class="highlight wrap-code"><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">tabs</span> <span class="p">>}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="nx">tab</span> <span class="nx">title</span><span class="p">=</span><span class="s">"just colored style"</span> <span class="nx">style</span><span class="p">=</span><span class="s">"blue"</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nx">The</span> <span class="s">`style`</span> <span class="nx">parameter</span> <span class="nx">is</span> <span class="nx">set</span> <span class="nx">to</span> <span class="nx">a</span> <span class="nx">color</span> <span class="nx">style</span><span class="p">.</span>
|
||
</span></span><span class="line"><span class="cl">
|
||
</span></span><span class="line"><span class="cl"><span class="nx">This</span> <span class="nx">will</span> <span class="nx">set</span> <span class="nx">the</span> <span class="nx">background</span> <span class="nx">to</span> <span class="nx">a</span> <span class="nx">lighter</span> <span class="nx">version</span> <span class="nx">of</span> <span class="nx">the</span> <span class="nx">chosen</span> <span class="nx">style</span> <span class="nx">color</span> <span class="nx">as</span> <span class="nx">configured</span> <span class="nx">in</span> <span class="nx">your</span> <span class="nx">theme</span> <span class="nx">variant</span><span class="p">.</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><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="nx">tab</span> <span class="nx">title</span><span class="p">=</span><span class="s">"just color"</span> <span class="nx">color</span><span class="p">=</span><span class="s">"blue"</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nx">Only</span> <span class="nx">the</span> <span class="s">`color`</span> <span class="nx">parameter</span> <span class="nx">is</span> <span class="nx">set</span><span class="p">.</span>
|
||
</span></span><span class="line"><span class="cl">
|
||
</span></span><span class="line"><span class="cl"><span class="nx">This</span> <span class="nx">will</span> <span class="nx">set</span> <span class="nx">the</span> <span class="nx">background</span> <span class="nx">to</span> <span class="nx">a</span> <span class="nx">lighter</span> <span class="nx">version</span> <span class="nx">of</span> <span class="nx">the</span> <span class="nx">chosen</span> <span class="nx">CSS</span> <span class="nx">color</span> <span class="nx">value</span><span class="p">.</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><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="nx">tab</span> <span class="nx">title</span><span class="p">=</span><span class="s">"default style and color"</span> <span class="nx">style</span><span class="p">=</span><span class="s">"default"</span> <span class="nx">color</span><span class="p">=</span><span class="s">"blue"</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nx">The</span> <span class="s">`style`</span> <span class="nx">parameter</span> <span class="nx">affects</span> <span class="nx">how</span> <span class="nx">the</span> <span class="s">`color`</span> <span class="nx">parameter</span> <span class="nx">is</span> <span class="nx">applied</span><span class="p">.</span>
|
||
</span></span><span class="line"><span class="cl">
|
||
</span></span><span class="line"><span class="cl"><span class="nx">The</span> <span class="s">`default`</span> <span class="nx">style</span> <span class="nx">will</span> <span class="nx">set</span> <span class="nx">the</span> <span class="nx">background</span> <span class="nx">to</span> <span class="nx">your</span> <span class="s">`--MAIN-BG-color`</span> <span class="nx">as</span> <span class="nx">configured</span> <span class="k">for</span> <span class="nx">your</span> <span class="nx">theme</span> <span class="nx">variant</span> <span class="nx">resembling</span> <span class="nx">the</span> <span class="k">default</span> <span class="nx">style</span> <span class="nx">but</span> <span class="nx">with</span> <span class="nx">different</span> <span class="nx">color</span><span class="p">.</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><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="nx">tab</span> <span class="nx">title</span><span class="p">=</span><span class="s">"just severity style"</span> <span class="nx">style</span><span class="p">=</span><span class="s">"info"</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nx">The</span> <span class="s">`style`</span> <span class="nx">parameter</span> <span class="nx">is</span> <span class="nx">set</span> <span class="nx">to</span> <span class="nx">a</span> <span class="nx">severity</span> <span class="nx">style</span><span class="p">.</span>
|
||
</span></span><span class="line"><span class="cl">
|
||
</span></span><span class="line"><span class="cl"><span class="nx">This</span> <span class="nx">will</span> <span class="nx">set</span> <span class="nx">the</span> <span class="nx">background</span> <span class="nx">to</span> <span class="nx">a</span> <span class="nx">lighter</span> <span class="nx">version</span> <span class="nx">of</span> <span class="nx">the</span> <span class="nx">chosen</span> <span class="nx">style</span> <span class="nx">color</span> <span class="nx">as</span> <span class="nx">configured</span> <span class="nx">in</span> <span class="nx">your</span> <span class="nx">theme</span> <span class="nx">variant</span> <span class="nx">and</span> <span class="nx">also</span> <span class="nx">affects</span> <span class="nx">the</span> <span class="nx">chosen</span> <span class="nx">icon</span><span class="p">.</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><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="nx">tab</span> <span class="nx">title</span><span class="p">=</span><span class="s">"severity style and color"</span> <span class="nx">style</span><span class="p">=</span><span class="s">"info"</span> <span class="nx">color</span><span class="p">=</span><span class="s">"blue"</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="nx">The</span> <span class="s">`style`</span> <span class="nx">parameter</span> <span class="nx">affects</span> <span class="nx">how</span> <span class="nx">the</span> <span class="s">`color`</span> <span class="nx">parameter</span> <span class="nx">is</span> <span class="nx">applied</span><span class="p">.</span>
|
||
</span></span><span class="line"><span class="cl">
|
||
</span></span><span class="line"><span class="cl"><span class="nx">This</span> <span class="nx">will</span> <span class="nx">set</span> <span class="nx">the</span> <span class="nx">background</span> <span class="nx">to</span> <span class="nx">a</span> <span class="nx">lighter</span> <span class="nx">version</span> <span class="nx">of</span> <span class="nx">the</span> <span class="nx">chosen</span> <span class="nx">CSS</span> <span class="nx">color</span> <span class="nx">value</span> <span class="nx">and</span> <span class="nx">also</span> <span class="nx">affects</span> <span class="nx">the</span> <span class="nx">chosen</span> <span class="nx">icon</span><span class="p">.</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><span class="line"><span class="cl"><span class="p">{{<</span> <span class="o">/</span><span class="nx">tabs</span> <span class="p">>}}</span></span></span></code></pre></div>
|
||
<div class="tab-panel" data-tab-group="492743b1c54f7607a183d082f2be3633">
|
||
<div class="tab-nav">
|
||
<div class="tab-nav-title">​</div>
|
||
<button
|
||
data-tab-item="just-colored-style"
|
||
class="tab-nav-button tab-panel-style cstyle blue active" tabindex="-1"
|
||
onclick="switchTab('492743b1c54f7607a183d082f2be3633','just-colored-style')"
|
||
>
|
||
<span class="tab-nav-text">just colored style</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="just-color"
|
||
class="tab-nav-button tab-panel-style cstyle filled" style="--VARIABLE-BOX-color: blue;"
|
||
onclick="switchTab('492743b1c54f7607a183d082f2be3633','just-color')"
|
||
>
|
||
<span class="tab-nav-text">just color</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="default-style-and-color"
|
||
class="tab-nav-button tab-panel-style cstyle default" style="--VARIABLE-BOX-color: blue;"
|
||
onclick="switchTab('492743b1c54f7607a183d082f2be3633','default-style-and-color')"
|
||
>
|
||
<span class="tab-nav-text">default style and color</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="just-severity-stylefa-fw-fas-fa-info-circle"
|
||
class="tab-nav-button tab-panel-style cstyle info"
|
||
onclick="switchTab('492743b1c54f7607a183d082f2be3633','just-severity-stylefa-fw-fas-fa-info-circle')"
|
||
>
|
||
<span class="tab-nav-text"><i class="fa-fw fas fa-info-circle"></i> just severity style</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="severity-style-and-colorfa-fw-fas-fa-info-circle"
|
||
class="tab-nav-button tab-panel-style cstyle info" style="--VARIABLE-BOX-color: blue;"
|
||
onclick="switchTab('492743b1c54f7607a183d082f2be3633','severity-style-and-colorfa-fw-fas-fa-info-circle')"
|
||
>
|
||
<span class="tab-nav-text"><i class="fa-fw fas fa-info-circle"></i> severity style and color</span>
|
||
</button>
|
||
</div>
|
||
<div class="tab-content-container">
|
||
<div
|
||
data-tab-item="just-colored-style"
|
||
class="tab-content tab-panel-style cstyle blue active">
|
||
<div class="tab-content-text">
|
||
|
||
<p>The <code>style</code> parameter is set to a color style.</p>
|
||
<p>This will set the background to a lighter version of the chosen style color as configured in your theme variant.</p>
|
||
</div>
|
||
</div>
|
||
<div
|
||
data-tab-item="just-color"
|
||
class="tab-content tab-panel-style cstyle filled" style="--VARIABLE-BOX-color: blue;">
|
||
<div class="tab-content-text">
|
||
|
||
<p>Only the <code>color</code> parameter is set.</p>
|
||
<p>This will set the background to a lighter version of the chosen CSS color value.</p>
|
||
</div>
|
||
</div>
|
||
<div
|
||
data-tab-item="default-style-and-color"
|
||
class="tab-content tab-panel-style cstyle default" style="--VARIABLE-BOX-color: blue;">
|
||
<div class="tab-content-text">
|
||
|
||
<p>The <code>style</code> parameter affects how the <code>color</code> parameter is applied.</p>
|
||
<p>The <code>default</code> style will set the background to your <code>--MAIN-BG-color</code> as configured for your theme variant resembling the default style but with different color.</p>
|
||
</div>
|
||
</div>
|
||
<div
|
||
data-tab-item="just-severity-stylefa-fw-fas-fa-info-circle"
|
||
class="tab-content tab-panel-style cstyle info">
|
||
<div class="tab-content-text">
|
||
|
||
<p>The <code>style</code> parameter is set to a severity style.</p>
|
||
<p>This will set the background to a lighter version of the chosen style color as configured in your theme variant and also affects the chosen icon.</p>
|
||
</div>
|
||
</div>
|
||
<div
|
||
data-tab-item="severity-style-and-colorfa-fw-fas-fa-info-circle"
|
||
class="tab-content tab-panel-style cstyle info" style="--VARIABLE-BOX-color: blue;">
|
||
<div class="tab-content-text">
|
||
|
||
<p>The <code>style</code> parameter affects how the <code>color</code> parameter is applied.</p>
|
||
<p>This will set the background to a lighter version of the chosen CSS color value and also affects the chosen icon.</p>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<footer class="footline">
|
||
</footer>
|
||
</article>
|
||
|
||
<article class="default">
|
||
<header class="headline">
|
||
</header>
|
||
|
||
<h1 id="tabs">Tabs</h1>
|
||
|
||
<p>The <code>tabs</code> shortcode displays arbitrary content in an unlimited number of tabs.</p>
|
||
<p>This comes in handy eg. for providing code snippets for multiple languages.</p>
|
||
<p>If you just want a single tab you can instead call the <a href="/hugo-theme-relearn/shortcodes/tab/index.html"><code>tab</code> shortcode</a> standalone.</p>
|
||
|
||
<div class="tab-panel" data-tab-group="d51736ce93f2584ad9612d5f46a8dede">
|
||
<div class="tab-nav">
|
||
<div class="tab-nav-title">hello.</div>
|
||
<button
|
||
data-tab-item="py"
|
||
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
|
||
onclick="switchTab('d51736ce93f2584ad9612d5f46a8dede','py')"
|
||
>
|
||
<span class="tab-nav-text">py</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="sh"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('d51736ce93f2584ad9612d5f46a8dede','sh')"
|
||
>
|
||
<span class="tab-nav-text">sh</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="c"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('d51736ce93f2584ad9612d5f46a8dede','c')"
|
||
>
|
||
<span class="tab-nav-text">c</span>
|
||
</button>
|
||
</div>
|
||
<div class="tab-content-container">
|
||
<div
|
||
data-tab-item="py"
|
||
class="tab-content tab-panel-style cstyle initial active">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="s2">"Hello World!"</span><span class="p">)</span></span></span></code></pre></div></div>
|
||
</div>
|
||
<div
|
||
data-tab-item="sh"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="nb">echo</span> <span class="s2">"Hello World!"</span></span></span></code></pre></div></div>
|
||
</div>
|
||
<div
|
||
data-tab-item="c"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-c" data-lang="c"><span class="line"><span class="cl"><span class="nf">printf</span><span class="p">(</span><span class="s">"Hello World!"</span><span class="p">);</span></span></span></code></pre></div></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<h2 id="usage">Usage</h2>
|
||
<p>While the examples are using shortcodes with named parameter you are free to also call this shortcode from your own partials.</p>
|
||
<p>See the <a href="/hugo-theme-relearn/shortcodes/tab/index.html"><code>tab</code> shortcode</a> for a description of the parameter for nested tabs.</p>
|
||
|
||
<div class="tab-panel" data-tab-group="shortcode-parameter">
|
||
<div class="tab-nav">
|
||
<div class="tab-nav-title">​</div>
|
||
<button
|
||
data-tab-item="shortcode"
|
||
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
|
||
onclick="switchTab('shortcode-parameter','shortcode')"
|
||
>
|
||
<span class="tab-nav-text">shortcode</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="partial"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('shortcode-parameter','partial')"
|
||
>
|
||
<span class="tab-nav-text">partial</span>
|
||
</button>
|
||
</div>
|
||
<div class="tab-content-container">
|
||
<div
|
||
data-tab-item="shortcode"
|
||
class="tab-content tab-panel-style cstyle initial active">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><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">tabs</span> <span class="nx">title</span><span class="p">=</span><span class="s">"hello."</span> <span class="p">>}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="nx">tab</span> <span class="nx">title</span><span class="p">=</span><span class="s">"py"</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="s">```python
|
||
</span></span></span><span class="line"><span class="cl"><span class="s">print("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><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="nx">tab</span> <span class="nx">title</span><span class="p">=</span><span class="s">"sh"</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="s">```bash
|
||
</span></span></span><span class="line"><span class="cl"><span class="s">echo "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><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="nx">tab</span> <span class="nx">title</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><span class="line"><span class="cl"><span class="p">{{<</span> <span class="o">/</span><span class="nx">tabs</span> <span class="p">>}}</span></span></span></code></pre></div></div>
|
||
</div>
|
||
<div
|
||
data-tab-item="partial"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><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/tabs.html"</span> <span class="p">(</span><span class="nx">dict</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"page"</span> <span class="p">.</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"title"</span> <span class="s">"hello."</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"content"</span> <span class="p">(</span><span class="nf">slice</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="p">(</span><span class="nx">dict</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"title"</span> <span class="s">"py"</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"content"</span> <span class="p">(</span><span class="s">"```python\nprint(\"Hello World!\")\n```"</span> <span class="p">|</span> <span class="p">.</span><span class="nx">RenderString</span><span class="p">)</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="p">)</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="p">(</span><span class="nx">dict</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"title"</span> <span class="s">"sh"</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"content"</span> <span class="p">(</span><span class="s">"```bash\necho \"Hello World!\"\n```"</span> <span class="p">|</span> <span class="p">.</span><span class="nx">RenderString</span><span class="p">)</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="p">)</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="p">(</span><span class="nx">dict</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">"title"</span> <span class="s">"c"</span>
|
||
</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">RenderString</span><span class="p">)</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="p">)</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="p">)</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">)}}</span></span></span></code></pre></div></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<h3 id="parameter">Parameter</h3>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Name</th>
|
||
<th>Default</th>
|
||
<th>Notes</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td><strong>groupid</strong></td>
|
||
<td><em><random></em></td>
|
||
<td>Arbitrary name of the group the tab view belongs to.<br><br>Tab views with the same <strong>groupid</strong> sychronize their selected tab. The tab selection is restored automatically based on the <code>groupid</code> for tab view. If the selected tab can not be found in a tab group the first tab is selected instead.<br><br>This sychronization applies to the whole site!</td>
|
||
</tr>
|
||
<tr>
|
||
<td><strong>style</strong></td>
|
||
<td><em><empty></em></td>
|
||
<td>Sets a default value for every contained tab. Can be overridden by each tab. See the <a href="/hugo-theme-relearn/shortcodes/tab/index.html#parameter"><code>tab</code> shortcode</a> for possible values.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><strong>color</strong></td>
|
||
<td><em><empty></em></td>
|
||
<td>Sets a default value for every contained tab. Can be overridden by each tab. See the <a href="/hugo-theme-relearn/shortcodes/tab/index.html#parameter"><code>tab</code> shortcode</a> for possible values.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><strong>title</strong></td>
|
||
<td><em><empty></em></td>
|
||
<td>Arbitrary title written in front of the tab view.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><strong>icon</strong></td>
|
||
<td><em><empty></em></td>
|
||
<td><a href="/hugo-theme-relearn/shortcodes/icon/index.html#finding-an-icon">Font Awesome icon name</a> set to the left of the title.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><em><strong><content></strong></em></td>
|
||
<td><em><empty></em></td>
|
||
<td>Arbitrary number of tabs defined with the <code>tab</code> sub-shortcode.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h2 id="examples">Examples</h2>
|
||
<h3 id="behavior-of-the-groupid">Behavior of the <code>groupid</code></h3>
|
||
<p>See what happens to the tab views while you select different tabs.</p>
|
||
<p>While pressing a tab of Group A switches all tab views of Group A in sync (if the tab is available), the tabs of Group B are left untouched.</p>
|
||
|
||
<div class="tab-panel" data-tab-group="919a1c1a97899f162993d9291a56f285">
|
||
<div class="tab-nav">
|
||
<div class="tab-nav-title">​</div>
|
||
<button
|
||
data-tab-item="group-a-tab-view-1"
|
||
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
|
||
onclick="switchTab('919a1c1a97899f162993d9291a56f285','group-a-tab-view-1')"
|
||
>
|
||
<span class="tab-nav-text">Group A, Tab View 1</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="group-a-tab-view-2"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('919a1c1a97899f162993d9291a56f285','group-a-tab-view-2')"
|
||
>
|
||
<span class="tab-nav-text">Group A, Tab View 2</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="group-b"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('919a1c1a97899f162993d9291a56f285','group-b')"
|
||
>
|
||
<span class="tab-nav-text">Group B</span>
|
||
</button>
|
||
</div>
|
||
<div class="tab-content-container">
|
||
<div
|
||
data-tab-item="group-a-tab-view-1"
|
||
class="tab-content tab-panel-style cstyle initial active">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><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">tabs</span> <span class="nx">groupid</span><span class="p">=</span><span class="s">"a"</span> <span class="p">>}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="nx">tab</span> <span class="nx">title</span><span class="p">=</span><span class="s">"json"</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{<</span> <span class="nx">highlight</span> <span class="nx">json</span> <span class="s">"linenos=true"</span> <span class="p">>}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{</span> <span class="s">"Hello"</span><span class="p">:</span> <span class="s">"World"</span> <span class="p">}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{<</span> <span class="o">/</span><span class="nx">highlight</span> <span class="p">>}}</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><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="nx">tab</span> <span class="nx">title</span><span class="p">=</span><span class="s">"_**XML**_ stuff"</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="s">```xml
|
||
</span></span></span><span class="line"><span class="cl"><span class="s"><Hello>World</Hello>
|
||
</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><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="nx">tab</span> <span class="nx">title</span><span class="p">=</span><span class="s">"text"</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">Hello</span> <span class="nx">World</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><span class="line"><span class="cl"><span class="p">{{<</span> <span class="o">/</span><span class="nx">tabs</span> <span class="p">>}}</span></span></span></code></pre></div></div>
|
||
</div>
|
||
<div
|
||
data-tab-item="group-a-tab-view-2"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><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">tabs</span> <span class="nx">groupid</span><span class="p">=</span><span class="s">"a"</span> <span class="p">>}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="nx">tab</span> <span class="nx">title</span><span class="p">=</span><span class="s">"json"</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{<</span> <span class="nx">highlight</span> <span class="nx">json</span> <span class="s">"linenos=true"</span> <span class="p">>}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{</span> <span class="s">"Hello"</span><span class="p">:</span> <span class="s">"World"</span> <span class="p">}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{<</span> <span class="o">/</span><span class="nx">highlight</span> <span class="p">>}}</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><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="nx">tab</span> <span class="nx">title</span><span class="p">=</span><span class="s">"XML stuff"</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="s">```xml
|
||
</span></span></span><span class="line"><span class="cl"><span class="s"><Hello>World</Hello>
|
||
</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><span class="line"><span class="cl"><span class="p">{{<</span> <span class="o">/</span><span class="nx">tabs</span> <span class="p">>}}</span></span></span></code></pre></div></div>
|
||
</div>
|
||
<div
|
||
data-tab-item="group-b"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><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">tabs</span> <span class="nx">groupid</span><span class="p">=</span><span class="s">"b"</span> <span class="p">>}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="nx">tab</span> <span class="nx">title</span><span class="p">=</span><span class="s">"json"</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{<</span> <span class="nx">highlight</span> <span class="nx">json</span> <span class="s">"linenos=true"</span> <span class="p">>}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{</span> <span class="s">"Hello"</span><span class="p">:</span> <span class="s">"World"</span> <span class="p">}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{<</span> <span class="o">/</span><span class="nx">highlight</span> <span class="p">>}}</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><span class="line"><span class="cl"><span class="p">{{</span><span class="o">%</span> <span class="nx">tab</span> <span class="nx">title</span><span class="p">=</span><span class="s">"XML stuff"</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="s">```xml
|
||
</span></span></span><span class="line"><span class="cl"><span class="s"><Hello>World</Hello>
|
||
</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><span class="line"><span class="cl"><span class="p">{{<</span> <span class="o">/</span><span class="nx">tabs</span> <span class="p">>}}</span></span></span></code></pre></div></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<h4 id="group-a-tab-view-1">Group A, Tab View 1</h4>
|
||
|
||
<div class="tab-panel" data-tab-group="tab-example-a">
|
||
<div class="tab-nav">
|
||
<div class="tab-nav-title">​</div>
|
||
<button
|
||
data-tab-item="json"
|
||
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
|
||
onclick="switchTab('tab-example-a','json')"
|
||
>
|
||
<span class="tab-nav-text">json</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="xml-stuff"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('tab-example-a','xml-stuff')"
|
||
>
|
||
<span class="tab-nav-text"><em><strong>XML</strong></em> stuff</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="text"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('tab-example-a','text')"
|
||
>
|
||
<span class="tab-nav-text">text</span>
|
||
</button>
|
||
</div>
|
||
<div class="tab-content-container">
|
||
<div
|
||
data-tab-item="json"
|
||
class="tab-content tab-panel-style cstyle initial active">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code" linenos="true"><pre tabindex="0" class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="ln">1</span><span class="cl"><span class="p">{</span> <span class="nt">"Hello"</span><span class="p">:</span> <span class="s2">"World"</span> <span class="p">}</span></span></span></code></pre></div>
|
||
</div>
|
||
</div>
|
||
<div
|
||
data-tab-item="xml-stuff"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-xml" data-lang="xml"><span class="line"><span class="cl"><span class="nt"><Hello></span>World<span class="nt"></Hello></span></span></span></code></pre></div></div>
|
||
</div>
|
||
<div
|
||
data-tab-item="text"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<pre><code>Hello World
|
||
</code></pre>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<h4 id="group-a-tab-view-2">Group A, Tab View 2</h4>
|
||
|
||
<div class="tab-panel" data-tab-group="tab-example-a">
|
||
<div class="tab-nav">
|
||
<div class="tab-nav-title">​</div>
|
||
<button
|
||
data-tab-item="json"
|
||
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
|
||
onclick="switchTab('tab-example-a','json')"
|
||
>
|
||
<span class="tab-nav-text">json</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="xml-stuff"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('tab-example-a','xml-stuff')"
|
||
>
|
||
<span class="tab-nav-text">XML stuff</span>
|
||
</button>
|
||
</div>
|
||
<div class="tab-content-container">
|
||
<div
|
||
data-tab-item="json"
|
||
class="tab-content tab-panel-style cstyle initial active">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code" linenos="true"><pre tabindex="0" class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="ln">1</span><span class="cl"><span class="p">{</span> <span class="nt">"Hello"</span><span class="p">:</span> <span class="s2">"World"</span> <span class="p">}</span></span></span></code></pre></div>
|
||
</div>
|
||
</div>
|
||
<div
|
||
data-tab-item="xml-stuff"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-xml" data-lang="xml"><span class="line"><span class="cl"><span class="nt"><Hello></span>World<span class="nt"></Hello></span></span></span></code></pre></div></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<h4 id="group-b">Group B</h4>
|
||
|
||
<div class="tab-panel" data-tab-group="tab-example-b">
|
||
<div class="tab-nav">
|
||
<div class="tab-nav-title">​</div>
|
||
<button
|
||
data-tab-item="json"
|
||
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
|
||
onclick="switchTab('tab-example-b','json')"
|
||
>
|
||
<span class="tab-nav-text">json</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="xml-stuff"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('tab-example-b','xml-stuff')"
|
||
>
|
||
<span class="tab-nav-text">XML stuff</span>
|
||
</button>
|
||
</div>
|
||
<div class="tab-content-container">
|
||
<div
|
||
data-tab-item="json"
|
||
class="tab-content tab-panel-style cstyle initial active">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code" linenos="true"><pre tabindex="0" class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="ln">1</span><span class="cl"><span class="p">{</span> <span class="nt">"Hello"</span><span class="p">:</span> <span class="s2">"World"</span> <span class="p">}</span></span></span></code></pre></div>
|
||
</div>
|
||
</div>
|
||
<div
|
||
data-tab-item="xml-stuff"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-xml" data-lang="xml"><span class="line"><span class="cl"><span class="nt"><Hello></span>World<span class="nt"></Hello></span></span></span></code></pre></div></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<h3 id="nested-tab-views-and-color">Nested Tab Views and Color</h3>
|
||
<p>In case you want to nest tab views, the parent tab that contains nested tab views needs to be declared with <code>{{< tab >}}</code> instead of <code>{{% tab %}}</code>. Note, that in this case it is not possible to put markdown in the parent tab.</p>
|
||
<p>You can also set style and color parameter for all tabs and overwrite them on tab level. See the <a href="/hugo-theme-relearn/shortcodes/tab/index.html#parameter"><code>tab</code> shortcode</a> for possible values.</p>
|
||
<div class="highlight wrap-code"><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">tabs</span> <span class="nx">groupid</span><span class="p">=</span><span class="s">"main"</span> <span class="nx">style</span><span class="p">=</span><span class="s">"primary"</span> <span class="nx">title</span><span class="p">=</span><span class="s">"Rationale"</span> <span class="nx">icon</span><span class="p">=</span><span class="s">"thumbtack"</span> <span class="p">>}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{<</span> <span class="nx">tab</span> <span class="nx">title</span><span class="p">=</span><span class="s">"Text"</span> <span class="p">>}}</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">Simple</span> <span class="nx">text</span> <span class="nx">is</span> <span class="nx">possible</span> <span class="nx">here</span><span class="o">...</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="p">{{<</span> <span class="nx">tabs</span> <span class="nx">groupid</span><span class="p">=</span><span class="s">"tabs-example-language"</span> <span class="p">>}}</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="p">{{</span><span class="o">%</span> <span class="nx">tab</span> <span class="nx">title</span><span class="p">=</span><span class="s">"python"</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">Python</span> <span class="nx">is</span> <span class="o">**</span><span class="nx">super</span><span class="o">**</span> <span class="nx">easy</span><span class="p">.</span>
|
||
</span></span><span class="line"><span class="cl">
|
||
</span></span><span class="line"><span class="cl"> <span class="o">-</span> <span class="nx">most</span> <span class="nx">of</span> <span class="nx">the</span> <span class="nx">time</span><span class="p">.</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="o">-</span> <span class="k">if</span> <span class="nx">you</span> <span class="nx">don</span><span class="err">'</span><span class="nx">t</span> <span class="nx">want</span> <span class="nx">to</span> <span class="nx">output</span> <span class="nx">unicode</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><span class="line"><span class="cl"> <span class="p">{{</span><span class="o">%</span> <span class="nx">tab</span> <span class="nx">title</span><span class="p">=</span><span class="s">"bash"</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="nx">Bash</span> <span class="nx">is</span> <span class="k">for</span> <span class="o">**</span><span class="nx">hackers</span><span class="o">**</span><span class="p">.</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><span class="line"><span class="cl"> <span class="p">{{<</span> <span class="o">/</span><span class="nx">tabs</span> <span class="p">>}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{<</span> <span class="o">/</span><span class="nx">tab</span> <span class="p">>}}</span>
|
||
</span></span><span class="line"><span class="cl">
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{<</span> <span class="nx">tab</span> <span class="nx">title</span><span class="p">=</span><span class="s">"Code"</span> <span class="nx">style</span><span class="p">=</span><span class="s">"default"</span> <span class="nx">color</span><span class="p">=</span><span class="s">"darkorchid"</span> <span class="p">>}}</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="o">...</span><span class="nx">but</span> <span class="nx">no</span> <span class="nx">markdown</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="p">{{<</span> <span class="nx">tabs</span> <span class="nx">groupid</span><span class="p">=</span><span class="s">"tabs-example-language"</span> <span class="p">>}}</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="p">{{</span><span class="o">%</span> <span class="nx">tab</span> <span class="nx">title</span><span class="p">=</span><span class="s">"python"</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">```python
|
||
</span></span></span><span class="line"><span class="cl"><span class="s"> print("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><span class="line"><span class="cl"> <span class="p">{{</span><span class="o">%</span> <span class="nx">tab</span> <span class="nx">title</span><span class="p">=</span><span class="s">"bash"</span> <span class="o">%</span><span class="p">}}</span>
|
||
</span></span><span class="line"><span class="cl"> <span class="s">```bash
|
||
</span></span></span><span class="line"><span class="cl"><span class="s"> echo "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><span class="line"><span class="cl"> <span class="p">{{<</span> <span class="o">/</span><span class="nx">tabs</span> <span class="p">>}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{<</span> <span class="o">/</span><span class="nx">tab</span> <span class="p">>}}</span>
|
||
</span></span><span class="line"><span class="cl"><span class="p">{{<</span> <span class="o">/</span><span class="nx">tabs</span> <span class="p">>}}</span></span></span></code></pre></div>
|
||
<div class="tab-panel" data-tab-group="main">
|
||
<div class="tab-nav">
|
||
<div class="tab-nav-title"><i class="fa-fw fas fa-thumbtack"></i> Rationale</div>
|
||
<button
|
||
data-tab-item="text"
|
||
class="tab-nav-button tab-panel-style cstyle primary active" tabindex="-1"
|
||
onclick="switchTab('main','text')"
|
||
>
|
||
<span class="tab-nav-text">Text</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="code"
|
||
class="tab-nav-button tab-panel-style cstyle default" style="--VARIABLE-BOX-color: darkorchid;"
|
||
onclick="switchTab('main','code')"
|
||
>
|
||
<span class="tab-nav-text">Code</span>
|
||
</button>
|
||
</div>
|
||
<div class="tab-content-container">
|
||
<div
|
||
data-tab-item="text"
|
||
class="tab-content tab-panel-style cstyle primary active">
|
||
<div class="tab-content-text">
|
||
<p>
|
||
|
||
Simple text is possible here...
|
||
|
||
<div class="tab-panel" data-tab-group="tabs-example-language">
|
||
<div class="tab-nav">
|
||
<div class="tab-nav-title">​</div>
|
||
<button
|
||
data-tab-item="python"
|
||
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
|
||
onclick="switchTab('tabs-example-language','python')"
|
||
>
|
||
<span class="tab-nav-text">python</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="bash"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('tabs-example-language','bash')"
|
||
>
|
||
<span class="tab-nav-text">bash</span>
|
||
</button>
|
||
</div>
|
||
<div class="tab-content-container">
|
||
<div
|
||
data-tab-item="python"
|
||
class="tab-content tab-panel-style cstyle initial active">
|
||
<div class="tab-content-text">
|
||
|
||
<p>Python is <strong>super</strong> easy.</p>
|
||
<ul>
|
||
<li>most of the time.</li>
|
||
<li>if you don’t want to output unicode</li>
|
||
</ul>
|
||
</div>
|
||
</div>
|
||
<div
|
||
data-tab-item="bash"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<p>Bash is for <strong>hackers</strong>.</p>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div
|
||
data-tab-item="code"
|
||
class="tab-content tab-panel-style cstyle default" style="--VARIABLE-BOX-color: darkorchid;">
|
||
<div class="tab-content-text">
|
||
<p>
|
||
|
||
...but no markdown
|
||
|
||
<div class="tab-panel" data-tab-group="tabs-example-language">
|
||
<div class="tab-nav">
|
||
<div class="tab-nav-title">​</div>
|
||
<button
|
||
data-tab-item="python"
|
||
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
|
||
onclick="switchTab('tabs-example-language','python')"
|
||
>
|
||
<span class="tab-nav-text">python</span>
|
||
</button>
|
||
<button
|
||
data-tab-item="bash"
|
||
class="tab-nav-button tab-panel-style cstyle initial"
|
||
onclick="switchTab('tabs-example-language','bash')"
|
||
>
|
||
<span class="tab-nav-text">bash</span>
|
||
</button>
|
||
</div>
|
||
<div class="tab-content-container">
|
||
<div
|
||
data-tab-item="python"
|
||
class="tab-content tab-panel-style cstyle initial active">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="s2">"Hello World!"</span><span class="p">)</span></span></span></code></pre></div></div>
|
||
</div>
|
||
<div
|
||
data-tab-item="bash"
|
||
class="tab-content tab-panel-style cstyle initial">
|
||
<div class="tab-content-text">
|
||
|
||
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="nb">echo</span> <span class="s2">"Hello World!"</span></span></span></code></pre></div></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<footer class="footline">
|
||
</footer>
|
||
</article>
|
||
|
||
</section>
|
||
</div>
|
||
</main>
|
||
</div>
|
||
<script src="/hugo-theme-relearn/js/clipboard.min.js?1713902894" defer></script>
|
||
<script src="/hugo-theme-relearn/js/perfect-scrollbar.min.js?1713902894" defer></script>
|
||
<script>
|
||
function useMathJax( config ){
|
||
window.MathJax = Object.assign( window.MathJax || {}, {
|
||
tex: {
|
||
inlineMath: [['\\(', '\\)'], ['$', '$']],
|
||
displayMath: [['\\[', '\\]'], ['$$', '$$']],
|
||
},
|
||
options: {
|
||
enableMenu: false
|
||
}
|
||
}, config );
|
||
}
|
||
useMathJax( JSON.parse("{}") );
|
||
</script>
|
||
<script id="MathJax-script" async src="/hugo-theme-relearn/js/mathjax/tex-mml-chtml.js?1713902894"></script>
|
||
<script src="/hugo-theme-relearn/js/d3/d3-color.min.js?1713902894" defer></script>
|
||
<script src="/hugo-theme-relearn/js/d3/d3-dispatch.min.js?1713902894" defer></script>
|
||
<script src="/hugo-theme-relearn/js/d3/d3-drag.min.js?1713902894" defer></script>
|
||
<script src="/hugo-theme-relearn/js/d3/d3-ease.min.js?1713902894" defer></script>
|
||
<script src="/hugo-theme-relearn/js/d3/d3-interpolate.min.js?1713902894" defer></script>
|
||
<script src="/hugo-theme-relearn/js/d3/d3-selection.min.js?1713902894" defer></script>
|
||
<script src="/hugo-theme-relearn/js/d3/d3-timer.min.js?1713902894" defer></script>
|
||
<script src="/hugo-theme-relearn/js/d3/d3-transition.min.js?1713902894" defer></script>
|
||
<script src="/hugo-theme-relearn/js/d3/d3-zoom.min.js?1713902894" defer></script>
|
||
<script src="/hugo-theme-relearn/js/js-yaml.min.js?1713902894" defer></script>
|
||
<script src="/hugo-theme-relearn/js/mermaid.min.js?1713902894" defer></script>
|
||
<script>
|
||
window.themeUseMermaid = JSON.parse("{ \"securityLevel\": \"loose\" }");
|
||
</script>
|
||
<script src="/hugo-theme-relearn/js/js-yaml.min.js?1713902894" defer></script>
|
||
<script>window.noZensmooth = true;</script>
|
||
<script src="/hugo-theme-relearn/js/swagger-ui/swagger-ui-bundle.js?1713902894" defer></script>
|
||
<script src="/hugo-theme-relearn/js/swagger-ui/swagger-ui-standalone-preset.js?1713902894" defer></script>
|
||
<script>
|
||
window.themeUseOpenapi = { css: "/js/swagger-ui/swagger-ui.css?1713902894", cssInProject: true, assetsBuster: 1713902894 };
|
||
</script>
|
||
<script src="/hugo-theme-relearn/js/theme.js?1713902894" defer></script>
|
||
</body>
|
||
</html>
|