From 0986b9ee8488992375c7a4be9613ec845677efaa Mon Sep 17 00:00:00 2001 From: yuri <1969yuri1969@gmail.com> Date: Sun, 11 Aug 2024 18:03:51 +0200 Subject: [PATCH] docs: add missing Markdown syntax examples (#415) --- assets/css/chroma/dark.css | 2 +- exampleSite/content/docs/guide/markdown.fa.md | 62 +++++++++++++++++-- exampleSite/content/docs/guide/markdown.md | 62 +++++++++++++++++-- .../content/docs/guide/markdown.zh-cn.md | 62 +++++++++++++++++-- 4 files changed, 169 insertions(+), 19 deletions(-) diff --git a/assets/css/chroma/dark.css b/assets/css/chroma/dark.css index 8f662bda..c4261570 100644 --- a/assets/css/chroma/dark.css +++ b/assets/css/chroma/dark.css @@ -74,7 +74,7 @@ /* CommentPreprocFile */ .chroma .cpf { color: #8b949e; font-weight: bold; font-style: italic } /* Generic */ .chroma .g { } /* GenericDeleted */ .chroma .gd { color: #ffa198; background-color: #490202 } - /* GenericEmph */ .chroma .ge { font-style: italic } + /* GenericEmph */ .chroma .ge { color: inherit; font-style: italic } /* GenericError */ .chroma .gr { color: #ffa198 } /* GenericHeading */ .chroma .gh { color: #79c0ff; font-weight: bold } /* GenericInserted */ .chroma .gi { color: #56d364; background-color: #0f5323 } diff --git a/exampleSite/content/docs/guide/markdown.fa.md b/exampleSite/content/docs/guide/markdown.fa.md index 84e39ce7..1d06cde5 100644 --- a/exampleSite/content/docs/guide/markdown.fa.md +++ b/exampleSite/content/docs/guide/markdown.fa.md @@ -28,14 +28,28 @@ Hugo از سینتکس [مارک‌داون](https://en.wikipedia.org/wiki/Markd [^1]: نقل‌قول بالا گزیده‌ای از [سخنرانی](https://www.youtube.com/watch?v=PAAkCSZUG1c) راب پایک در Gopherfest، در تاریخ ۲۷ آبان ۱۳۹۴ است. +```markdown {filename=Markdown} +> با اشتراک‌گذاری حافظه ارتباط برقرار نکنید، حافظه را با برقراری ارتباط به اشتراک بگذارید.
+> — راب پایک[^1] + +[^1]: نقل‌قول بالا گزیده‌ای از [سخنرانی](https://www.youtube.com/watch?v=PAAkCSZUG1c) راب پایک در Gopherfest، در تاریخ ۲۷ آبان ۱۳۹۴ است. +``` + ### جدول‌ها جدول‌ها بخشی از مشخصات اصلی مارک‌داون نیستند، اما Hugo از آنها در خارج از جعبه پشتیبانی می‌کند. - نام | سن ---------|------ - گودرز | ۳۰ - آصف | ۳۴ +| نام | سن | +|--------|------| +| گودرز | ۳۰| +| آصف | ۳۴ | + +```markdown {filename=Markdown} +| نام | سن | +|--------|------| +| گودرز | ۳۰| +| آصف | ۳۴ | +``` #### مارک‌داون درون‌خطی درون جدول‌ها @@ -43,6 +57,12 @@ Hugo از سینتکس [مارک‌داون](https://en.wikipedia.org/wiki/Markd | -------- | -------- | ------ | | *کج* | **توپر** | `کد` | +```markdown {filename=Markdown} +| کج | توپر | کد | +| -------- | -------- | ------ | +| *کج* | **توپر** | `کد` | +``` + ### بلوک‌های کد {{< cards >}} @@ -57,12 +77,24 @@ Hugo از سینتکس [مارک‌داون](https://en.wikipedia.org/wiki/Markd 2. دومین آیتم 3. سومین آیتم +```markdown {filename=Markdown} +1. اولین آیتم +2. دومین آیتم +3. سومین آیتم +``` + #### فهرست مرتب‌نشده * فهرست آیتم * یک آیتم دیگه * و یک آیتم دیگه +```markdown {filename=Markdown} +* فهرست آیتم +* یک آیتم دیگه +* و یک آیتم دیگه +``` + #### فهرست تو در تو * میوه @@ -73,13 +105,31 @@ Hugo از سینتکس [مارک‌داون](https://en.wikipedia.org/wiki/Markd * شیر * پنیر +```markdown {filename=Markdown} +* میوه + * سیب + * پرتقال + * موز +* لبنیات + * شیر + * پنیر +``` + ### عکس‌ها -![](https://source.unsplash.com/featured/800x600?landscape) +![landscape](https://source.unsplash.com/featured/800x600?landscape) + +```markdown {filename=Markdown} +![landscape](https://source.unsplash.com/featured/800x600?landscape) +``` با توضیحات: -![](https://source.unsplash.com/featured/800x600?landscape "یک چشم‌انداز Unsplash") +![landscape](https://source.unsplash.com/featured/800x600?landscape "یک چشم‌انداز Unsplash") + +```markdown {filename=Markdown} +![landscape](https://source.unsplash.com/featured/800x600?landscape "یک چشم‌انداز Unsplash") +``` ## پیکربندی diff --git a/exampleSite/content/docs/guide/markdown.md b/exampleSite/content/docs/guide/markdown.md index 667eae3f..0caf3bc8 100644 --- a/exampleSite/content/docs/guide/markdown.md +++ b/exampleSite/content/docs/guide/markdown.md @@ -28,14 +28,28 @@ Blockquote with attribution [^1]: The above quote is excerpted from Rob Pike's [talk](https://www.youtube.com/watch?v=PAAkCSZUG1c) during Gopherfest, November 18, 2015. +```markdown {filename=Markdown} +> Don't communicate by sharing memory, share memory by communicating.
+> — Rob Pike[^1] + +[^1]: The above quote is excerpted from Rob Pike's [talk](https://www.youtube.com/watch?v=PAAkCSZUG1c) during Gopherfest, November 18, 2015. +``` + ### Tables Tables aren't part of the core Markdown spec, but Hugo supports them out-of-the-box. - Name | Age ---------|------ - Bob | 27 - Alice | 23 +| Name | Age | +|--------|------| +| Bob | 27 | +| Alice | 23 | + +```markdown {filename=Markdown} +| Name | Age | +|--------|------| +| Bob | 27 | +| Alice | 23 | +``` #### Inline Markdown within tables @@ -43,6 +57,12 @@ Tables aren't part of the core Markdown spec, but Hugo supports them out-of-the- | -------- | -------- | ------ | | *italics* | **bold** | `code` | +```markdown {filename=Markdown} +| Italics | Bold | Code | +| -------- | -------- | ------ | +| *italics* | **bold** | `code` | +``` + ### Code Blocks {{< cards >}} @@ -57,12 +77,24 @@ Tables aren't part of the core Markdown spec, but Hugo supports them out-of-the- 2. Second item 3. Third item +```markdown {filename=Markdown} +1. First item +2. Second item +3. Third item +``` + #### Unordered List * List item * Another item * And another item +```markdown {filename=Markdown} +* List item +* Another item +* And another item +``` + #### Nested list * Fruit @@ -73,13 +105,31 @@ Tables aren't part of the core Markdown spec, but Hugo supports them out-of-the- * Milk * Cheese +```markdown {filename=Markdown} +* Fruit + * Apple + * Orange + * Banana +* Dairy + * Milk + * Cheese +``` + ### Images -![](https://source.unsplash.com/featured/800x600?landscape) +![landscape](https://source.unsplash.com/featured/800x600?landscape) + +```markdown {filename=Markdown} +![landscape](https://source.unsplash.com/featured/800x600?landscape) +``` With caption: -![](https://source.unsplash.com/featured/800x600?landscape "Unsplash Landscape") +![landscape](https://source.unsplash.com/featured/800x600?landscape "Unsplash Landscape") + +```markdown {filename=Markdown} +![landscape](https://source.unsplash.com/featured/800x600?landscape "Unsplash Landscape") +``` ## Configuration diff --git a/exampleSite/content/docs/guide/markdown.zh-cn.md b/exampleSite/content/docs/guide/markdown.zh-cn.md index 5913a036..8b1f1c66 100644 --- a/exampleSite/content/docs/guide/markdown.zh-cn.md +++ b/exampleSite/content/docs/guide/markdown.zh-cn.md @@ -28,14 +28,28 @@ Hugo 支持 [Markdown](https://en.wikipedia.org/wiki/Markdown) 来书写内容 [^1]: The above quote is excerpted from Rob Pike's [talk](https://www.youtube.com/watch?v=PAAkCSZUG1c) during Gopherfest, November 18, 2015. +```markdown {filename=Markdown} +> Don't communicate by sharing memory, share memory by communicating.
+> — Rob Pike[^1] + +[^1]: The above quote is excerpted from Rob Pike's [talk](https://www.youtube.com/watch?v=PAAkCSZUG1c) during Gopherfest, November 18, 2015. +``` + ### 表格 表格并非核心 Markdown 规范,但 Hugo 支持开箱即用的表格: - Name | Age ---------|------ - Bob | 27 - Alice | 23 +| Name | Age | +|--------|------| +| Bob | 27 | +| Alice | 23 | + +```markdown {filename=Markdown} +| Name | Age | +|--------|------| +| Bob | 27 | +| Alice | 23 | +``` #### Markdown 表格中的内联 @@ -43,6 +57,12 @@ Hugo 支持 [Markdown](https://en.wikipedia.org/wiki/Markdown) 来书写内容 | -------- | -------- | ------ | | *italics* | **bold** | `code` | +```markdown {filename=Markdown} +| Italics | Bold | Code | +| -------- | -------- | ------ | +| *italics* | **bold** | `code` | +``` + ### 代码块 {{< cards >}} @@ -57,12 +77,24 @@ Hugo 支持 [Markdown](https://en.wikipedia.org/wiki/Markdown) 来书写内容 2. Second item 3. Third item +```markdown {filename=Markdown} +1. First item +2. Second item +3. Third item +``` + #### 无序列表 * List item * Another item * And another item +```markdown {filename=Markdown} +* List item +* Another item +* And another item +``` + #### 嵌套列表 * Fruit @@ -73,13 +105,31 @@ Hugo 支持 [Markdown](https://en.wikipedia.org/wiki/Markdown) 来书写内容 * Milk * Cheese +```markdown {filename=Markdown} +* Fruit + * Apple + * Orange + * Banana +* Dairy + * Milk + * Cheese +``` + ### 图片 -![](https://source.unsplash.com/featured/800x600?landscape) +![landscape](https://source.unsplash.com/featured/800x600?landscape) + +```markdown {filename=Markdown} +![landscape](https://source.unsplash.com/featured/800x600?landscape) +``` 带有标题: -![](https://source.unsplash.com/featured/800x600?landscape "Unsplash Landscape") +![landscape](https://source.unsplash.com/featured/800x600?landscape "Unsplash Landscape") + +```markdown {filename=Markdown} +![landscape](https://source.unsplash.com/featured/800x600?landscape "Unsplash Landscape") +``` ## 配置