MarkDown 简明语法 Published on Jan 22, 2018 in Notes with 0 comment MarkDown # 基础 ## 分级标题 ``` txt # Header 1 ## Header 2 ### Header 3 #### Header 4 ##### Header 5 ###### Header 6 ``` > # Header 1 > ## Header 2 > ### Header 3 > #### Header 4 > ##### Header 5 > ###### Header 6 ## 文本样式 | - | 效果 | 语法 | |:-----|:---:|:---:| | 斜体 | *Text* | `*Text*` | | 粗体 | **Text** | `**Text**` | | 斜粗体 | ***Text*** | `***Text***` | | 删除线 | ~~Text~~ | `~~Text~~` | ## 无序列表 ``` txt - 列表文本前使用 [减号+空格] + 列表文本前使用 [加号+空格] * 列表文本前使用 [星号+空格] ``` - 列表文本前使用 [减号+空格] + 列表文本前使用 [加号+空格] * 列表文本前使用 [星号+空格] ## 有序列表 ``` txt 1. 列表前使用 [数字+点号+空格] 3. 显示的时候会自动把这里的 3 纠正为 2 ``` 1. 列表前使用 [数字+点号+空格] 3. 显示的时候会自动把这里的 3 纠正为 2 ## 引用 ``` txt > 一级引用 >> 二级引用 > 返回一级引用,这里需要一个空行过渡 ``` > 一级引用 >> 二级引用 > 返回一级引用,这里需要一个空行过渡 ## 内嵌代码 使用反引号 \` 来插入代码区段或者标记关键字 C语言中`sizeof`是一个`关键字` ## 代码块 \``` bash # print a pangram function print_a_pangram() { echo "The quick brown fox jumps over the lazy dog." } \``` ``` bash # print a pangram function print_a_pangram() { echo "The quick brown fox jumps over the lazy dog." } ``` ## 分隔线 三个以上的减号或星号 ``` txt --- *** ``` --- *** ## 链接与图像 ### 链接 内联风格:**`[描述](URL Title)`**,其中 Title 为可选项。 ``` txt This is a link to my [blog](https://www.ionlab.cn "IonLab"). ``` This is a link to my [blog](https://www.ionlab.cn "IonLab"). 引用风格: ``` This is a link to [Google][google]. [google]: https://www.google.com "Google Search" ``` This is a link to [Google][google]. [google]: https://www.google.com "Google Search" ### 图像 内联风格:**`![描述](图片地址)`** ``` txt ![Logo](https://www.ionlab.cn/images/logo.png) ``` ![Logo](https://www.ionlab.cn/images/logo.png) 引用风格: ``` txt ![Logo][LogoURL] [LogoURL]: https://www.ionlab.cn/images/logo.png ``` ![Logo][LogoURL] [LogoURL]: https://www.ionlab.cn/images/logo.png # 进阶 ## 注脚 ``` txt 这里是一个注脚[^keyword] [^keyword]: 这里是注脚的文本 ``` 这里是一个注脚[^keyword] [^keyword]: 这里是注脚的文本 ## LaTeX 公式 使用 **`$`** 表示行内公式,**`$$`** 表示整行公式;访问 [MathJax](http://meta.math.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference) 参考更多使用方法。 ``` $$E=mc^2$$ ``` $$E=mc^2$$ ## 表格支持 ``` txt |Left align| Center align | Right align | |:---------|:------------:|------------:| |C |CPP |Java | |Bash |Lua |Python | ``` |Left align| Center align | Right align | |:---------|:------------:|------------:| |C |CPP |Java | |Bash |Lua |Python | ## Html 标签 ``` html 值日生 星期一 星期二 星期三 李雷 韩梅梅 Polly ``` 值日生 星期一 星期二 星期三 李雷 韩梅梅 Polly # 参考文档 - https://www.zybuluo.com/mdeditor - https://www.linpx.com/p/simple-markdown-entry.html#directory079932635346376691 - https://meta.stackoverflow.com/questions/260543/triple-backticks-for-code-blocks-like-github-flavored-markdown 本文由 创作,采用 知识共享署名4.0 国际许可协议进行许可。本站文章除注明转载/出处外,均为本站原创或翻译,转载前请务必署名。