381 lines
17 KiB
HTML
381 lines
17 KiB
HTML
<!doctype html>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<html
|
||
class="not-ready lg:text-base"
|
||
style="--bg:"
|
||
lang="en"
|
||
dir="ltr"
|
||
><head>
|
||
<meta charset="utf-8" />
|
||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||
<meta
|
||
name="viewport"
|
||
content="width=device-width, initial-scale=1, shrink-to-fit=no"
|
||
/>
|
||
|
||
|
||
<title>Markdown Syntax Guide - </title>
|
||
|
||
|
||
<meta name="theme-color" />
|
||
|
||
<meta name="description" content="This article offers a sample of basic Markdown syntax that can be used in Hugo content files, also it shows whether basic HTML elements are decorated with CSS in a Hugo theme." />
|
||
<meta name="author" content="lee.so" /><link rel="preload stylesheet" as="style" href="/main.min.css" />
|
||
|
||
|
||
<link rel="preload" as="image" href="/theme.png" />
|
||
|
||
|
||
|
||
<link rel="preload" as="image" href="/github.svg" /><link rel="preload" as="image" href="/mastodon.svg" />
|
||
|
||
<script
|
||
defer
|
||
src="/highlight.min.js"
|
||
onload="hljs.initHighlightingOnLoad();"
|
||
></script>
|
||
|
||
|
||
<link
|
||
rel="icon"
|
||
href="/favicon.ico"
|
||
/>
|
||
<link
|
||
rel="apple-touch-icon"
|
||
href="/apple-touch-icon.png"
|
||
/>
|
||
|
||
<meta name="generator" content="Hugo 0.149.0">
|
||
<script async src="https://www.googletagmanager.com/gtag/js?id=G-ZZYG7KM2RT"></script>
|
||
<script>
|
||
var doNotTrack = false;
|
||
if ( false ) {
|
||
var dnt = (navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack);
|
||
var doNotTrack = (dnt == "1" || dnt == "yes");
|
||
}
|
||
if (!doNotTrack) {
|
||
window.dataLayer = window.dataLayer || [];
|
||
function gtag(){dataLayer.push(arguments);}
|
||
gtag('js', new Date());
|
||
gtag('config', 'G-ZZYG7KM2RT');
|
||
}
|
||
</script>
|
||
<meta itemprop="name" content="Markdown Syntax Guide">
|
||
<meta itemprop="description" content="Sample article showcasing basic Markdown syntax and formatting for HTML elements.">
|
||
<meta itemprop="datePublished" content="2019-03-11T00:00:00+00:00">
|
||
<meta itemprop="dateModified" content="2019-03-11T00:00:00+00:00">
|
||
<meta itemprop="wordCount" content="445">
|
||
<meta itemprop="keywords" content="Markdown,Css,Html"><meta property="og:url" content="/post/markdown-syntax/">
|
||
<meta property="og:title" content="Markdown Syntax Guide">
|
||
<meta property="og:description" content="Sample article showcasing basic Markdown syntax and formatting for HTML elements.">
|
||
<meta property="og:locale" content="en">
|
||
<meta property="og:type" content="article">
|
||
<meta property="article:section" content="post">
|
||
<meta property="article:published_time" content="2019-03-11T00:00:00+00:00">
|
||
<meta property="article:modified_time" content="2019-03-11T00:00:00+00:00">
|
||
<meta property="article:tag" content="Markdown">
|
||
<meta property="article:tag" content="Css">
|
||
<meta property="article:tag" content="Html">
|
||
|
||
<meta name="twitter:card" content="summary">
|
||
<meta name="twitter:title" content="Markdown Syntax Guide">
|
||
<meta name="twitter:description" content="Sample article showcasing basic Markdown syntax and formatting for HTML elements.">
|
||
|
||
<link rel="canonical" href="/post/markdown-syntax/" />
|
||
</head>
|
||
<body
|
||
class="bg-(--bg) text-black antialiased duration-200 ease-out [-webkit-tap-highlight-color:transparent] dark:text-white"
|
||
><header
|
||
class="mx-auto flex h-[4.5rem] max-w-(--w) px-8 whitespace-nowrap lg:justify-center"
|
||
>
|
||
<div class="relative z-50 flex items-center ltr:mr-auto rtl:ml-auto">
|
||
<a
|
||
class="-translate-y-[1px] text-2xl font-medium"
|
||
href="/"
|
||
></a
|
||
>
|
||
<div
|
||
class="btn-dark text-[0px] ltr:ml-4 rtl:mr-4 h-6 w-6 shrink-0 cursor-pointer [background:url(./theme.png)_left_center/_auto_theme('spacing.6')_no-repeat] [transition:_background-position_0.4s_steps(5)] dark:[background-position:right]"
|
||
role="button"
|
||
aria-label="Dark"
|
||
></div>
|
||
</div>
|
||
|
||
<div
|
||
class="btn-menu relative z-50 flex h-[4.5rem] w-[5rem] shrink-0 cursor-pointer flex-col items-center justify-center gap-2.5 lg:hidden ltr:-mr-8 rtl:-ml-8"
|
||
role="button"
|
||
aria-label="Menu"
|
||
></div>
|
||
|
||
<script>
|
||
|
||
const htmlClass = document.documentElement.classList;
|
||
setTimeout(() => {
|
||
htmlClass.remove('not-ready');
|
||
}, 10);
|
||
|
||
|
||
const btnMenu = document.querySelector('.btn-menu');
|
||
btnMenu.addEventListener('click', () => {
|
||
htmlClass.toggle('open');
|
||
});
|
||
|
||
|
||
const metaTheme = document.querySelector('meta[name="theme-color"]');
|
||
const lightBg = ''.replace(/"/g, '');
|
||
const setDark = (isDark) => {
|
||
metaTheme.setAttribute('content', isDark ? '#000' : lightBg);
|
||
htmlClass[isDark ? 'add' : 'remove']('dark');
|
||
localStorage.setItem('dark', isDark);
|
||
};
|
||
|
||
|
||
const darkScheme = window.matchMedia('(prefers-color-scheme: dark)');
|
||
if (htmlClass.contains('dark')) {
|
||
setDark(true);
|
||
} else {
|
||
const darkVal = localStorage.getItem('dark');
|
||
setDark(darkVal ? darkVal === 'true' : darkScheme.matches);
|
||
}
|
||
|
||
|
||
darkScheme.addEventListener('change', (event) => {
|
||
setDark(event.matches);
|
||
});
|
||
|
||
|
||
const btnDark = document.querySelector('.btn-dark');
|
||
btnDark.addEventListener('click', () => {
|
||
setDark(localStorage.getItem('dark') !== 'true');
|
||
});
|
||
</script>
|
||
|
||
<div
|
||
class="nav-wrapper fixed inset-x-0 top-full z-40 flex h-full flex-col justify-center bg-(--bg) pb-16 duration-200 select-none lg:static lg:h-auto lg:flex-row lg:bg-transparent! lg:pb-0 lg:transition-none"
|
||
><nav
|
||
class="lg:ml-12 lg:flex lg:flex-row lg:items-center lg:space-x-10 rtl:space-x-reverse"
|
||
><a
|
||
class="block text-center text-xl leading-[5rem] lg:text-base lg:font-normal"
|
||
href="/pages/"
|
||
>Pages</a
|
||
><a
|
||
class="block text-center text-xl leading-[5rem] lg:text-base lg:font-normal"
|
||
href="/blogs/"
|
||
>Blogs</a
|
||
><a
|
||
class="block text-center text-xl leading-[5rem] lg:text-base lg:font-normal"
|
||
href="/"
|
||
>Home</a
|
||
><a
|
||
class="block text-center text-xl leading-[5rem] lg:text-base lg:font-normal"
|
||
href="https://mathdoggy.gitnet.page/"
|
||
>Mathrew Xian</a
|
||
></nav><nav
|
||
class="mt-12 flex justify-center space-x-10 lg:mt-0 lg:items-center ltr:lg:ml-14 rtl:space-x-reverse rtl:lg:mr-14 dark:invert"
|
||
>
|
||
<a
|
||
class="h-7 w-7 text-[0px] [background:var(--url)_center_center/cover_no-repeat] lg:h-6 lg:w-6"
|
||
style="--url: url(./github.svg)"
|
||
href="https://github.com/mathdoggy"
|
||
target="_blank"
|
||
rel="me"
|
||
>github</a>
|
||
<a
|
||
class="h-7 w-7 text-[0px] [background:var(--url)_center_center/cover_no-repeat] lg:h-6 lg:w-6"
|
||
style="--url: url(./mastodon.svg)"
|
||
href="@mstdn.plus@mathdoggy"
|
||
target="_blank"
|
||
rel="me"
|
||
>mastodon</a>
|
||
</nav>
|
||
</div>
|
||
</header>
|
||
<main
|
||
class="prose prose-neutral dark:prose-invert relative mx-auto min-h-[calc(100vh-9rem)] max-w-(--w) px-8 pt-14 pb-16"
|
||
><article>
|
||
<header class="mb-14">
|
||
<h1 class="my-0! pb-2.5">Markdown Syntax Guide</h1><div class="text-xs antialiased opacity-60"><time>Mar 11, 2019</time><span class="mx-1">·</span>
|
||
<span>lee.so</span></div></header>
|
||
|
||
<section><p>This article offers a sample of basic Markdown syntax that can be used in Hugo content files, also it shows whether basic HTML elements are decorated with CSS in a Hugo theme.</p>
|
||
<h2 id="headings">Headings</h2>
|
||
<p>The following HTML <code><h1></code>—<code><h6></code> elements represent six levels of section headings. <code><h1></code> is the highest section level while <code><h6></code> is the lowest.</p>
|
||
<h1 id="h1">H1</h1>
|
||
<h2 id="h2">H2</h2>
|
||
<h3 id="h3">H3</h3>
|
||
<h4 id="h4">H4</h4>
|
||
<h5 id="h5">H5</h5>
|
||
<h6 id="h6">H6</h6>
|
||
<h2 id="paragraph">Paragraph</h2>
|
||
<p>Xerum, quo qui aut unt expliquam qui dolut labo. Aque venitatiusda cum, voluptionse latur sitiae dolessi aut parist aut dollo enim qui voluptate ma dolestendit peritin re plis aut quas inctum laceat est volestemque commosa as cus endigna tectur, offic to cor sequas etum rerum idem sintibus eiur? Quianimin porecus evelectur, cum que nis nust voloribus ratem aut omnimi, sitatur? Quiatem. Nam, omnis sum am facea corem alique molestrunt et eos evelece arcillit ut aut eos eos nus, sin conecerem erum fuga. Ri oditatquam, ad quibus unda veliamenimin cusam et facea ipsamus es exerum sitate dolores editium rerore eost, temped molorro ratiae volorro te reribus dolorer sperchicium faceata tiustia prat.</p>
|
||
<p>Itatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne sapicia is sinveli squiatum, core et que aut hariosam ex eat.</p>
|
||
<h2 id="blockquotes">Blockquotes</h2>
|
||
<p>The blockquote element represents content that is quoted from another source, optionally with a citation which must be within a <code>footer</code> or <code>cite</code> element, and optionally with in-line changes such as annotations and abbreviations.</p>
|
||
<h4 id="blockquote-without-attribution">Blockquote without attribution</h4>
|
||
<blockquote>
|
||
<p>Tiam, ad mint andaepu dandae nostion secatur sequo quae.
|
||
<strong>Note</strong> that you can use <em>Markdown syntax</em> within a blockquote.</p></blockquote>
|
||
<h4 id="blockquote-with-attribution">Blockquote with attribution</h4>
|
||
<blockquote>
|
||
<p>Don’t communicate by sharing memory, share memory by communicating.<!-- raw HTML omitted -->
|
||
— <!-- raw HTML omitted -->Rob Pike<sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup><!-- raw HTML omitted --></p></blockquote>
|
||
<h2 id="tables">Tables</h2>
|
||
<p>Tables aren’t part of the core Markdown spec, but Hugo supports supports them out-of-the-box.</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Name</th>
|
||
<th>Age</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>Bob</td>
|
||
<td>27</td>
|
||
</tr>
|
||
<tr>
|
||
<td>Alice</td>
|
||
<td>23</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h4 id="inline-markdown-within-tables">Inline Markdown within tables</h4>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Italics</th>
|
||
<th>Bold</th>
|
||
<th>Code</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td><em>italics</em></td>
|
||
<td><strong>bold</strong></td>
|
||
<td><code>code</code></td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h2 id="code-blocks">Code Blocks</h2>
|
||
<h4 id="code-block-with-backticks">Code block with backticks</h4>
|
||
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-html" data-lang="html"><span style="display:flex;"><span><span style="color:#75715e"><!doctype html></span>
|
||
</span></span><span style="display:flex;"><span><<span style="color:#f92672">html</span> <span style="color:#a6e22e">lang</span><span style="color:#f92672">=</span><span style="color:#e6db74">"en"</span>>
|
||
</span></span><span style="display:flex;"><span> <<span style="color:#f92672">head</span>>
|
||
</span></span><span style="display:flex;"><span> <<span style="color:#f92672">meta</span> <span style="color:#a6e22e">charset</span><span style="color:#f92672">=</span><span style="color:#e6db74">"utf-8"</span> />
|
||
</span></span><span style="display:flex;"><span> <<span style="color:#f92672">title</span>>Example HTML5 Document</<span style="color:#f92672">title</span>>
|
||
</span></span><span style="display:flex;"><span> </<span style="color:#f92672">head</span>>
|
||
</span></span><span style="display:flex;"><span> <<span style="color:#f92672">body</span>>
|
||
</span></span><span style="display:flex;"><span> <<span style="color:#f92672">p</span>>Test</<span style="color:#f92672">p</span>>
|
||
</span></span><span style="display:flex;"><span> </<span style="color:#f92672">body</span>>
|
||
</span></span><span style="display:flex;"><span></<span style="color:#f92672">html</span>>
|
||
</span></span></code></pre></div><h4 id="code-block-indented-with-four-spaces">Code block indented with four spaces</h4>
|
||
<pre><code><!doctype html>
|
||
<html lang="en">
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<title>Example HTML5 Document</title>
|
||
</head>
|
||
<body>
|
||
<p>Test</p>
|
||
</body>
|
||
</html>
|
||
</code></pre>
|
||
<h4 id="code-block-with-hugos-internal-highlight-shortcode">Code block with Hugo’s internal highlight shortcode</h4>
|
||
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-html" data-lang="html"><span style="display:flex;"><span><span style="color:#75715e"><!doctype html></span>
|
||
</span></span><span style="display:flex;"><span><<span style="color:#f92672">html</span> <span style="color:#a6e22e">lang</span><span style="color:#f92672">=</span><span style="color:#e6db74">"en"</span>>
|
||
</span></span><span style="display:flex;"><span><<span style="color:#f92672">head</span>>
|
||
</span></span><span style="display:flex;"><span> <<span style="color:#f92672">meta</span> <span style="color:#a6e22e">charset</span><span style="color:#f92672">=</span><span style="color:#e6db74">"utf-8"</span>>
|
||
</span></span><span style="display:flex;"><span> <<span style="color:#f92672">title</span>>Example HTML5 Document</<span style="color:#f92672">title</span>>
|
||
</span></span><span style="display:flex;"><span></<span style="color:#f92672">head</span>>
|
||
</span></span><span style="display:flex;"><span><<span style="color:#f92672">body</span>>
|
||
</span></span><span style="display:flex;"><span> <<span style="color:#f92672">p</span>>Test</<span style="color:#f92672">p</span>>
|
||
</span></span><span style="display:flex;"><span></<span style="color:#f92672">body</span>>
|
||
</span></span><span style="display:flex;"><span></<span style="color:#f92672">html</span>></span></span></code></pre></div>
|
||
<h2 id="list-types">List Types</h2>
|
||
<h4 id="ordered-list">Ordered List</h4>
|
||
<ol>
|
||
<li>First item</li>
|
||
<li>Second item</li>
|
||
<li>Third item</li>
|
||
</ol>
|
||
<h4 id="unordered-list">Unordered List</h4>
|
||
<ul>
|
||
<li>List item</li>
|
||
<li>Another item</li>
|
||
<li>And another item</li>
|
||
</ul>
|
||
<h4 id="nested-list">Nested list</h4>
|
||
<ul>
|
||
<li>Fruit
|
||
<ul>
|
||
<li>Apple</li>
|
||
<li>Orange</li>
|
||
<li>Banana</li>
|
||
</ul>
|
||
</li>
|
||
<li>Dairy
|
||
<ul>
|
||
<li>Milk</li>
|
||
<li>Cheese</li>
|
||
</ul>
|
||
</li>
|
||
</ul>
|
||
<h2 id="other-elements--abbr-sub-sup-kbd-mark">Other Elements — abbr, sub, sup, kbd, mark</h2>
|
||
<p><!-- raw HTML omitted -->GIF<!-- raw HTML omitted --> is a bitmap image format.</p>
|
||
<p>H<!-- raw HTML omitted -->2<!-- raw HTML omitted -->O</p>
|
||
<p>X<!-- raw HTML omitted -->n<!-- raw HTML omitted --> + Y<!-- raw HTML omitted -->n<!-- raw HTML omitted --> = Z<!-- raw HTML omitted -->n<!-- raw HTML omitted --></p>
|
||
<p>Press <!-- raw HTML omitted --><!-- raw HTML omitted -->CTRL<!-- raw HTML omitted -->+<!-- raw HTML omitted -->ALT<!-- raw HTML omitted -->+<!-- raw HTML omitted -->Delete<!-- raw HTML omitted --><!-- raw HTML omitted --> to end the session.</p>
|
||
<p>Most <!-- raw HTML omitted -->salamanders<!-- raw HTML omitted --> are nocturnal, and hunt for insects, worms, and other small creatures.</p>
|
||
<div class="footnotes" role="doc-endnotes">
|
||
<hr>
|
||
<ol>
|
||
<li id="fn:1">
|
||
<p>The above quote is excerpted from Rob Pike’s <a href="https://www.youtube.com/watch?v=PAAkCSZUG1c">talk</a> during Gopherfest, November 18, 2015. <a href="#fnref:1" class="footnote-backref" role="doc-backlink">↩︎</a></p>
|
||
</li>
|
||
</ol>
|
||
</div></section>
|
||
|
||
<footer class="mt-12 flex flex-wrap"><a
|
||
class="mb-1.5 rounded-lg bg-black/[3%] px-5 py-1 no-underline hover:bg-black/[6%] ltr:mr-1.5 rtl:ml-1.5 dark:bg-white/[8%] dark:hover:bg-white/[12%]"
|
||
href="/tags/markdown"
|
||
>markdown</a
|
||
><a
|
||
class="mb-1.5 rounded-lg bg-black/[3%] px-5 py-1 no-underline hover:bg-black/[6%] ltr:mr-1.5 rtl:ml-1.5 dark:bg-white/[8%] dark:hover:bg-white/[12%]"
|
||
href="/tags/css"
|
||
>css</a
|
||
><a
|
||
class="mb-1.5 rounded-lg bg-black/[3%] px-5 py-1 no-underline hover:bg-black/[6%] ltr:mr-1.5 rtl:ml-1.5 dark:bg-white/[8%] dark:hover:bg-white/[12%]"
|
||
href="/tags/html"
|
||
>html</a
|
||
></footer><nav
|
||
class="mt-24 flex overflow-hidden rounded-xl bg-black/[3%] text-lg leading-[1.2]! *:flex *:w-1/2 *:items-center *:p-5 *:font-medium *:no-underline dark:bg-white/[8%] [&>*:hover]:bg-black/[2%] dark:[&>*:hover]:bg-white/[3%]"
|
||
><a class="ltr:pr-3 rtl:pl-3" href="/post/placeholder-text/"
|
||
><span class="ltr:mr-1.5 rtl:ml-1.5">←</span><span>Placeholder Text</span></a
|
||
><a
|
||
class="justify-end pl-3 ltr:ml-auto rtl:mr-auto"
|
||
href="/post/rich-content/"
|
||
><span>Rich Content</span><span class="ltr:ml-1.5 rtl:mr-1.5">→</span></a
|
||
></nav></article></main><footer
|
||
class="mx-auto flex h-[4.5rem] max-w-(--w) items-center px-8 text-xs tracking-wider uppercase opacity-60"
|
||
>
|
||
<div class="mr-auto">©2025
|
||
<a class="link" href="/"></a></div>
|
||
<a class="link mx-6" href="https://gohugo.io/" rel="noopener" target="_blank"
|
||
>powered by hugo️️</a
|
||
>️
|
||
<a
|
||
class="link"
|
||
href="https://github.com/nanxiaobei/hugo-paper"
|
||
rel="noopener"
|
||
target="_blank"
|
||
>hugo-paper</a
|
||
>
|
||
</footer>
|
||
</body>
|
||
</html>
|