markdown
Markdown的核心目标是用极简符号替代复杂排版,因为入门足够简单,能很快上手,且形成肌肉记忆后,排版等反而比word简单效率高(不用反复操作控件或菜单按钮),因而不会降低内容创作的专注度。word哲学是先编辑内容,然后整体排版;而markdown是边编辑内容边排版,后面再少许优化。
markdown当嵌入html或js后,也具有网页的交互功能。
注意事项
- 很多语法前后都要空格,特别是分层列表,前面是2个空格,后面1个空格,此外还有表、等。、
- 表中字段的对齐,左对齐| :--|;中对齐| :--|;右对齐| --:|。
- 隔离代码块中
代码块
或~~~ 代码块 ~~~ 。若想支持语法高亮,可以再~或```后面加语言类型如~python 代码块 ~~~。 - 脚注:这是一个脚注[^1],解释在下面任何位置。 [^1]:这是这个脚注的详细说明。
- 标题ID ### 正标题{ #user-id},等效于
My Great Heading
- 定义列表:请在第一行键入术语。在下一行中,键入冒号,后跟空格和定义。
- 单词删除线:在单词前后各加2个波浪线,中国的英语不是
chine,而是china - 复选框(任何列表):- [x]选中;- [ ]未选中
- 添加表情符号:直接粘贴复制或者添加其段代码,方法是表情名称前后都是冒号 :smile:
- 高亮文本: 高亮文本
- 显示下标和上标:H2O;X2 +Y2 =Z2
- 自动URL与禁用自动URL:www.baidu.com 禁用自动url:
www.baidu.com
示例代码
``
Markdown syntax guide
Headers
This is a Heading h1
This is a Heading h2
This is a Heading h6
Emphasis
This text will be italic
This will also be italic
This text will be bold
This will also be bold
You can combine them
Lists
Unordered
- Item 1
- Item 2
- Item 2a
- Item 2b
- Item 3a
- Item 3b
Ordered
- Item 1
- Item 2
- Item 3
- Item 3a
- Item 3b
Images
Links
You may be using Markdown Live Preview.
Blockquotes
Markdown is a lightweight markup language with plain-text-formatting syntax, created in 2004 by John Gruber with Aaron Swartz.
Markdown is often used to format readme files, for writing messages in online discussion forums, and to create rich text using a plain text editor.
Tables
Left columns | Right columns |
---|---|
left foo | right foo |
left bar | right bar |
left baz | right baz |
Blocks of code
let message = 'Hello world';
alert(message);
Inline code
This web site is using markedjs/marked
.
添加表情符号
添加笑脸😂,方法二是 😂
高亮文本
高亮文本
显示下标和上标
水的化学分子式是H2O
直角公式:X2 +Y2 =Z2
自动URL与禁用自动URL
www.baidu.com 禁用自动url:www.baidu.com
插入mermaid:
graph LR
A[Start] --> B{Decision}
B -->|Yes| C[Action]
B -->|No| D[End]
``