未验证 提交 133d8a5b 编写于 作者: Miykael_xxm's avatar Miykael_xxm 🚴

update

上级 8e08c621
Markdown 是一种轻量级的「标记语言」,它的优点很多,目前也被越来越多的写作爱好者,撰稿者广泛使用。看到这里请不要被「标记」、「语言」所迷惑,Markdown 的语法十分简单。常用的标记符号也不超过十个,这种相对于更为复杂的HTML 标记语言来说,Markdown 可谓是十分轻量的,学习成本也不需要太多,且一旦熟悉这种语法规则,会有一劳永逸的效果。
\ No newline at end of file
#### 认识 Markdown
Markdown 是一种用来写作的轻量级「标记语言」,它用简洁的语法代替排版,而不像一般我们用的字处理软件 Word 或 Pages 有大量的排版、字体设置。它使我们专心于码字,用「标记」语法,来代替常见的排版格式。
Markdown 文档从内容到格式,甚至插图,通过键盘就可以通通搞定。
现在,支持 Markdown 语法的编辑器有很多,包括很多网站(例如 CSDN 博客、CODE CHINA)都支持了 Markdown 格式。Markdown 从写作到完成,导出格式随心所欲,你可以导出 HTML 格式的文件用来网站发布,也可以十分方便的导出 PDF 格式。
<details><summary> Markdown 历史</summary>
<hr>
约翰·格鲁伯在2004年创造了 Markdown 语言,在语法上有很大一部分是跟亚伦·斯沃茨共同合作的。这个语言的目的是希望大家使用“易于阅读、易于撰写的纯文字格式,并选择性的转换成有效的XHTML(或是HTML)”。
其中最重要的设计是可读性,也就是说这个语言应该要能直接在字面上的被阅读,而不用被一些格式化指令标记(像是RTF与HTML)。
因此,它是现行电子邮件标记格式的惯例,虽然它也借鉴了几个早期的标记语言,如:`Setext``Textile` (markup language)、`reStructuredText`。格鲁伯也编写了的 Perl 脚本:`Markdown.pl`,用于把 Markdown 语法编写的内容转换成有效的、结构良好的XHTML或HTML内容,并将左尖括号`<``&`号替换成它们各自的字符实体引用。
</details>
\ No newline at end of file
** 以下哪个不是 Markdown 的优点?**
( ) 专注你的文字内容而不是排版样式,安心写作 {{回答错误}}
( ) 轻松的导出 HTML、PDF 和本身的 .md 文件 {{回答错误}}
( ) 纯文本内容,兼容所有的文本编辑器与字处理软件 {{回答错误}}
( ) 随时修改你的文章版本,不必像字处理软件生成若干文件版本导致混乱 {{回答错误}}
( ) 可读、直观、学习成本低 {{回答错误}}
(x) 有大量的排版、字体设置操作 {{回答正确,Markdown 让我们更专注于文字内容而不是排版样式}}
( ) 相应的工具支持很好 {{回答错误}}
|| Markdown 有着代码语法简单、专注于撰写内容、排版清晰简洁等特点。 ||
\ No newline at end of file
#### 使用 Markdown 的误区
> We believe that writing is about content, about what you want to say – not about fancy formatting.
>
> 我们坚信写作写的是内容,所思所想,而不是花样格式。
>
> — Ulysses for Mac
Markdown 旨在简洁、高效,也由于 Markdown 的易读易写,人们用不同的编程语言实现了多个版本的解析器和生成器。这就导致了目前不同的 Markdown 工具集成了不同的功能(基础功能大致相同),例如流程图与时序图,复杂表格与复杂公式的呈现,比如 GFM Markdown 就支持使用 `Mermaid` 生成图表和流程图。
**补充阅读**
- [创始人 John Gruber 的 Markdown 语法说明](/-/wikis/John_Gruber_Markowdn_syntax)
- [GFM Markdown 语法说明](https://codechina.csdn.net/codechina/help-docs/-/wikis/docs/user/markdown)
\ No newline at end of file
** Markdown最适合做什么(多选)?**
(x) 写文档 {{正确}}
( ) 写程序 {{回答错误}}
(x) 写博客 {{正确}}
( ) 画图 {{回答错误}}
|| Markdown的设计初衷就是给程序员使用的文档写作工具,因此非常适合用来写文档、写博客。||
\ No newline at end of file
恭喜@{{%user%}},通过本章节的介绍,相信你对 Markdown 已经有一个一个基本的认识,在接下来的内容中,我们将开始向你介绍 Markdown 文档中常用的几个语法格式了。
##### 在开始新的章节学习之前,请点击下方的 `关闭 Issue` 按钮。
\ No newline at end of file
:thumbsup: :thumbsup: :thumbsup: Well Done!
请开始前往 [第二章《段落及下划线》]({{chapter_2_issue}})的课程内容学习
\ No newline at end of file
这章课程,我们将主要学习 Markdown 中段落及强调的语法知识。
#### 段落
在 Markdown 中,段落是由一个以上相连接的行句组成,而一个以上的空行则会切分出不同的段落,一般的段落不需要用空白或断行缩排。
> 空行的定义是显示上看起来像是空行,便会被视为空行。
>
> 比如,若某一行只包含空白` `和 tab` `,则该行也会被视为空行
「一个以上相连接的行句组成」这句话其实暗示了 Markdown 允许段落内的强迫断行,这个特性和其他大部分的 text-to-HTML 格式不一样(包括 MovableType 的「Convert Line Breaks」选项),其它的格式会把每个断行都转成 `<br />` 标签。
** :wave: 请点击下方的开始测试按钮 :point_down: :point_down: :point_down: **
(x) 开始测试 {{准备好了吗?让我们来考考你}}
|| 提示:准备好的话,就点击开始测验按钮吧! ||
\ No newline at end of file
......@@ -4,8 +4,8 @@ before:
transitions:
action:
- type: create_issue
title: "使用Markdown进行交流"
with: 001_1_vsc.md
title: "Markdown 介绍"
with: 001_1_markdown_basic.md
store:
chapter_1_url: '{{result.data.html_url}}'
- type: choice
......@@ -15,30 +15,92 @@ before:
# Task 列表
step1:
link: '{{chapter_1_url}}'
description: "创建一个任务列表"
description: "认识 Markdown"
transitions:
events: ['note_events']
action:
- type: issue_comment.created
with: 001_2_vsc_survey.md
with: 001_2_markdown_intro.md
- type: choice
with: exam.md
to: step2
step2:
link: '{{chapter_1_url}}'
description: "创建一个任务列表"
# description: "认识 Markdown"
transitions:
- events: ['note_events']
left: '(-|\*)\s+\[[x|X|\s]+\]\s+.+'
operator: regexp
right: '{{object_attributes.note}}'
action:
- type: issue_comment.created
with: 001_3_vsc_survey.md
to: end
- events: ['note_events']
else: true
action:
- type: issue_comment.created
with: 001_4_vsc_survey.md
to: step2
events: ['note_events']
action:
- type: issue_comment.created
with: 001_3_markdown_advantage.md
to: step3
step3:
link: '{{chapter_1_url}}'
description: "使用 Markdown 的误区"
transitions:
events: ['note_events']
action:
- type: issue_comment.created
with: 001_4_markdown_usecase.md
- type: choice
with: exam.md
to: step4
step4:
link: '{{chapter_1_url}}'
# description: "使用 Markdown 的误区"
transitions:
events: ['note_events']
action:
- type: issue_comment.created
with: 001_5_when_to_use_markdown.md
- type: choice
with: exam.md
to: step4
step4:
link: '{{chapter_1_url}}'
# description: "当前课程回顾"
transitions:
events: ['note_events']
action:
- type: issue_comment.created
with: 001_6_end_1.md
to: step5
step5:
link: '{{chapter_1_url}}'
# description: "完成当前章节学习"
transitions:
events: ['close_issue']
action:
- type: create_issue
title: "Markdown :段落及强调"
with: 002_1_paragraph_basic.md
store:
chapter_2_issue: '{{result.data.html_url}}'
- type: issue_comment.created
with: 001_6_end_2.md
to: end
# step2:
# link: '{{chapter_1_url}}'
# description: "创建一个任务列表"
# transitions:
# - events: ['note_events']
# left: '(-|\*)\s+\[[x|X|\s]+\]\s+.+'
# operator: regexp
# right: '{{object_attributes.note}}'
# action:
# - type: issue_comment.created
# with: 001_3_vsc_survey.md
# to: end
# - events: ['note_events']
# else: true
# action:
# - type: issue_comment.created
# with: 001_4_vsc_survey.md
# to: step2
\ No newline at end of file
......@@ -14,7 +14,7 @@ Markdown 是一种用来写作的轻量级「标记语言」,它用简洁的
- 随时修改你的文章版本,不必像字处理软件生成若干文件版本导致混乱
- 可读、直观、学习成本低
## 使用 Markdown 的误区
#### 使用 Markdown 的误区
> We believe that writing is about content, about what you want to say – not about fancy formatting.
>
......
** :point_down: :point_down: :point_down: 请点击下方的继续学习按钮 **
(x) 继续学习 {{太棒了,让我们看看接下来的学习内容吧}}
|| 小提示:点击继续学习按钮就可以进入下一步啦。 ||
\ No newline at end of file
这章课程,我们将主要学习 Markdown 中段落及强调的语法知识。
#### 段落
在 Markdown 中,段落是由一个以上相连接的行句组成,而一个以上的空行则会切分出不同的段落,一般的段落不需要用空白或断行缩排。
> 空行的定义是显示上看起来像是空行,便会被视为空行。
>
> 比如,若某一行只包含空白` `和 tab` `,则该行也会被视为空行
「一个以上相连接的行句组成」这句话其实暗示了 Markdown 允许段落内的强迫断行,这个特性和其他大部分的 text-to-HTML 格式不一样(包括 MovableType 的「Convert Line Breaks」选项),其它的格式会把每个断行都转成 `<br />` 标签。
这也就意味着在 Markdown 中,如果需要把一段内容当做段落来显示,则需要保证该段内容上方及下方至少各有一个空行,比如:
```markdown
这里是段落一
这里是段落二
```
这段文字在 Markdown 中就会被显示成一行:
这里是段落一
这里是段落二
如果需要对段落进行换行的话,可以使用两个以上空格加上回车,比如:
这里是段落一
这里是段落二
```
这里是段落一
这里是段落二
```
\ No newline at end of file
当然,你也可以在段落后面使用一个空行来表示重新开始一个段落,比如:
这里是段落一
这里是段落二
```
这里是段落一
这里是段落二
```
\ No newline at end of file
此外,你也可以选择在第一行的末尾添加 `<br>` 进行换行,比如:
```markdown
这里是段落一<br>
这里是段落二
```
就会显示成两段内容:
这里是段落一<br>
这里是段落二
\ No newline at end of file
** 如何在Markdown文档中添加一个段落? **
(x) 回车换行 {{正确}}
( ) 添加一个空行 {{回答错误}}
( ) 添加分隔线 {{回答错误}}
( ) 使用<br>标签 {{回答错误}}
|| 提示:Markdown 中可以使用 空行+回车、两个空格+回车、<br> 等方式进行段落的换行||
\ No newline at end of file
Markdown 使用星号 `*` 和下划线 `-` 作为标记强调字词的符号。
#### 斜体
在 Markdown 中,将内容用 `*``_` 包裹起来,包围的字词会被转成用 <em> 标签包围,会显示成 *斜体*,比如:
```
*这里是斜体内容1*
_这里是斜体内容2_
```
<details><summary> :point_down: 点击查看显示效果 </summary>
<hr>
*这里是斜体内容1*
_这里是斜体内容2_
```
<em>这里是斜体内容1</em>
<br>
<em>这里是斜体内容2</em>
```
</details>
**需要注意的是:**
1. 用什么符号开启标签,就要用什么符号结束
2. `*``_` 两边都有空白的话,它们就只会被当成普通的符号
3. 如果要在文字前后直接插入普通的星号或下划线,可以用反斜杠 `\*` `\_`
#### 粗体
用两个 `*``_` 包起来的话,则会被转成 <strong>,例如:
```
**这里是粗体内容1**
__这里是粗体内容2__
```
<details><summary> :point_down: 点击查看显示效果 </summary>
<hr>
**这里是粗体内容1**
__这里是粗体内容2__
```
<strong>这里是斜体内容1</strong>
<br>
<strong>这里是斜体内容2</strong>
```
</details>
<br>
\ No newline at end of file
#### 删除线
你还可以使用两个 `~` 来给内容加上~~删除线~~,例如:
```
~~这个内容是被删掉的~~
```
<details><summary> :point_down: 点击查看显示效果 </summary>
<hr>
~~这个内容是被删掉的~~
```
<del>这个内容是被删掉的</del>
```
</details>
<br>
\ No newline at end of file
让我们来回顾一下第二章的知识点吧:
1. 段落的换行
2. 强调的语法,包括 *斜体* **加粗** 以及 ~~删除线~~
##### 在开始新的章节学习之前,请点击下方的 `关闭 Issue` 按钮。
\ No newline at end of file
:thumbsup: :thumbsup: :thumbsup: Well Done!
请开始前往 [第三章《标题》]({{chapter_3_issue}})的课程内容学习
\ No newline at end of file
** 以下 Markdown 代码片段中的哪一项将产生此文本:*Hello, **world**!* ?**
( ) *Hello, *world*!* {{回答错误}}
( ) **Hello, *world*!** {{回答错误}}
(x) *Hello, **world**!* {{正确}}
|| 提示:Markdown 中 ** 是加粗, * 是斜体 ||
\ No newline at end of file
** 如何将“文本”两字设为斜体?(多选)**
( ) *文本* {{正确}}
( ) **文本** {{回答错误}}
( ) _文本_ {{正确}}
( ) __文本__ {{回答错误}}
|| Markdown 中将内容用 `*``_` 包裹起来会显示成 *斜体* ||
\ No newline at end of file
Markdown 支持两种标题的语法,`Setext``atx` 形式。
\ No newline at end of file
** :wave: 请点击下方的开始测试按钮 :point_down: :point_down: :point_down: **
(x) 开始测试 {{准备好了吗?让我们来考考你}}
|| 提示:准备好的话,就点击开始测验按钮吧! ||
\ No newline at end of file
** :wave: 准备好了吗?准备好的话请点击下方的开始学习按钮 :point_down: :point_down: :point_down: **
(x) 开始学习 {{太棒了,让我们开始学习新的内容吧}}
|| 小提示:点击开始学习按钮就ok了 ||
\ No newline at end of file
# # 在所有的任务之前执行
# before:
# link: '{{chapter_1_url}}'
# transitions:
# action:
# - type: create_issue
# title: "Markdown :段落及强调"
# with: 001_1_markdown_basic.md
# store:
# chapter_1_url: '{{result.data.html_url}}'
# - type: choice
# with: first.md
# to: step1
before:
link: '{{chapter_2_issue}}'
transitions:
action:
- type: issue_comment.created
with: first.md
to: step1
# Task 列表
step1:
link: '{{chapter_2_url}}'
description: "段落"
transitions:
events: ['note_events']
action:
- type: issue_comment.created
with: 002_2_paragraph_intro.md
- type: choice
with: next.md
to: step2
step2:
link: '{{chapter_2_url}}'
description: "段落的换行"
transitions:
events: ['note_events']
action:
- type: issue_comment.created
with: 002_3_paragraph_section_1.md
- type: issue_comment.created
with: 002_3_paragraph_section_2.md
- type: issue_comment.created
with: 002_3_paragraph_section_3.md
- type: choice
with: exam.md
to: step3
step3:
link: '{{chapter_2_url}}'
# description: "测试"
transitions:
events: ['note_events']
action:
- type: choice
with: 002_4_paragraph_exam.md
to: step4
step4:
link: '{{chapter_2_url}}'
description: "斜体"
transitions:
events: ['note_events']
action:
- type: issue_comment.created
with: 002_5_italic.md
- type: choice
with: next.md
to: step5
step5:
link: '{{chapter_2_url}}'
description: "粗体"
transitions:
events: ['note_events']
action:
- type: issue_comment.created
with: 002_6_bold.md
- type: choice
with: next.md
to: step6
step6:
link: '{{chapter_2_url}}'
description: "删除线"
transitions:
events: ['note_events']
action:
- type: issue_comment.created
with: 002_7_strikethrough.md
- type: choice
with: exam.md
to: step7
step7:
link: '{{chapter_2_url}}'
# description: "练习1"
transitions:
events: ['note_events']
action:
- type: issue_comment.created
with: 002_9_italic_exam.md
to: step8
step8:
link: '{{chapter_2_url}}'
# description: "练习2"
transitions:
events: ['note_events']
action:
- type: issue_comment.created
with: 002_9_attr_exam.md
- type: choice
with: next.md
to: step9
step9:
link: '{{chapter_2_url}}'
# description: "粗体"
transitions:
events: ['note_events']
action:
- type: issue_comment.created
with: 002_8_end_1.md
to: step10
step10:
link: '{{chapter_2_url}}'
# description: "完成当前章节学习"
transitions:
events: ['close_issue']
action:
- type: create_issue
title: "Markdown :标题"
with: 003_1_header_basic.md
store:
chapter_3_issue: '{{result.data.html_url}}'
- type: issue_comment.created
with: 002_8_end_2.md
to: end
# step2:
# link: '{{chapter_1_url}}'
# description: "创建一个任务列表"
# transitions:
# - events: ['note_events']
# left: '(-|\*)\s+\[[x|X|\s]+\]\s+.+'
# operator: regexp
# right: '{{object_attributes.note}}'
# action:
# - type: issue_comment.created
# with: 001_3_vsc_survey.md
# to: end
# - events: ['note_events']
# else: true
# action:
# - type: issue_comment.created
# with: 001_4_vsc_survey.md
# to: step2
\ No newline at end of file
** :point_down: :point_down: :point_down: 请点击下方的继续学习按钮 **
(x) 继续学习 {{太棒了,让我们看看接下来的学习内容吧}}
|| 小提示:点击继续学习按钮就可以进入下一步啦。 ||
\ No newline at end of file
......@@ -20,7 +20,29 @@
这里是段落一
这里是段落二
当然,你也可以选择在第一行的末尾添加 `<br>` 进行换行,比如:
如果需要对段落进行换行的话,可以使用两个以上空格加上回车,比如:
这里是段落一
这里是段落二
```
这里是段落一
这里是段落二
```
当然,你也可以在段落后面使用一个空行来表示重新开始一个段落,比如:
这里是段落一
这里是段落二
```
这里是段落一
这里是段落二
```
此外,你也可以选择在第一行的末尾添加 `<br>` 进行换行,比如:
```markdown
这里是段落一<br>
......
Markdown 支持两种标题的语法,`Setext``atx` 形式。
\ No newline at end of file
#### Setext 形式标题
`Setext` 形式是用底线的形式,利用 `=` (一级标题)和 `-` (二级标题),例如:
```
标题1
=====
标题2
-------
```
<details><summary> :point_down: 点击查看显示效果 </summary>
<hr>
标题1
=====
标题2
-------
```
<h1>标题1</h1>
<h2>标题2</h2>
```
</details>
<br>
> 注意,Setext 形式的标题至少需要3个以上的 `=` 或 `_` 才可以正常显示为标题样式。
\ No newline at end of file
#### Atx 形式标题
`Atx` 形式则是在行首插入 1 到 6 个 `#`(最多支持 6 级标题) ,对应到标题 1 到 6 级,例如:
```
# 标题1
## 标题2
#### 标题4
###### 标题6
```
<details><summary> :point_down: 点击查看显示效果 </summary>
<hr>
# 标题1
## 标题2
#### 标题4
###### 标题6
</details>
\ No newline at end of file
** 在Markdown文档中最多可设置多少级标题?**
( ) 4 {{回答错误}}
(x) 6 {{正确}}
( ) 7 {{回答错误}}
( ) 无限 {{回答错误}}
|| Markdown 最多支持 6 级的标题设置 ||
\ No newline at end of file
让我们来回顾一下第三章的知识点吧:
1. 标题可以使用 `-` `=` 设置标题
2. 可以使用 `#` 设置标题,至多支持 **6级** 标题设置
##### 在开始新的章节学习之前,请点击下方的 `关闭 Issue` 按钮。
\ No newline at end of file
:thumbsup: :thumbsup: :thumbsup: Well Done!
请开始前往 [第四章《链接》]({{chapter_4_issue}})的课程内容学习
\ No newline at end of file
<https://www.csdn.net>
[ CODE CHINA ](https://codechina.csdn.net/)
[ 学习广场 ](https://codechina.csdn.net/courses "CODE CHINA 学习广场")
打造能够在线编译、在线运行的课件即代码的基础环境,使得[CODE CHINA][1]能够结合云原生技术为 开源技术的教学、学习提供一站式学习、练习的引擎,通过教学培训场景,赋能高校学生及[开发者][develop]成为优秀开源项目的参与者和贡献者,助力更多优秀[开源项目][develop]的产生、发展及壮大。
[1]: https://codechina.csdn.net/courses?utm_source=explore
[develop]: https://www.csdn.net/
** :wave: 请点击下方的开始测试按钮 :point_down: :point_down: :point_down: **
(x) 开始测试 {{准备好了吗?让我们来考考你}}
|| 提示:准备好的话,就点击开始测验按钮吧! ||
\ No newline at end of file
** :wave: 准备好了吗?准备好的话请点击下方的开始学习按钮 :point_down: :point_down: :point_down: **
(x) 开始学习 {{太棒了,让我们开始学习新的内容吧}}
|| 小提示:点击开始学习按钮就ok了 ||
\ No newline at end of file
# # 在所有的任务之前执行
# before:
# link: '{{chapter_1_url}}'
# transitions:
# action:
# - type: create_issue
# title: "Markdown :段落及强调"
# with: 001_1_markdown_basic.md
# store:
# chapter_1_url: '{{result.data.html_url}}'
# - type: choice
# with: first.md
# to: step1
before:
link: '{{chapter_3_issue}}'
transitions:
action:
- type: issue_comment.created
with: first.md
to: step1
# Task 列表
step1:
link: '{{chapter_3_url}}'
description: "Setext 标题"
transitions:
events: ['note_events']
action:
- type: issue_comment.created
with: 003_2_Setext_header.md
- type: choice
with: next.md
to: step2
step2:
link: '{{chapter_3_url}}'
description: "Atx 标题"
transitions:
events: ['note_events']
action:
- type: issue_comment.created
with: 003_3_Atx_header.md
- type: choice
with: exam.md
to: step3
step3:
link: '{{chapter_3_url}}'
# description: "测试"
transitions:
events: ['note_events']
action:
- type: choice
with: 003_4_header_exam.md
to: step5
step5:
link: '{{chapter_3_url}}'
# description: "粗体"
transitions:
events: ['note_events']
action:
- type: issue_comment.created
with: 003_5_end_1.md
to: step6
step6:
link: '{{chapter_3_url}}'
# description: "完成当前章节学习"
transitions:
events: ['close_issue']
action:
- type: create_issue
title: "Markdown :标题"
with: 004_1_link_basic.md
store:
chapter_4_issue: '{{result.data.html_url}}'
- type: issue_comment.created
with: 003_5_end_2.md
to: end
# step2:
# link: '{{chapter_1_url}}'
# description: "创建一个任务列表"
# transitions:
# - events: ['note_events']
# left: '(-|\*)\s+\[[x|X|\s]+\]\s+.+'
# operator: regexp
# right: '{{object_attributes.note}}'
# action:
# - type: issue_comment.created
# with: 001_3_vsc_survey.md
# to: end
# - events: ['note_events']
# else: true
# action:
# - type: issue_comment.created
# with: 001_4_vsc_survey.md
# to: step2
\ No newline at end of file
** :point_down: :point_down: :point_down: 请点击下方的继续学习按钮 **
(x) 继续学习 {{太棒了,让我们看看接下来的学习内容吧}}
|| 小提示:点击继续学习按钮就可以进入下一步啦。 ||
\ No newline at end of file
<https://www.csdn.net>
[ CODE CHINA ](https://codechina.csdn.net/)
[ 学习广场 ](https://codechina.csdn.net/courses "CODE CHINA 学习广场")
打造能够在线编译、在线运行的课件即代码的基础环境,使得[CODE CHINA][1]能够结合云原生技术为 开源技术的教学、学习提供一站式学习、练习的引擎,通过教学培训场景,赋能高校学生及[开发者][develop]成为优秀开源项目的参与者和贡献者,助力更多优秀[开源项目][develop]的产生、发展及壮大。
[1]: https://codechina.csdn.net/courses?utm_source=explore
[develop]: https://www.csdn.net/
Markdown 支持两种形式的链接语法:行内和参考两种形式。不管是哪一种,链接的文字都是用 [方括号] 来标记。
#### 行内形式链接
行内形式的链接是在方块括号后面接括号并插入网址链接即可,如果你还想要加上链接的 alt 提示文字,只要在网址后面,用双引号把 alt 文字包起来即可,其格式为 `[内容](http_url "alt 提示")`,例如:
```
[ CODE CHINA ](https://codechina.csdn.net/)
[ 学习广场 ](https://codechina.csdn.net/courses "CODE CHINA 学习广场")
```
<details><summary> :point_down: 点击查看显示效果 </summary>
<hr>
[ CODE CHINA ](https://codechina.csdn.net/)
[ 学习广场 ](https://codechina.csdn.net/courses "CODE CHINA 学习广场")
```
<p><a href="https://codechina.csdn.net/" target="_blank"> CODE CHINA </a></p>
<p><a href="https://codechina.csdn.net/courses" title="CODE CHINA 学习广场" target="_blank"> 学习广场 </a></p>
```
</details>
\ No newline at end of file
#### 参考形式链接
参考形式的链接使用另外一个方括号接在链接文字的括号后面,而在第二个方括号里面要填入用以辨识链接的标签:
[CODE CHINA] [1]能够结合云原生技术为 开源技术的教学、学习提供一站式学习、练习的引擎,通过教学培训场景
[1]: https://codechina.csdn.net/courses?utm_source=explore
"CODE CHINA 学习广场"
内容部分为:
```
[CODE CHINA][1]能够结合云原生技术为 开源技术的教学、学习提供一站式学习、练习的引擎,通过教学培训场景
```
也可以选择性地在两个方括号中间加上空白:
```
[CODE CHINA] [1]能够结合云原生技术为 开源技术的教学、学习提供一站式学习、练习的引擎,通过教学培训场景
```
接着,我们可以把链接参考部分的内容写在在文档的任意位置,其格式为`[id]: http://example.com/ "Optional Title Here"`
<details><summary> :point_down: 点击查看链接参考部分的内容 </summary>
<hr>
```
[1]: https://codechina.csdn.net/courses?utm_source=explore "CODE CHINA 学习广场"
```
链接网址也可以用方括号包起来:
```
[1]: <https://codechina.csdn.net/courses?utm_source=explore> "CODE CHINA 学习广场"
```
你也可以把 alt 属性放到下一行,也可以加一些缩排,网址太长的话,这样会比较好看:
```
[1]: https://codechina.csdn.net/courses?utm_source=explore
"CODE CHINA 学习广场"
```
</details>
\ No newline at end of file
网址定义只有在产生链接的时候用到,并不会直接出现在文档之中。
链接辨识标签可以有字母、数字、空白和标点符号,但是并不区分大小写,因此下面两个链接是一样的:
[link text][a]
[link text][A]
默认的链接标签功能让你可以省略指定链接标签,这种情形下,链接标签和链接文字会视为相同,要用默认链接标签只要在链接文字后面加上一个空的方括号,如果要让 "Google" 链接到 google.com,可以简化成如下形式:
<details><summary> :point_down: 点击查看简化后的形式 </summary>
<hr>
```
[Google][]
[Google]: http://google.com/
```
</details>
链接的定义可以放在文档中的任何一个地方,建议直接放在链接出现段落的后面,也可以把它放在文档最后面。
> 使用 Markdown 的参考式链接,可以**让文档更像是浏览器最后产生的结果**,把一些标记相关的信息移到段落文字之外,这样**即使增加链接,Markdown 文档的阅读感也不会被打断**。
\ No newline at end of file
:thumbsup: :thumbsup: :thumbsup: Well Done!
\ No newline at end of file
行内链接形式的格式为 `[内容](http_url "alt 提示")`,请再仔细检查一下你的链接格式哟~~~
\ No newline at end of file
参考下方内容,使用行内链接形式,给 CODE CHINA 添加上链接:
CODE CHINA
https://codechina.csdn.net/
让我们来回顾一下第四章的知识点吧:
1. 可以使用 `[内容](http_url "alt 提示")` 的形式添加一个链接
2. 可以使用 参考形式 的方式添加一个链接,其结构为 `[内容][1]` + `[1]: http_url "alt 提示"` 的组合
##### 在开始新的章节学习之前,请点击下方的 `关闭 Issue` 按钮。
\ No newline at end of file
:thumbsup: :thumbsup: :thumbsup: Well Done!
请开始前往 [第五章《图片》]({{chapter_5_issue}})的课程内容学习
\ No newline at end of file
** :wave: 请点击下方的开始测试按钮 :point_down: :point_down: :point_down: **
(x) 开始测试 {{准备好了吗?让我们来考考你}}
|| 提示:准备好的话,就点击开始测验按钮吧! ||
\ No newline at end of file
** :wave: 准备好了吗?准备好的话请点击下方的开始学习按钮 :point_down: :point_down: :point_down: **
(x) 开始学习 {{太棒了,让我们开始学习新的内容吧}}
|| 小提示:点击开始学习按钮就ok了 ||
\ No newline at end of file
# # 在所有的任务之前执行
# before:
# link: '{{chapter_1_url}}'
# transitions:
# action:
# - type: create_issue
# title: "Markdown :段落及强调"
# with: 001_1_markdown_basic.md
# store:
# chapter_1_url: '{{result.data.html_url}}'
# - type: choice
# with: first.md
# to: step1
before:
link: '{{chapter_4_issue}}'
transitions:
action:
- type: issue_comment.created
with: first.md
to: step1
# Task 列表
step1:
link: '{{chapter_4_url}}'
description: "行内形式链接"
transitions:
events: ['note_events']
action:
- type: issue_comment.created
with: 004_2_link_inner.md
- type: choice
with: next.md
to: step2
step2:
link: '{{chapter_4_url}}'
description: "参考形式链接"
transitions:
events: ['note_events']
action:
- type: issue_comment.created
with: 004_3_link_ref_1.md
- type: choice
with: next.md
to: step3
step3:
link: '{{chapter_4_url}}'
# description: "参考形式链接"
transitions:
events: ['note_events']
action:
- type: issue_comment.created
with: 004_3_link_ref_2.md
- type: issue_comment.created
with: 004_3_link_ref_3.md
- type: issue_comment.created
with: 004_3_link_ref_4.md
- type: choice
with: exam.md
to: step4
step4:
link: '{{chapter_4_url}}'
# description: "参考形式链接"
transitions:
events: ['note_events']
action:
- type: issue_comment.created
with: 004_4_link_exam.md
to: step5
step5:
link: '{{chapter_4_url}}'
description: "添加行内链接"
transitions:
- events: ['note_events']
left: '/!?\[.+\]\(.+\)/g'
operator: regexp
right: '{{object_attributes.note}}'
action:
- type: issue_comment.created
with: 004_4_done.md
to: step6
- events: ['note_events']
else: true
action:
- type: issue_comment.created
with: 004_4_error.md
to: step5
step6:
link: '{{chapter_4_url}}'
# description: "粗体"
transitions:
events: ['note_events']
action:
- type: issue_comment.created
with: 004_5_end_1.md
to: step7
step7:
link: '{{chapter_4_url}}'
# description: "完成当前章节学习"
transitions:
events: ['close_issue']
action:
- type: create_issue
title: "Markdown :图片"
with: 005_1_image_basic.md
store:
chapter_4_issue: '{{result.data.html_url}}'
- type: issue_comment.created
with: 004_5_end_2.md
to: end
** :point_down: :point_down: :point_down: 请点击下方的继续学习按钮 **
(x) 继续学习 {{太棒了,让我们看看接下来的学习内容吧}}
|| 小提示:点击继续学习按钮就可以进入下一步啦。 ||
\ No newline at end of file
......@@ -131,7 +131,7 @@ CODE CHINA通过CSDN社区,为入驻的企业机构及个人开源项目提供
- [ ] 工作
- [ ] 睡觉
# Lesson 6 换行、分线及引用
# Lesson 6 换行、分线及引用
## 换行
......
title: "Communicating using Markdown"
description: "This course will walk you through everything you need to start organizing ideas and collaborating using Markdown, a lightweight language for text formatting."
template:
name: "markdown-portfolio"
repo: "communicating-using-md-template"
preferences:
- type: radio
name: gitTool
label: Preferred Git tool
description: You can follow this course's instructions using whichever Git tool you prefer.
options:
- label: GitHub.com
value: dotcom
- label: Command line
value: cli
- type: dropdown
name: language
label: Language
description: Choose your preferred language.
options:
- label: English
value: en
- label: Español
value: es
tags: [
"GitHub","Markdown"
]
before:
- type: updateBranchProtection
branch: main
enforce_admins: true
required_pull_request_reviews:
include_admins: true
- type: createIssue
title: Getting Started with GitHub
body: "00_welcome.md"
comments:
- "00_create-tasklist.md"
steps:
#1 - Create a task list
- title: "Create a task list"
description: "Learn about task lists in your first issue."
event: "issue_comment.created"
link: '{{ repoUrl }}/issues/1'
actions:
- type: gate
left: '(-|\*)\s+\[[x|X|\s]\]\s+.+'
operator: test
right: '%payload.comment.body%'
else:
- type: gate
left: '(-|\*)\s+\[[x|X|\s]+\]\s+.+'
operator: test
right: '%payload.comment.body%'
else:
- type: respond
with: '01_tasklist.md'
- type: respond
with: '01_taskwhitespaces.md'
- type: respond
with: '01_turn-on-ghp.md'
#2 - Turn on GitHub Pages
- title: "Turn on GitHub Pages"
description: "Create serve your repository contents on a web page using GitHub Pages."
event: page_build
link: '{{ repoUrl }}/settings'
actions:
- type: octokit
method: repos.getPages
owner: '%payload.repository.owner.login%'
repo: '%payload.repository.name%'
action_id: pagesUrl
- type: createPullRequest
action_id: pr
title: Give your portfolio a header
body: '02_headers.md'
head: add-headers
data:
thePayload: '%payload%'
- type: closeIssue
issue: Getting Started with GitHub
- type: octokit
method: repos.getPages
owner: '%payload.repository.owner.login%'
repo: '%payload.repository.name%'
action_id: pagesUrl
- type: respond
issue: Getting Started with GitHub
with: '02_close-issue.md'
data:
url: '%actions.pagesUrl.data.html_url%'
prUrl: '%actions.pr.data.html_url%'
#3 - Add headers
- title: "Add headers"
description: "Add headers to some unformatted content."
event: "pull_request.synchronize"
link: '{{ repoUrl }}/pull/2'
actions:
- type: getFileContents
action_id: fileContents
filename: '_includes/01-name.md'
- type: gate
left: '/^#{1,6}\s.+/gm'
operator: test
right: '%actions.fileContents%'
else:
type: respond
with: 03_request-changes.md
- type: removeBranchProtection
- type: respond
with: 03_pr-succeeds.md
#4 - Merge your headers
- title: "Merge your headers"
description: "Merge your first PR to see headers in action."
event: "pull_request.closed"
link: '{{ repoUrl }}/pull/2'
actions:
- type: gate
left: '%payload.pull_request.merged%'
- type: updateBranchProtection
- type: createPullRequest
action_id: pr
title: Introduce yourself to the world
body: 04_add-image.md
head: add-images-links
- type: octokit
method: repos.getPages
owner: '%payload.repository.owner.login%'
repo: '%payload.repository.name%'
action_id: pagesUrl
- type: respond
with: 04_next.md
data:
url: '%actions.pagesUrl.data.html_url%'
prUrl: '%actions.pr.data.html_url%'
#5 - Add an image
- title: "Add an image"
description: "Learn how to place images in Markdown by adding your photo."
event: "pull_request.synchronize"
link: '{{ repoUrl }}/pull/3'
actions:
- type: getFileContents
filename: '_includes/02-image.md'
action_id: fileContents
- type: gate
left: '/!\[.+\]\(.+\)/g'
operator: test
right: '%actions.fileContents%'
else:
type: respond
with: 05_request-changes-image.md
- type: respond
with: 05_image-works-url.md
#6 - Add a profile link
- title: "Add a profile link"
description: "Learn how to create links in Markdown."
event: "pull_request.synchronize"
link: '{{ repoUrl }}/pull/3'
actions:
- type: getFileContents
filename: '_includes/03-links.md'
action_id: fileContents
- type: gate
left: '/!?\[.+\]\(.+\)/g'
operator: test
right: '%actions.fileContents%'
else:
type: respond
with: 06_request-changes-link.md
- type: removeBranchProtection
- type: respond
with: 06_success.md
#7 - Merge your image and link
- title: "Merge your image and link"
description: "Merge your second PR to introduce yourself to the world."
event: "pull_request.closed"
link: '{{ repoUrl }}/pull/3'
actions:
- type: gate
left: '%payload.pull_request.merged%'
- type: updateBranchProtection
- type: createPullRequest
title: A few of your favorite things
body: 07_pr-body.md
action_id: pr
head: add-lists-emphasis
- type: octokit
method: repos.getPages
owner: '%payload.repository.owner.login%'
repo: '%payload.repository.name%'
action_id: pagesUrl
- type: respond
with: 07_next.md
data:
url: '%actions.pagesUrl.data.html_url%'
prUrl: '%actions.pr.data.html_url%'
#8 - Add a list
- title: "Add a list"
description: "Learn to how to create ordered and unordered lists."
event: "pull_request.synchronize"
link: '{{ repoUrl }}/pull/4'
actions:
- type: getFileContents
filename: '_includes/04-lists.md'
action_id: fileContents
- type: gate
left: '/(?:\d\.|\*|-)\s.+/gm'
operator: test
right: '%actions.fileContents%'
else:
type: respond
with: 08_request-changes.md
- type: respond
with: 08_emphasis.md
#9 - Use emphasis
- title: "Use emphasis"
description: "Use bold and italics to emphasize text."
event: "pull_request.synchronize"
link: '{{ repoUrl }}/pull/4'
actions:
- type: getFileContents
filename: '_includes/05-emphasis.md'
action_id: fileContents
- type: gate
left: '/([*|_]{1,2}).+\1/gm'
operator: test
right: '%actions.fileContents%'
else:
type: respond
with: 09_request-changes.md
- type: removeBranchProtection
- type: respond
with: 09_success.md
#10 - Merge lists and emphasis
- title: "Merge lists and emphasis"
description: "Merge the last updates to your portfolio."
event: "pull_request.closed"
link: '{{ repoUrl }}/pull/4'
actions:
- type: gate
left: '%payload.pull_request.merged%'
- type: createIssue
title: More to learn
body: 10_more-to-learn.md
action_id: issue
- type: mergeBranch
head: add-theme
- type: octokit
method: repos.getPages
owner: '%payload.repository.owner.login%'
repo: '%payload.repository.name%'
action_id: pagesUrl
- type: respond
with: 10_next.md
data:
url: '%actions.pagesUrl.data.html_url%'
issueUrl: '%actions.issue.data.html_url%'
- type: octokit
method: repos.update
owner: '%payload.repository.owner.login%'
repo: '%payload.repository.name%'
name: '%payload.repository.name%'
homepage: 'https://%payload.repository.owner.login%.github.io/%payload.repository.name%'
......@@ -12,8 +12,8 @@ chapters:
- title: 'Markdown介绍'
config_path: '01_Markdown介绍/index.yml'
sort_index: 1
- title: '段落及下划线'
config_path: '02_段落及下划线/index.yml'
- title: '段落及强调'
config_path: '02_段落及强调/index.yml'
sort_index: 2
- title: '标题'
config_path: '03_标题/index.yml'
......@@ -27,8 +27,8 @@ chapters:
- title: '列表'
config_path: '06_列表/index.yml'
sort_index: 6
- title: '线及引用'
config_path: '07_分线及引用/index.yml'
- title: '线及引用'
config_path: '07_分线及引用/index.yml'
sort_index: 7
- title: '代码块'
config_path: '08_代码块/index.yml'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册