2023-04-10 15:38:20 +02:00
<!doctype html> < html lang = en > < head > < meta charset = utf-8 > < meta name = viewport content = "width=device-width,initial-scale=1" > < meta property = "og:title" content = "Markdown 语法指北" > < meta property = "og:description" content = "一篇 Markdown 示例文章,翻译自官方示例。" > < meta property = "og:type" content = "article" > < meta property = "og:url" content = "https://mivinci.github.io/hugo-theme-minima/zh-cn/markdown-syntax/" > < meta property = "article:section" content > < meta property = "article:published_time" content = "2021-07-18T10:52:59+08:00" > < meta property = "article:modified_time" content = "2021-07-18T10:52:59+08:00" > < meta name = twitter:card content = "summary" > < meta name = twitter:title content = "Markdown 语法指北" > < meta name = twitter:description content = "一篇 Markdown 示例文章,翻译自官方示例。" > < meta name = theme-color media = "(prefers-color-scheme: light)" content = "#ffffff" > < meta name = theme-color media = "(prefers-color-scheme: dark)" content = "#262d33" > < title > Hugo on Minima - Markdown 语法指北< / title > < link rel = "shortcut icon" href = /hugo-theme-minima/favicon.ico type = image/x-icon > < link rel = stylesheet href = /hugo-theme-minima/minima.css > < script defer type = text/javascript src = /hugo-theme-minima/minima.js > < / script > < link rel = alternate hreflang = en href = https://mivinci.github.io/hugo-theme-minima/markdown-syntax/ title = EN > < / head > < script > const default _theme _config = 'sand' , default _light _theme = default _theme _config === 'system' ? 'light' : default _theme _config ; let default _theme = window . matchMedia ( '(prefers-color-scheme: dark)' ) . matches ? 'dark' : default _light _theme ; try { const a = localStorage . getItem ( 'theme' ) ; a && ( default _theme = a === default _light _theme ? a : default _light _theme ) , localStorage . setItem ( 'theme' , default _theme ) , window . minima _theme = default _theme , document . querySelector ( 'html' ) . classList . add ( default _theme ) } catch ( a ) { console . error ( a ) } < / script > < body > < header class = "mt-3 mb-6" > < div class = "container mx-auto" > < nav class = "flex justify-between items-center" > < div class = "flex items-center" > < div id = theme-switch class = "text-3xl cursor-pointer" > 🌝< / div > < / div > < ul class = "flex items-center text-base font-bold
2023-05-03 11:32:48 +02:00
whitespace-nowrap overflow-x-auto overflow-y-hidden">< li class = "ml-2 mr-2" > < a href = /hugo-theme-minima/zh-cn/tags > 标签< / a > < / li > < li class = "ml-2 mr-2" > < a href = /hugo-theme-minima/zh-cn/series > 系列< / a > < / li > < / ul > < ul class = "flex item-center text-sm font-bold" > < li class = ml-2 > < a href = https://mivinci.github.io/hugo-theme-minima/ > EN< / a > < / li > < li class = ml-2 > < a href = https://mivinci.github.io/hugo-theme-minima/zh-cn/ > 简中< / a > < / li > < / ul > < / nav > < / div > < / header > < div class = "container mx-auto" > < h1 class = "text-4xl font-extrabold mt-6 mb-6" > Markdown 语法指北< / h1 > < div class = "mb-3 text-sm flex justify-between" > < div > 发布于 — 2021 年 07 月 18 日< / div > < div > < a class = ml-1 href = /hugo-theme-minima/zh-cn/tags/markdown > #markdown< / a > < / div > < / div > < main class = mb-8 > < p > 一篇 Markdown 示例文章,翻译自官方示例。< / p > < article class = md > < p > 本文提供了一个可以在 Hugo 内容文件中使用的基本 Markdown 语法示例,还展示了基本 HTML 元素是否在 Hugo 主题中使用 CSS 进行修饰。< / p > < h2 id = 标题 > 标题< / h2 > < p > 下面的 HTML < code > < h1>< / code > —< code > < h6>< / code > 元素代表了六个级别的章节标题。 < code > < h1>< / code > 是最高的部分级别,而 < code > < h6>< / code > 是最低的。< / p > < h1 id = 一级标题 > 一级标题< / h1 > < h2 id = 二级标题 > 二级标题< / h2 > < h3 id = 三级标题 > 三级标题< / h3 > < h4 id = 四级标题 > 四级标题< / h4 > < h5 id = 五级标题 > 五级标题< / h5 > < h6 id = 六级标题 > 六级标题< / h6 > < h2 id = 段落 > 段落< / h2 > < p > Xerum, 我可以和他解释谁在痛苦中。 当我来到你身边,当我充满快乐时,我被快乐所折磨,或者他是天生的,或者是一个骗子,因为那个让我快乐痛苦的人是事情的专家,或者他撕裂和撕破自己的意志,仿佛他值得被遮盖,他是不是走到了心坎上,以同样的心去追随同样的事情? 为什么毛孔会竖起来,当它被放置在一个不知道老鼠意志或一切的地方时? 我会安静的。 就我而言,我的心以一种或另一种方式受到干扰,我把它们撕下来擦干,这样我要么杀了它们,要么让它们逃跑。 他憎恨真相,因为 veliamenim 的浪潮是起因和面子本身,而版本的痛苦又重演了。< / p > < p > 是旅行吗? 因为每一件事都有一些你讨厌或讨厌的东西,所以你会吃东西,以免让你的智慧隐藏这样一个事实,即心脏和心脏或有趣的东西会从中出来。< / p > < h2 id = 块引用 > 块引用< / h2 > < p > blockquote 元素表示从另一个来源引用的内容, 可选地带有必须在“footer”或“cite”元素内的引用, 以及可选的内联更改, 例如注释和缩写。< / p > < h4 id = 不注明出处的块引用 > 不注明出处的块引用< / h4 > < blockquote > < p > 然后,为了铸币安德普,要给予的知识相应地减少。
2022-11-08 16:11:34 +01:00
< strong > 注意< / strong > 您可以在块引用中使用 < em > Markdown 语法< / em > 。< / p > < / blockquote > < h4 id = 带出处的块引用 > 带出处的块引用< / h4 > < blockquote > < p > 不要通过共享内存来通信,通过通信来共享内存。
2022-11-10 09:00:54 +01:00
— Rob Pike< sup id = fnref:1 > < a href = #fn:1 class = footnote-ref role = doc-noteref > 1< / a > < / sup > < / p > < / blockquote > < h2 id = 表格 > 表格< / h2 > < p > 表格不是核心 Markdown 规范的一部分,但 Hugo 支持开箱即用地支持它们。< / p > < table > < thead > < tr > < th style = text-align:center > 姓名< / th > < th style = text-align:center > 年龄< / th > < / tr > < / thead > < tbody > < tr > < td style = text-align:center > 小明< / td > < td style = text-align:center > 27< / td > < / tr > < tr > < td style = text-align:center > 大壮< / td > < td style = text-align:center > 23< / td > < / tr > < / tbody > < / table > < h4 id = 表格内的内联-markdown > 表格内的内联 Markdown< / h4 > < table > < thead > < tr > < th style = text-align:center > 斜体< / th > < th style = text-align:center > 粗体< / th > < th style = text-align:center > 代码< / th > < / tr > < / thead > < tbody > < tr > < td style = text-align:center > < em > 斜体< / em > < / td > < td style = text-align:center > < strong > 粗体< / strong > < / td > < td style = text-align:center > < code > code< / code > < / td > < / tr > < / tbody > < / table > < h2 id = 代码块 > 代码块< / h2 > < h4 id = 不使用高亮的代码块 > 不使用高亮的代码块< / 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 = html-的代码块 > HTML 的代码块< / h4 > < div class = highlight > < div class = chroma > < table class = lntable > < tr > < td class = lntd > < pre class = chroma > < code > < span class = lnt > 1
2022-11-08 16:11:34 +01:00
< / span > < span class = lnt > 2
< / span > < span class = lnt > 3
< / span > < span class = lnt > 4
< / span > < span class = lnt > 5
< / span > < span class = lnt > 6
< / span > < span class = lnt > 7
< / span > < span class = lnt > 8
< / span > < span class = lnt > 9
< / span > < span class = lnt > 10
< / span > < / code > < / pre > < / td > < td class = lntd > < pre class = chroma > < code class = language-html data-lang = html > < span class = cp > < !doctype html> < / span >
< span class = p > < < / span > < span class = nt > html< / span > < span class = na > lang< / span > < span class = o > =< / span > < span class = s > " en" < / span > < span class = p > > < / span >
< span class = p > < < / span > < span class = nt > head< / span > < span class = p > > < / span >
< span class = p > < < / span > < span class = nt > meta< / span > < span class = na > charset< / span > < span class = o > =< / span > < span class = s > " utf-8" < / span > < span class = p > > < / span >
< span class = p > < < / span > < span class = nt > title< / span > < span class = p > > < / span > Example HTML5 Document< span class = p > < /< / span > < span class = nt > title< / span > < span class = p > > < / span >
< span class = p > < /< / span > < span class = nt > head< / span > < span class = p > > < / span >
< span class = p > < < / span > < span class = nt > body< / span > < span class = p > > < / span >
< span class = p > < < / span > < span class = nt > p< / span > < span class = p > > < / span > Test< span class = p > < /< / span > < span class = nt > p< / span > < span class = p > > < / span >
< span class = p > < /< / span > < span class = nt > body< / span > < span class = p > > < / span >
< span class = p > < /< / span > < span class = nt > html< / span > < span class = p > > < / span >
2022-11-10 09:00:54 +01:00
< / code > < / pre > < / td > < / tr > < / table > < / div > < / div > < h4 id = go-的代码块 > Go 的代码块< / h4 > < div class = highlight > < div class = chroma > < table class = lntable > < tr > < td class = lntd > < pre class = chroma > < code > < span class = lnt > 1
2022-11-08 16:11:34 +01:00
< / span > < span class = lnt > 2
< / span > < span class = hl > < span class = lnt > 3
< / span > < / span > < span class = lnt > 4
< / span > < span class = lnt > 5
< / span > < / code > < / pre > < / td > < td class = lntd > < pre class = chroma > < code class = language-go data-lang = go > < span class = kd > type< / span > < span class = nx > Registry< / span > < span class = kd > interface< / span > < span class = p > {< / span >
< span class = nf > Register< / span > < span class = p > (< / span > < span class = o > *< / span > < span class = nx > Service< / span > < span class = p > ,< / span > < span class = o > ...< / span > < span class = nx > RegisterOption< / span > < span class = p > )< / span > < span class = kt > error< / span >
< span class = hl > < span class = nf > Deregister< / span > < span class = p > (< / span > < span class = o > *< / span > < span class = nx > Service< / span > < span class = p > ,< / span > < span class = o > ...< / span > < span class = nx > DeregisterOption< / span > < span class = p > )< / span > < span class = kt > error< / span >
2022-11-09 11:04:02 +01:00
< / span > < span class = nf > List< / span > < span class = p > (< / span > < span class = kt > string< / span > < span class = p > ,< / span > < span class = o > ...< / span > < span class = nx > ListOption< / span > < span class = p > )< / span > < span class = p > ([]< / span > < span class = o > *< / span > < span class = nx > Service< / span > < span class = p > ,< / span > < span class = kt > error< / span > < span class = p > )< / span >
2022-11-08 16:11:34 +01:00
< span class = p > }< / span >
< / code > < / pre > < / td > < / tr > < / table > < / div > < / div > < h4 id = c艹-的代码块 > C艹 的代码块< / h4 > < div class = highlight > < div class = chroma > < table class = lntable > < tr > < td class = lntd > < pre class = chroma > < code > < span class = lnt > 1
< / span > < span class = lnt > 2
< / span > < span class = lnt > 3
< / span > < span class = lnt > 4
< / span > < span class = lnt > 5
< / span > < span class = lnt > 6
< / span > < span class = lnt > 7
< / span > < span class = lnt > 8
< / span > < span class = lnt > 9
< / span > < span class = lnt > 10
< / span > < span class = lnt > 11
< / span > < / code > < / pre > < / td > < td class = lntd > < pre class = chroma > < code class = language-c++ data-lang = c++ > < span class = cp > #include< / span > < span class = cpf > < iostream> < / span > < span class = cp >
< / span > < span class = cp > < / span >
< span class = k > class< / span > < span class = nc > Animal< / span > < span class = p > {< / span >
< span class = n > string< / span > < span class = n > name< / span > < span class = p > ;< / span >
< span class = k > public< / span > < span class = o > :< / span >
< span class = kt > void< / span > < span class = n > eat< / span > < span class = p > ();< / span >
< span class = p > }< / span >
< span class = kt > void< / span > < span class = n > Animal< / span > < span class = o > ::< / span > < span class = n > eat< / span > < span class = p > ()< / span > < span class = p > {< / span >
< span class = n > std< / span > < span class = o > ::< / span > < span class = n > cout< / span > < span class = o > < < < / span > < span class = s > " eat something" < / span > < span class = o > < < < / span > < span class = n > std< / span > < span class = o > ::< / span > < span class = n > endl< / span > < span class = p > ;< / span >
< span class = p > }< / span >
< / code > < / pre > < / td > < / tr > < / table > < / div > < / div > < h4 id = jvav-的代码块 > Jvav 的代码块< / h4 > < div class = highlight > < div class = chroma > < table class = lntable > < tr > < td class = lntd > < pre class = chroma > < code > < span class = lnt > 1
< / span > < span class = lnt > 2
< / span > < span class = lnt > 3
< / span > < span class = lnt > 4
< / span > < span class = lnt > 5
< / span > < span class = lnt > 6
< / span > < span class = lnt > 7
< / span > < span class = lnt > 8
< / span > < span class = lnt > 9
< / span > < span class = lnt > 10
< / span > < span class = lnt > 11
< / span > < span class = lnt > 12
< / span > < span class = lnt > 13
< / span > < / code > < / pre > < / td > < td class = lntd > < pre class = chroma > < code class = language-java data-lang = java > < span class = kd > class< / span > < span class = nc > Animal< / span > < span class = o > {< / span >
< span class = kt > void< / span > < span class = nf > speak< / span > < span class = o > ()< / span > < span class = o > {< / span > < span class = cm > /* speak */< / span > < span class = o > }< / span >
< span class = o > }< / span >
< span class = kd > class< / span > < span class = nc > Dog< / span > < span class = kd > extends< / span > < span class = n > Animal< / span > < span class = o > {< / span >
< span class = nd > @override< / span >
< span class = kt > void< / span > < span class = nf > speak< / span > < span class = o > ()< / span > < span class = o > {< / span > < span class = cm > /* bark */< / span > < span class = o > }< / span >
< span class = o > }< / span >
< span class = kd > class< / span > < span class = nc > Cat< / span > < span class = kd > extends< / span > < span class = n > Animal< / span > < span class = o > {< / span >
< span class = nd > @override< / span >
< span class = kt > void< / span > < span class = nf > speak< / span > < span class = o > ()< / span > < span class = o > {< / span > < span class = cm > /* mew */< / span > < span class = o > }< / span >
< span class = o > }< / span >
< / code > < / pre > < / td > < / tr > < / table > < / div > < / div > < h4 id = python-的代码块 > Python 的代码块< / h4 > < div class = highlight > < div class = chroma > < table class = lntable > < tr > < td class = lntd > < pre class = chroma > < code > < span class = lnt > 1
< / span > < span class = lnt > 2
< / span > < span class = lnt > 3
< / span > < span class = lnt > 4
< / span > < span class = lnt > 5
< / span > < span class = lnt > 6
< / span > < / code > < / pre > < / td > < td class = lntd > < pre class = chroma > < code class = language-python data-lang = python > < span class = k > class< / span > < span class = nc > Dog< / span > < span class = p > (< / span > < span class = n > Animal< / span > < span class = p > ):< / span >
< span class = k > def< / span > < span class = fm > __init__< / span > < span class = p > (< / span > < span class = bp > self< / span > < span class = p > ):< / span >
< span class = nb > super< / span > < span class = o > .< / span > < span class = fm > __init__< / span > < span class = p > ()< / span >
< span class = k > def< / span > < span class = nf > eat< / span > < span class = p > ():< / span >
< span class = k > pass< / span >
2023-04-10 15:38:20 +02:00
< / code > < / pre > < / td > < / tr > < / table > < / div > < / div > < h2 id = 列表类型 > 列表类型< / h2 > < h4 id = 有序列表 > 有序列表< / h4 > < ol > < li > 第一项< / li > < li > 第二项< / li > < li > 第三项< / li > < / ol > < ul > < li > < input checked disabled type = checkbox > 已勾选< / li > < li > < input disabled type = checkbox > 未勾选< / li > < / ul > < h4 id = 无序列表 > 无序列表< / h4 > < ul > < li > 第一项< / li > < li > 另一项< / li > < li > 另另一项< / li > < / ul > < h4 id = 嵌套列表 > 嵌套列表< / h4 > < ul > < li > 水果< ul > < li > 苹果< / li > < li > 橘子< / li > < li > 香蕉< / li > < / ul > < / li > < li > 乳制品< ul > < li > 牛奶< / li > < li > 奶酪< / li > < / ul > < / li > < / ul > < section class = footnotes role = doc-endnotes > < hr > < ol > < li id = fn:1 role = doc-endnote > < p > 上述引述摘自 Rob Pike 在 2015 年 11 月 18 日 Gopherfest 期间的 < a href = "https://www.youtube.com/watch?v=PAAkCSZUG1c" > talk< / a > 。  < a href = #fnref:1 class = footnote-backref role = doc-backlink > ↩ ︎ < / a > < / p > < / li > < / ol > < / section > < / article > < / main > < div id = comment > < / div > < script > const s = document . createElement ( "script" ) ; s . src = "https://giscus.app/client.js" , s . crossOrigin = "anonymous" , s . async = ! 0 , s . setAttribute ( "data-repo" , "mivinci/hugo-theme-minima" ) , s . setAttribute ( "data-repo-id" , "MDEwOlJlcG9zaXRvcnkzODcxMjM2NDU=" ) , s . setAttribute ( "data-category" , "Comments" ) , s . setAttribute ( "data-category-id" , "DIC_kwDOFxMJvc4CScQm" ) , s . setAttribute ( "data-mapping" , "pathname" ) , s . setAttribute ( "data-strict" , "0" ) , s . setAttribute ( "data-reactions-enabled" , "1" ) , s . setAttribute ( "data-emit-metadata" , "0" ) , s . setAttribute ( "data-input-position" , "buttom" ) , s . setAttribute ( "data-theme" , window . minima _theme + "_protanopia" ) , s . setAttribute ( "data-lang" , "en" ) , s . setAttribute ( "data-loading" , "lazy" ) , document . getElementById ( "comment" ) . appendChild ( s ) < / script > < / div > < footer class = "mt-8 mb-8" > < div class = "container mx-auto" > < div class = "mt-8 flex justify-between items-center" > < p class = "mt-0 text-sm" > © 2023 X |
2022-11-08 16:11:34 +01:00
< a href = https://gohugo.io target = _blank rel = "noopener noreferrer" > Hugo< / a > on
2023-05-03 11:32:48 +02:00
< a href = https://github.com/mivinci/hugo-theme-minima target = _blank rel = "noopener noreferrer" > Minima< / a > < / p > < p class = "flex items-center mt-0" > < a class = "icon ml-1 mr-1" href = https://twitter.com/realmivinci title = twitter > < svg xmlns = "http://www.w3.org/2000/svg" width = "18" height = "18" viewBox = "0 0 24 24" fill = "none" stroke = "currentcolor" stroke-width = "2" stroke-linecap = "round" stroke-linejoin = "round" > < path d = "M23 3a10.9 10.9.0 01-3.14 1.53 4.48 4.48.0 00-7.86 3v1A10.66 10.66.0 013 4s-4 9 5 13a11.64 11.64.0 01-7 2c9 5 20 0 20-11.5a4.5 4.5.0 00-.08-.83A7.72 7.72.0 0023 3z" / > < / svg > < / a > < a class = "icon ml-1 mr-1" href = mailto:mivinci@qq.com title = email > < svg xmlns = "http://www.w3.org/2000/svg" width = "18" height = "18" viewBox = "0 0 24 21" fill = "none" stroke = "currentcolor" stroke-width = "2" stroke-linecap = "round" stroke-linejoin = "round" > < path d = "M4 4h16c1.1.0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1.0-2-.9-2-2V6c0-1.1.9-2 2-2z" / > < path d = "M22 6l-10 7L2 6" / > < / svg > < / a > < a class = "icon ml-1 mr-1" href = https://github.com/mivinci/hugo-theme-minima title = github > < svg xmlns = "http://www.w3.org/2000/svg" width = "18" height = "18" viewBox = "0 0 24 24" fill = "none" stroke = "currentcolor" stroke-width = "2" stroke-linecap = "round" stroke-linejoin = "round" > stroke-linecap="round" stroke-linejoin="round">< path d = "M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37.0 00-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44.0 0020 4.77 5.07 5.07.0 0019.91 1S18.73.65 16 2.48a13.38 13.38.0 00-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07.0 005 4.77 5.44 5.44.0 003.5 8.55c0 5.42 3.3 6.61 6.44 7A3.37 3.37.0 009 18.13V22" / > < / svg > < / a > < a class = "icon ml-1 mr-1" href = /index.xml title = rss > < svg xmlns = "http://www.w3.org/2000/svg" width = "18" height = "18" viewBox = "0 0 24 24" fill = "none" stroke = "currentcolor" stroke-width = "2" stroke-linecap = "round" stroke-linejoin = "round" > < path d = "M4 11a9 9 0 019 9M4 4a16 16 0 0116 16" / > < circle cx = "5" cy = "19" r = "1" / > < / svg > < / a > < / p > < / div > < / div > < / footer > < / body > < / html >