markdown
markdown
一、百度百科
Markdown 是一种轻量级标记语言,创始人为约翰·格鲁伯(John Gruber)。 它允许人们使用易读易写的纯文本格式编写文档,然后转换成有效的 XHTML(或者HTML)文档。这种语言吸收了很多在电子邮件中已有的纯文本标记的特性。
由于 Markdown 的轻量化、易读易写特性,并且对于图片,图表、数学式都有支持,许多网站都广泛使用 Markdown 来撰写帮助文档或是用于论坛上发表消息。 如 GitHub、Reddit、Diaspora、[Stack Exchange](https://baike.baidu.com/item/Stack Exchange/13777796?fromModule=lemma_inlink)、OpenStreetMap 、SourceForge、简书等,甚至还能被使用来撰写电子书。
世界上最流行的博客平台WordPress和大型CMS如Joomla、Drupal都能很好的支持Markdown。完全采用Markdown编辑器的博客平台有Ghost和Typecho等。
用于编写说明文档,以“README.md”的文件名保存在软件的目录下面。
Markdown可以快速转化为演讲PPT、Word产品文档甚至是用非常少量的代码完成最小可用原型。
二、环境搭建
1. Typora
Typora 是一款由 Abner Lee 开发的轻量级 Markdown 编辑器,与其他 Markdown 编辑器不同的是,Typora 没有采用源代码和预览双栏显示的方式,而是采用所见即所得的编辑方式,实现了即时预览的功能,但也可切换至源代码编辑模式。
Typora0.9.93
版本为免费版
(自行网上下载),后续版本为收费版
2. vscode
vacode可以编写markdown文档,可安装markdown相关插件
vscode中文网(自行下载相关版本)
3.Dillinger
三、语法
参考相关教程:
四、扩展语法实例
1.任务清单
- [ ] Write something here
- [x] Write something here
2.脚注(点击第二条命令形成的箭头回到加注的地方)
这是一个脚注[^1]
这是一个脚注[^1]
[^1]:markdown
3.定义清单
方法1:
First Term : This is the definition of the first term. Second Term : This is one definition of the second term. : This is another definition of the second term.
方法2:
<dl> <dt>First Term</dt> <dd>This is the definition of the first term.</dd> <dt>Second Term</dt> <dd>This is one definition of the second term. </dd> <dd>This is another definition of the second term.</dd> </dl>
效果:
First Term
This is the definition of the first term.
Second Term
This is one definition of the second term.
This is another definition of the second term.
4.删除线
方法:您可以通过在单词中心放置一条水平线来“删除”单词。结果看起来
像这样。此功能使您可以指示某些单词是一个错误,并不表示要包含在文档中。若要删除单词,请~~
在单词前后使用两个波浪号()。~~世界是平坦的。~~ 我们现在知道世界是圆的。
效果:
世界是平坦的。我们现在知道世界是圆的。
5.自动网址链接
许多Markdown处理器会自动将URL转换为链接。这意味着如果您输入http://www.example.com,即使您没有使用方括号,您的Markdown处理器也会自动将其转换为链接。
http://www.example.com
呈现的输出如下所示:
6.禁用自动URL链接
`http://www.example.com`
呈现的输出如下所示:
7.表格
要添加表,请使用三个或多个连字符(
---
)创建每列的标题,并使用管道(|
)分隔每列。您可以选择在表的任一端添加管道
在标题行内的连字符的左侧,右侧或两侧添加一个冒号:,以使列中的文本左,右或居中对齐。
| Syntax | Description | Test Text |
| :--- | :----: | ---: |
| Header | Title | Here's this |
| Paragraph | Text | And more |
Syntax Description Test Text Header Title Here's this Paragraph Text And more