StackEdit保姆级别使用教程

一、我们需要了解:Markdown 是什么?

Markdown 是一种轻量级的标记语言,可用于在纯文本文档中添加格式化元素。Markdown 由 John Gruber 于 2004 年创建,如今已成为世界上最受欢迎的标记语言之一。

二、为什么要使用 Markdown?

你可能想知道为什么人们使用 Markdown 而不是所用即所得(WYSIWYG)编辑器。当你可以通过按下界面中的按钮来格式化文本时,为什么还要使用 Markdown 来书写呢?事实证明,人们使用 Markdown 而不是 WYSIWYG 编辑器的原因有以下几个:

  • Markdown 处处可用。人们使用它来创建 网站文档便签书籍演示文稿邮件 和 技术文档

  • Markdown 是可移植的。几乎可以使用任何应用程序打开包含 Markdown 格式的文本文件。如果你不喜欢当前使用的 Markdown 应用程序了,则可以将 Markdown 文件导入另一个 Markdown 应用程序中。这与 Microsoft Word 等文字处理应用程序形成了鲜明的对比,Microsoft Word 将你的内容锁定在专有文件格式中。

  • Markdown 是独立于平台的。你可以在运行任何操作系统的任何设备上创建 Markdown 格式的文本。

  • Markdown 能适应未来的变化。即使你正在使用的应用程序将来会在某个时候不能使用了,你仍然可以使用文本编辑器读取 Markdown 格式的文本。当涉及需要无限期保存的书籍、大学论文和其他里程碑式的文件时,这是一个重要的考虑因素。

  • Markdown 无处不在。例如 Reddit 和 GitHub 等网站都支持 Markdown,许多桌面和基于 Web 的应用程序也都支持 Markdown。

Markdown 的工作原理

总而言之,这是一个四步的过程:

  1. 使用文本编辑器或 Markdown 专用的应用程序创建 Markdown 文件。该文件应带有 .md 或 .markdown 扩展名。
  2. 在 Markdown 应用程序中打开 Markdown 文件。
  3. 使用 Markdown 应用程序将 Markdown 文件转换为 HTML 文档。
  4. 在 web 浏览器中查看 HTML 文件,或使用 Markdown 应用程序将其转换为其他文件格式,例如 PDF。

三、Markdown 有什么用?

Markdown 是做笔记、为网站创建内容以及生成可打印文档的快速、简便的方法。

四、Markdown语法速查表

标题(Heading)# H1
## H2
### H3
粗体(Bold)**bold text**
斜体(Italic)*italicized text*
引用块(Blockquote)> blockquote
有序列表(Ordered List)1. First item
2. Second item
3. Third item
无序列表(Unordered List)- First item
- Second item
- Third item
代码(Code)`code`
分隔线(Horizontal Rule)---
链接(Link)[title](https://www.example.com)
图片(Image)![alt text](image.jpg)

五、常用语法讲解

5.1标题格式(注意空格)

# 标题1
## 标题2
### 标题3

5.2 特殊字体

**bold tect**                  粗体

*italicized text*              斜体

>这是一段引用              引用

5.3 有序与无序列表

有序列表的写法(自动编号,前面数字不影响)
1. 这是第一点
2. 这是第二点
3. 这是第三点
或者
1. First item  
1. Second item  
1. Third item  
1. Fourth item

无序列表的写法:
- 这是无序列表

注意:要在保留列表连续性的同时在列表中添加另一种元素,请将该元素缩进四个空格或一个制表符。
* This is the first list item.
* Here's the second list item.

    >I need to add another paragraph below the second list item.

* And here's the third list item.

5.4 代码与代码块

代码(反引号):
`code`

代码块:
```  
{  
"firstName": "John",  
"lastName": "Smith",  
"age": 25  
}  
```
注意:代码块通常采用四个空格或一个制表符缩进。当它们被放在列表中时,请将它们缩进八个空格或两个制表符,并且前后各留出一行空白行。


1.  Open the file.
2.  Find the following code block on line 21:

        <html>
          <head>
            <title>Test</title>
          </head>

3.  Update the title to match the name of your website.

5.5 分割线
分割线 (段落分隔线的前后均添加空白行)
---

5.6 链接
[链接名](https://www.example.com)

5.7 图片

图片:请添加感叹号(`!`),紧跟着是方括号,方括号中可添加备用文本(alt text,即图片显示失败后显示此文本),最后跟着圆括号,圆括号中添加图片资源的路径或 URL。你可以选择在圆括号中的路径或 URL 之后添加标题。
![bizhi](/assets/images/san-juan-mountains.jpg "Mountains")

5.8 表格(第二行是分割线)

| Syntax | Description |  
| ----------- | ----------- |  
| Header | Title |  
| Paragraph | Text |

在标题行中的连字符(hyphens)的左侧或右侧或两侧添加冒号(`:`),可以将对应列中的文本向左或向右或居中对齐。
| Syntax      | Description | Test Text     |
| :---        |   :----:   |          ---: |
| Header      | Title       | Here's this   |
| Paragraph   | Text        | And more      |

5.9 脚注

Here's a sentence with a footnote. [^1]
[^1]: This is the footnote.

5.10 定义列表

term
:  list

5.11 增加删除线

~~add delete line~~

5.12 任务列表

 - [x] 这里是打了勾的列表文本
 - [ ] 这是列表文本


 5.13 一些emoji

:joy:
:cry:
:smile:
:tent:
:dizzy:
:bed:

5.14 突出文本

==very  important words.==

5.15 上下标·

上标: X^2^(x的平方)
下标:   H~2~O(水分子)

5.16 换行

除非段落在列表中,否则不要用空格或者制表符缩进段落 
换行:
行1<br>行2

5.17 块引用与嵌套块引用

5.17.1 块引用

> Dorothy followed her through many of the beautiful rooms in her castle.
>
> The Witch bade her clean the pots and kettles and sweep the floor and keep the fire fed with wood.

块引用:可以包含其他格式
> #### The quarterly results look great!
>
> - Revenue was off the chart.
> - Profits were higher than ever.
>
>  *Everything* is going according to **plan**.

5.17.2 嵌套块引用

嵌套块引用:在嵌套的段落前加>>
> Dorothy followed her through many of the beautiful rooms in her castle.
>
>> The Witch bade her clean the pots and kettles and sweep the floor and keep the fire fed with wood.

5.18 转义反引号

如果你要表示为代码的单词或短语中包含一个或多个反引号,则可以通过将单词或短语包裹在双反引号(` `` `)中,则会保留单词或短语中的反引号
``Use `code` in your Markdown file.``

5.19 快速转换为链接

将 URL 或电子邮件地址快速转换为链接,请将其括在尖括号中:
<https://www.markdownguide.org>
<fake@example.com>

5.20 其他注意事项

不同的 Markdown 应用程序在处理 URL 中间的空格方面是不一样的。为了兼容起见,请尽量使用 '%20' (空格的编码形式)来代替空格
[link](https://www.example.com/my%20great%20page)

要保留原字符,前面加\;在表格中显示管道符使用&#124

语法高亮(代码块前加编程语言名称)
```python
{
print(1)
}
```


 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值