Markdown 简明教程
source link: https://knightyun.github.io/2018/03/27/Markdown-tutorial
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Markdown 及扩展
Markdown 是一种轻量级标记语言,它允许人们使用易读易写的纯文本格式编写文档,然后转换成格式丰富的HTML页面。 —— [ 维基百科 ]
使用简单的符号标识不同的标题,将某些文字标记为粗体或者斜体,创建一个链接等,详细语法参考帮助?。
本编辑器支持 Markdown Extra , 扩展了很多好用的功能。具体请参考Github.
Markdown Extra 表格语法:
项目 价格 Computer $1600 Phone $12 Pipe $1
项目 | 价格
---------|------
Computer | $1600
Phone | $12
Pipe | $1
可以使用冒号来定义对齐方式:
项目 价格 数量 Computer 1600 元 5 Phone 12 元 12 Pipe 1 元 234
| 项目 | 价格 | 数量 |
|:--------- |--------:|:----:|
| Computer | 1600 元 | 5 |
| Phone | 12 元 | 12 |
| Pipe | 1 元 | 234 |
![picture-name](http://xxx.com/xxx.png)
格式二:(方便设置图片尺寸)
<img src="http://xxx.com/xxx.png" alt="download-failed" width="XXXpx" height="XXXpx">
Markdown Extra 定义列表语法:
项目3
- 项目1
- 项目2
- 定义 A
- 定义 a
- 定义 B
项目3
: 定义 C
: 定义 D
> 定义 E
代码块语法遵循标准markdown代码,例如:
python:
@requires_authorization
def somefunc(param1='', param2=0):
'''A docstring'''
if param1 > param2: # interesting
print 'Greater'
return (param2 - param1 + 1) or None
class SomeClass:
pass
>>> message = '''interpreter
... prompt'''
#include <stdio.h>
int main()
{
printf("Hello world!");
}
生成一个脚注[^footnote]. [^footnote]: 这里是 脚注 的 内容.
生成一个脚注[^footnote].
[^footnote]: 这里是 **脚注** 的 *内容*.
使用 MathJax 渲染 LaTex 数学公式,详见 math.stackexchange.com.
数学公式为:$ \Gamma(n) = (n-1)!\quad\forall n\in\mathbb N $。
数学公式为:$ \Gamma(n) = (n-1)!\quad\forall n\in\mathbb N $。
块级公式:
\[x = \dfrac{-b \pm \sqrt{b^2 - 4ac}}{2a}\]
$$ x = \dfrac{-b \pm \sqrt{b^2 - 4ac}}{2a} $$
更多LaTex语法请参考 这里.
浏览器兼容
- 目前,本编辑器对 Chrome 浏览器支持最为完整。建议大家使用较新版本的 Chrome。
- IE9 以下不支持
- IE9,10,11 存在以下问题
- 不支持离线功能
- IE9 不支持文件导入导出
- IE10 不支持拖拽文件导入
常用 Markdown 编辑器推荐
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK