个人随笔
目录
编辑器markdown的基本使用
2019-01-30 21:15:02

语法

  1. 标题
  2. # Heading 1
  3. ## Heading 2
  4. ### Heading 3
  5. #### Heading 4
  6. ##### Heading 5
  7. ###### Heading 6
  8. # Heading 1 link [Heading link](https://github.com/pandao/editor.md "Heading link")
  9. ## Heading 2 link [Heading link](https://github.com/pandao/editor.md "Heading link")
  10. ### Heading 3 link [Heading link](https://github.com/pandao/editor.md "Heading link")
  11. #### Heading 4 link [Heading link](https://github.com/pandao/editor.md "Heading link") Heading link [Heading link](https://github.com/pandao/editor.md "Heading link")
  12. ##### Heading 5 link [Heading link](https://github.com/pandao/editor.md "Heading link")
  13. ###### Heading 6 link [Heading link](https://github.com/pandao/editor.md "Heading link")
  14. #### 标题(用底线的形式)Heading (underline)
  15. This is an H1
  16. =============
  17. This is an H2
  18. -------------
  19. ### 字符效果和横线等
  20. ----
  21. ~~删除线~~ <s>删除线(开启识别HTML标签时)</s>
  22. *斜体字* _斜体字_
  23. **粗体** __粗体__
  24. ***粗斜体*** ___粗斜体___
  25. 上标:X<sub>2</sub>,下标:O<sup>2</sup>
  26. **缩写(同HTMLabbr标签)**
  27. > 即更长的单词或短语的缩写形式,前提是开启识别HTML标签时,已默认开启
  28. The <abbr title="Hyper Text Markup Language">HTML</abbr> specification is maintained by the <abbr title="World Wide Web Consortium">W3C</abbr>.
  29. ### 引用 Blockquotes
  30. > 引用文本 Blockquotes
  31. 引用的行内混合 Blockquotes
  32. > 引用:如果想要插入空白换行`即<br />标签`,在插入处先键入两个以上的空格然后回车即可,[普通链接](http://localhost/)。
  33. ### 锚点与链接 Links
  34. [普通链接](http://localhost/)
  35. [普通链接带标题](http://localhost/ "普通链接带标题")
  36. 直接链接:<https://github.com>
  37. [锚点链接][anchor-id]
  38. [anchor-id]: http://www.this-anchor-link.com/
  39. [mailto:test.test@gmail.com](mailto:test.test@gmail.com)
  40. GFM a-tail link @pandao 邮箱地址自动链接 test.test@gmail.com www@vip.qq.com
  41. > @pandao
  42. ### 多语言代码高亮 Codes
  43. #### 行内代码 Inline code
  44. 执行命令:`npm install marked`
  45. #### 缩进风格
  46. 即缩进四个空格,也做为实现类似 `<pre>` 预格式化文本 ( Preformatted Text ) 的功能。
  47. <?php
  48. echo "Hello world!";
  49. ?>
  50. 预格式化文本:
  51. | First Header | Second Header |
  52. | ------------- | ------------- |
  53. | Content Cell | Content Cell |
  54. | Content Cell | Content Cell |
  55. #### JS代码 
  56. ```
  57. ```javascript
  58. function test() {
  59. console.log("Hello world!");
  60. }
  61. (function(){
  62. var box = function() {
  63. return box.fn.init();
  64. };
  65. box.prototype = box.fn = {
  66. init : function(){
  67. console.log('box.init()');
  68. return this;
  69. },
  70. add : function(str) {
  71. alert("add", str);
  72. return this;
  73. },
  74. remove : function(str) {
  75. alert("remove", str);
  76. return this;
  77. }
  78. };
  79. box.fn.init.prototype = box.fn;
  80. window.box =box;
  81. })();
  82. var testBox = box();
  83. testBox.add("jQuery").remove("jQuery");
  84. ```
  85. #### HTML 代码 HTML codes
  86. ```html
  87. <!DOCTYPE html>
  88. <html>
  89. <head>
  90. <mate charest="utf-8" />
  91. <meta name="keywords" content="Editor.md, Markdown, Editor" />
  92. <title>Hello world!</title>
  93. <style type="text/css">
  94. body{font-size:14px;color:#444;font-family: "Microsoft Yahei", Tahoma, "Hiragino Sans GB", Arial;background:#fff;}
  95. ul{list-style: none;}
  96. img{border:none;vertical-align: middle;}
  97. </style>
  98. </head>
  99. <body>
  100. <h1 class="text-xxl">Hello world!</h1>
  101. <p class="text-green">Plain text</p>
  102. </body>
  103. </html>
  104. ```
  105. ### 图片 Images
  106. Image:
  107. ![](https://pandao.github.io/editor.md/examples/images/4.jpg)
  108. > Follow your heart.
  109. ![](https://pandao.github.io/editor.md/examples/images/8.jpg)
  110. > 图为:厦门白城沙滩
  111. 图片加链接 (Image + Link):
  112. [![](https://pandao.github.io/editor.md/examples/images/7.jpg)](https://pandao.github.io/editor.md/images/7.jpg "李健首张专辑《似水流年》封面")
  113. > 图为:李健首张专辑《似水流年》封面
  114. ----
  115. ### 列表 Lists
  116. #### 无序列表(减号)Unordered Lists (-)
  117. - 列表一
  118. - 列表二
  119. - 列表三
  120. #### 无序列表(星号)Unordered Lists (*)
  121. * 列表一
  122. * 列表二
  123. * 列表三
  124. #### 无序列表(加号和嵌套)Unordered Lists (+)
  125. + 列表一
  126. + 列表二
  127. + 列表二-1
  128. + 列表二-2
  129. + 列表二-3
  130. + 列表三
  131. * 列表一
  132. * 列表二
  133. * 列表三
  134. #### 有序列表 Ordered Lists (-)
  135. 1. 第一行
  136. 2. 第二行
  137. 3. 第三行
  138. #### GFM task list
  139. - [x] GFM task list 1
  140. - [x] GFM task list 2
  141. - [ ] GFM task list 3
  142. - [ ] GFM task list 3-1
  143. - [ ] GFM task list 3-2
  144. - [ ] GFM task list 3-3
  145. - [ ] GFM task list 4
  146. - [ ] GFM task list 4-1
  147. - [ ] GFM task list 4-2
  148. ----
  149. ### 绘制表格 Tables
  150. | 项目 | 价格 | 数量 |
  151. | -------- | -----: | :----: |
  152. | 计算机 | $1600 | 5 |
  153. | 手机 | $12 | 12 |
  154. | 管线 | $1 | 234 |
  155. First Header | Second Header
  156. ------------- | -------------
  157. Content Cell | Content Cell
  158. Content Cell | Content Cell
  159. | First Header | Second Header |
  160. | ------------- | ------------- |
  161. | Content Cell | Content Cell |
  162. | Content Cell | Content Cell |
  163. | Function name | Description |
  164. | ------------- | ------------------------------ |
  165. | `help()` | Display the help window. |
  166. | `destroy()` | **Destroy your computer!** |
  167. | Left-Aligned | Center Aligned | Right Aligned |
  168. | :------------ |:---------------:| -----:|
  169. | col 3 is | some wordy text | $1600 |
  170. | col 2 is | centered | $12 |
  171. | zebra stripes | are neat | $1 |
  172. | Item | Value |
  173. | --------- | -----:|
  174. | Computer | $1600 |
  175. | Phone | $12 |
  176. | Pipe | $1 |
  177. ----
  178. #### 特殊符号 HTML Entities Codes
  179. &copy; & &uml; &trade; &iexcl; &pound;
  180. &amp; &lt; &gt; &yen; &euro; &reg; &plusmn; &para; &sect; &brvbar; &macr; &laquo; &middot;
  181. X&sup2; Y&sup3; &frac34; &frac14; &times; &divide; &raquo;
  182. 18&ordm;C &quot; &apos;
  183. [========]
  184. ### Emoji表情 :smiley:
  185. > Blockquotes :star:
  186. #### GFM task lists & Emoji & fontAwesome icon emoji & editormd logo emoji :editormd-logo-5x:
  187. - [x] :smiley: @mentions, :smiley: #refs, [links](), **formatting**, and <del>tags</del> supported :editormd-logo:;
  188. - [x] list syntax required (any unordered or ordered list supported) :editormd-logo-3x:;
  189. - [x] [ ] :smiley: this is a complete item :smiley:;
  190. - [ ] []this is an incomplete item [test link](#) :fa-star: @pandao;
  191. - [ ] [ ]this is an incomplete item :fa-star: :fa-gear:;
  192. - [ ] :smiley: this is an incomplete item [test link](#) :fa-star: :fa-gear:;
  193. - [ ] :smiley: this is :fa-star: :fa-gear: an incomplete item [test link](#);
  194. #### 反斜杠 Escape
  195. \*literal asterisks\*
  196. [========]
  197. ### 科学公式 TeX(KaTeX)
  198. $$E=mc^2$$
  199. 行内的公式$$E=mc^2$$行内的公式,行内的$$E=mc^2$$公式。
  200. $$x > y$$
  201. $$\(\sqrt{3x-1}+(1+x)^2\)$$
  202. $$\sin(\alpha)^{\theta}=\sum_{i=0}^{n}(x^i + \cos(f))$$
  203. 多行公式:
  204. ```math
  205. \displaystyle
  206. \left( \sum\_{k=1}^n a\_k b\_k \right)^2
  207. \leq
  208. \left( \sum\_{k=1}^n a\_k^2 \right)
  209. \left( \sum\_{k=1}^n b\_k^2 \right)
  210. ```
  211. ```katex
  212. \displaystyle
  213. \frac{1}{
  214. \Bigl(\sqrt{\phi \sqrt{5}}-\phi\Bigr) e^{
  215. \frac25 \pi}} = 1+\frac{e^{-2\pi}} {1+\frac{e^{-4\pi}} {
  216. 1+\frac{e^{-6\pi}}
  217. {1+\frac{e^{-8\pi}}
  218. {1+\cdots} }
  219. }
  220. }
  221. ```
  222. ```latex
  223. f(x) = \int_{-\infty}^\infty
  224. \hat f(\xi)\,e^{2 \pi i \xi x}
  225. \,d\xi
  226. ```
  227. ### 分页符 Page break
  228. > Print Test: Ctrl + P
  229. [========]
  230. ### 绘制流程图 Flowchart
  231. ```flow
  232. st=>start: 用户登陆
  233. op=>operation: 登陆操作
  234. cond=>condition: 登陆成功 Yes or No?
  235. e=>end: 进入后台
  236. st->op->cond
  237. cond(yes)->e
  238. cond(no)->op
  239. ```
  240. [========]
  241. ### 绘制序列图 Sequence Diagram
  242. ```seq
  243. Andrew->China: Says Hello
  244. Note right of China: China thinks\nabout it
  245. China-->Andrew: How are you?
  246. Andrew->>China: I am good thanks!
  247. ```
  248. ### End

效果

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5
Heading 6

Heading 1 link Heading link

标题(用底线的形式)Heading (underline)

This is an H1

This is an H2

字符效果和横线等


删除线 删除线(开启识别HTML标签时)
斜体字 斜体字
粗体 粗体
粗斜体 粗斜体

上标:X2,下标:O2

缩写(同HTML的abbr标签)

即更长的单词或短语的缩写形式,前提是开启识别HTML标签时,已默认开启

The HTML specification is maintained by the W3C.

引用 Blockquotes

引用文本 Blockquotes

引用的行内混合 Blockquotes

引用:如果想要插入空白换行即<br />标签,在插入处先键入两个以上的空格然后回车即可,普通链接

普通链接

普通链接带标题

直接链接:https://github.com

锚点链接

mailto:test.test@gmail.com

GFM a-tail link @pandao 邮箱地址自动链接 test.test@gmail.com www@vip.qq.com

@pandao

多语言代码高亮 Codes

行内代码 Inline code

执行命令:npm install marked

缩进风格

即缩进四个空格,也做为实现类似 <pre> 预格式化文本 ( Preformatted Text ) 的功能。

  1. <?php
  2. echo "Hello world!";
  3. ?>

预格式化文本:

  1. | First Header | Second Header |
  2. | ------------- | ------------- |
  3. | Content Cell | Content Cell |
  4. | Content Cell | Content Cell |

JS代码 

  1. ```javascript
  2. function test() {
  3. console.log("Hello world!");
  4. }
  5. (function(){
  6. var box = function() {
  7. return box.fn.init();
  8. };
  9. box.prototype = box.fn = {
  10. init : function(){
  11. console.log('box.init()');
  12. return this;
  13. },
  14. add : function(str) {
  15. alert("add", str);
  16. return this;
  17. },
  18. remove : function(str) {
  19. alert("remove", str);
  20. return this;
  21. }
  22. };
  23. box.fn.init.prototype = box.fn;
  24. window.box =box;
  25. })();
  26. var testBox = box();
  27. testBox.add("jQuery").remove("jQuery");

HTML 代码 HTML codes

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <mate charest="utf-8" />
  5. <meta name="keywords" content="Editor.md, Markdown, Editor" />
  6. <title>Hello world!</title>
  7. <style type="text/css">
  8. body{font-size:14px;color:#444;font-family: "Microsoft Yahei", Tahoma, "Hiragino Sans GB", Arial;background:#fff;}
  9. ul{list-style: none;}
  10. img{border:none;vertical-align: middle;}
  11. </style>
  12. </head>
  13. <body>
  14. <h1 class="text-xxl">Hello world!</h1>
  15. <p class="text-green">Plain text</p>
  16. </body>
  17. </html>

图片 Images

Image:

Follow your heart.

图为:厦门白城沙滩

图片加链接 (Image + Link):

图为:李健首张专辑《似水流年》封面


列表 Lists

无序列表(减号)Unordered Lists (-)

  • 列表一
  • 列表二
  • 列表三

无序列表(星号)Unordered Lists (*)

  • 列表一
  • 列表二
  • 列表三

无序列表(加号和嵌套)Unordered Lists (+)

  • 列表一
  • 列表二
    • 列表二-1
    • 列表二-2
    • 列表二-3
  • 列表三
    • 列表一
    • 列表二
    • 列表三

有序列表 Ordered Lists (-)

  1. 第一行
  2. 第二行
  3. 第三行

GFM task list

  • GFM task list 1
  • GFM task list 2
  • GFM task list 3
    • GFM task list 3-1
    • GFM task list 3-2
    • GFM task list 3-3
  • GFM task list 4
    • GFM task list 4-1
    • GFM task list 4-2

绘制表格 Tables

项目 价格 数量
计算机 $1600 5
手机 $12 12
管线 $1 234
First Header Second Header
Content Cell Content Cell
Content Cell Content Cell
First Header Second Header
Content Cell Content Cell
Content Cell Content Cell
Function name Description
help() Display the help window.
destroy() Destroy your computer!
Left-Aligned Center Aligned Right Aligned
col 3 is some wordy text $1600
col 2 is centered $12
zebra stripes are neat $1
Item Value
Computer $1600
Phone $12
Pipe $1

特殊符号 HTML Entities Codes

© & ¨ ™ ¡ £
& < > ¥ € ® ± ¶ § ¦ ¯ « ·

X² Y³ ¾ ¼ × ÷ »

18ºC " '


Emoji表情 :smiley:

Blockquotes :star:

GFM task lists & Emoji & fontAwesome icon emoji & editormd logo emoji

  • :smiley: @mentions, :smiley: #refs, links, formatting, and tags supported ;
  • list syntax required (any unordered or ordered list supported) ;
  • [ ] :smiley: this is a complete item :smiley:;
  • []this is an incomplete item test link @pandao;
  • [ ]this is an incomplete item ;

反斜杠 Escape

*literal asterisks*


科学公式 TeX(KaTeX)

E=mc2E=mc^2

行内的公式E=mc2E=mc^2行内的公式,行内的E=mc2E=mc^2公式。

x>yx > y

(3x1+(1+x)2)(\sqrt{3x-1}+(1+x)^2)

sin(α)θ=i=0n(xi+cos(f))\sin(\alpha)^{\theta}=\sum_{i=0}^{n}(x^i + \cos(f))

多行公式:

(_k=1na_kb_k)2(_k=1na_k2)(_k=1nb_k2)\displaystyle \left( \sum\_{k=1}^n a\_k b\_k \right)^2 \leq \left( \sum\_{k=1}^n a\_k^2 \right) \left( \sum\_{k=1}^n b\_k^2 \right)

1(ϕ5ϕ)e25π=1+e2π1+e4π1+e6π1+e8π1+\displaystyle \frac{1}{ \Bigl(\sqrt{\phi \sqrt{5}}-\phi\Bigr) e^{ \frac25 \pi}} = 1+\frac{e^{-2\pi}} {1+\frac{e^{-4\pi}} { 1+\frac{e^{-6\pi}} {1+\frac{e^{-8\pi}} {1+\cdots} } } }

f(x)=f^(ξ)e2πiξxdξf(x) = \int_{-\infty}^\infty \hat f(\xi)\,e^{2 \pi i \xi x} \,d\xi

分页符 Page break

Print Test: Ctrl + P


绘制流程图 Flowchart

Created with Raphaël 2.1.2用户登陆登陆操作登陆成功 Yes or No?进入后台yesno

绘制序列图 Sequence Diagram

Created with Raphaël 2.1.2AndrewAndrewChinaChinaSays HelloChina thinksabout itHow are you?I am good thanks!

End

 162

啊!这个可能是世界上最丑的留言输入框功能~


当然,也是最丑的留言列表

有疑问发邮件到 : suibibk@qq.com 侵权立删
Copyright : 个人随笔   备案号 : 粤ICP备18099399号-2