其实应该很早就已经接触到了Markdown这种简洁却彪悍的标记语言,比如Github的README.md,只不过被不走心的我当作txt文档来用了。直到前个看到一位大神的读书列表清单,觉得很新奇,就有意识地查阅了一些语法,瞬间被吸引到了。本文便记录部分常用的语法。

1、标题 #

<!-- MD -->
## this is heading level 2
<!-- HMTL -->
<h2>this is heading level 2</h2>

2、列表

(1)无序列表 +/-/*

<!-- MD -->
* Fruit
+ Apple
+ Banana
+ Orange
* Food
* Animal
<!-- HMTL -->
<ul>
<li>Fruit
<ul><li>Apple</li>
<li>Banana</li>
<li>Orange</li></ul>
</li>
<li>Food</li>
<li>Animal</li>
</ul>

(2)有序列表 数字.

<!--  MD -->
1. Apple
1. Banana
1. Orange
<!-- HMTL -->
<ol>
<li>Apple</li>
<li>Banana</li>
<li>Orange</li>
</ol>

3、引用 >

<!-- MD -->
> I hope this post proves helpful to someone else that encounters the problem.
> > It was almost as frustrating to find the culprit the second time …
<!-- HTML -->
<blockquote>
<p>I hope this post proves helpful to someone else that encounters the problem.</p>
<blockquote>
<p>It was almost as frustrating to find the culprit the second time … </p>
</blockquote>
</blockquote>

4、代码块 `

<!-- MD -->
```javascript
testData = ' - time:' + new Date().getTime() + ' <br> ';
localStorage.setItem("test", testData);
```
<!-- HTML -->
<pre><code class="javascript">testData = ' - time:' + new Date().getTime() + ' &lt;br&gt; ';
localStorage.setItem("test", testData);
</code></pre>

5、强调 */_

<!-- MD -->
This is the *emphasis* code. and That is the most **important** part.
<!-- HTML -->
<p>This is the <em>emphasis</em> code. and That is the most <strong>important</strong> part.</p>

6、超链接 [text] (url title) / [text] [id] .. [id]: url title

(1)内联方式:

<!-- MD -->
This is [inline-link](http://daringfireball.net/projects/markdown/dingus "Title-md demo") inline link.
<!-- HTML -->
<p>This is <a href="http://daringfireball.net/projects/markdown/dingus" title="Title-md demo">inline-link</a> inline link.</p>

(2)引用方式:

<!-- MD -->
This is [ref-link] [ref-1] reference-style link.
[ref-1]: http://daringfireball.net/projects/markdown/dingus "Title-md demo"
<!-- HTML -->
<p>This is <a href="http://daringfireball.net/projects/markdown/dingus" title="Title-md demo">ref-link</a> reference-style link.</p>

7、图片 ![text] (url title) -- 两种方式同超链接

<!-- MD -->
![Alt text](/path/to/img.jpg "Optional title")
<!-- HTML -->
<img alt="Alt text" src="/path/to/img.jpg" title="Optional title">

8、图片 :name:

<!-- MD -->
:+1:
<!-- HTML -->
<img align="absmiddle" alt=":+1:" class="emoji" height="20px" src="https://assets-cdn.github.com/images/icons/emoji/unicode/1f44d.png" title=":+1:" width="20px">

9、脚本引用 [^id]

<!-- MD -->
Footnotes[^fnote-1] are added in-text like so ...
[^fnote-1]:
Footnotes are detailed explanation.
There are always long conents in the footnotes.
<!-- HTML -->
<p>Footnotes<sup id="fnref:fnote-1"><a class="footnote-ref" href="#fn:fnote-1" rel="footnote">1</a></sup> are added in-text like so …</p>
<div class="footnote">
<hr>
<ol>
<li id="fn:fnote-1">
<p>Footnotes are detailed explanation.<br>
There are always long conents in the footnotes.&nbsp;<a class="footnote-backref" href="#fnref:fnote-1" rev="footnote" title="Jump back to footnote 1 in the text">↩</a></p>
</li>
</ol>
</div>

附:使用sublime预览MD文件

安装 :

Ctrl + Shift + P | PCI | Markdown Preview

预览快捷键:(Package Control Messages [To preview] 说明)

{ "keys": ["alt+m"], "command": "markdown_preview", "args": {"target": "browser", "parser":"markdown"} }

参考:

https://daringfireball.net/projects/markdown/syntax

https://rephrase.net/box/word/footnotes/syntax/

http://www.cnblogs.com/hnrainll/p/3514637.html

http://blog.csdn.net/kaitiren/article/details/38513715

http://www.webpagefx.com/tools/emoji-cheat-sheet/

https://www.macstories.net/roundups/sublime-text-2-and-markdown-tips-tricks-and-links/

http://note.youdao.com/share/?id=b2ea64a76aa487a67ea504f70b1bb914&type=note#/

笔记-Markdown常用语法的更多相关文章

  1. MarkDown常用语法表

    MarkDown常用语法表 本文提供全流程,中文翻译.Chinar坚持将简单的生活方式,带给世人!(拥有更好的阅读体验 -- 高分辨率用户请根据需求调整网页缩放比例) 1 Title - 标题 2 H ...

  2. Markdown常用语法学习

    Markdown常用语法学习,这些就够用了. 演示地址: https://github.com/YalongYan/Markdown-- 特别提示:  标题'##'后面必须加一个空格,否则编译不对.# ...

  3. 老贾的幸福生活day3 之markdown常用语法简要

    1.markdown常用语法 标题 一级到六级 用#+空格实现 2.代码块 3个 `实现 python is a ...... 单行代码,用"``" 3.列表 有序列表 跟内容 数 ...

  4. 《Markdown常用语法及快捷键》

    Markdown常用语法及快捷键       [```]+空格--代码格式 [---]+空格--水平分割线 [&emsp]+[;]--空格 [shift]+[tab]--清除当前行的格式

  5. Markdown常用语法

    什么是Markdown Markdown 是一种方便记忆.书写的纯文本标记语言,用户可以使用这些标记符号以最小的输入代价生成极富表现力的文档. 通过Markdown简单的语法,就可以使普通文本内容具有 ...

  6. Markdown 常用语法总结

    注意:Markdown使用#.+.*等符号来标记,符号后面必须跟上至少跟上 1个空格才有效! Markdown的常用语法 标题 Markdown标题支持两种形式. 1.用#标记 在标题开头加上1~6个 ...

  7. markdown常用语法总结

    转自markdown示例[模板] 1.1.段落标题 根据原文中的文档标题可以对应设置标题. # 一级标题## 二级标题### 三级标题 效果 => 一级标题 二级标题 三级标题 1.2.斜体.加 ...

  8. Markdown常用语法对应

    这是一遍备忘录,当忘记Markdown的语法的时候,就到这里来参照. 第一部分是markdown的语法,紧接着就是该语法的效果. 代码语法高亮 ```javascript function synta ...

  9. markdown常用语法使用笔记

    markdown是当下比较流行的一种编辑标记语言,很多系统都支持markdown语法来编辑文件内容,像gitbook之类的,一下是一些学习笔记. 1.开头用#的数量表示1-6阶的标题,结尾可以以任意数 ...

随机推荐

  1. Swift-9-类和结构体

    // Playground - noun: a place where people can play import UIKit // 几个重要的概念Properties/Methods/Subscr ...

  2. checkbox 更新回显

    if($row['name']==$_SESSION['name']){$checked="checked disabled";}else{$checked=" &quo ...

  3. 数组有没有length()这个方法?String有没有length()这个方法?

    数组有没有length()这个方法?String有没有length()这个方法? 解答:数组没有length()方法 它有length属性 String有length()方法.

  4. SQLServerException:通过端口 1433 连接到主机 localhost 的 TCP/IP 连接失败。

    一.问题描述: 1.连接数据库时抛出的异常: com.microsoft.sqlserver.jdbc.SQLServerException: 通过端口 1433 连接到主机 localhost 的 ...

  5. Axure9 v9.0.0.3629 ~ v9.0.0.3633 授权密钥 【2019.02.05】

    现在提供一个支持v9.0.0.3629.v9.0.0.3630.v9.0.0.3631.v9.0.0.3632.v9.0.0.3633的授权码(后续的Beta更新版本应该能继续使用) 被授权人:zd4 ...

  6. 开发新手教程【三】Arduino开发工具

    Arduino开发环境搭建 获取Arduino IDE开发工具 下载地址 :http://arduino.cc/en/Main/Software 能够下载release 版.Beta版和前期版本号 A ...

  7. Docker for window 无法共享磁盘

    Docker for window 无法共享主机磁盘,环境如下: 操作系统: windown10 Docker version 18.09.0, build 4d60db4 症状如下: 如图,点击ap ...

  8. Machine Learning Yearning - Andrew NG

    链接(1~12章): https://gallery.mailchimp.com/dc3a7ef4d750c0abfc19202a3/files/Machine_Learning_Yearning_V ...

  9. 一起学android之设置ListView数据显示的动画效果(24)

    效果图: watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvaGFpX3FpbmdfeHVfa29uZw==/font/5a6L5L2T/fontsize/40 ...

  10. Java Base64解析

    最近在业务场景中,需要对第三方传递进来的字符进行base64解密,根据第三方文档提供的解析工具,对数据进行了解析,关于Base64的解析方式如下: String sign = "xxxxxx ...