Markdown Syntax

Markdown test

Typora Test

段落

段落

段落

表格

表格 2 3
1 2 3
1 2 3

代码块

1
#include "main.h"  //代码块

引用

引用

有序列表

  1. 有序列表
  2. 有序列表
  3. 有序列表

无序列表

  • 无序列表
  • 无序列表
  • 无序列表

任务列表

  • 任务列表
  • 任务列表
  • 任务列表

链接引用

[]: www.baidu.com “百度”

水平分割线


水平分割线

加粗

加粗

斜体

斜体

下划线

下划线

代码

代码

删除线

删除线

注释

超链接

超链接

图片

图像
图像

Hexo Test

引用块

在文章中插入引言,可包含作者、来源和标题。

1
2
3
{% blockquote [author[, source]] [link] [source_link_title] %}
content
{% endblockquote %}

样例

没有提供参数,则只输出普通的 blockquote
1
2
3
{% blockquote %}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque hendrerit lacus ut purus iaculis feugiat. Sed nec tempor elit, quis aliquam neque. Curabitur sed diam eget dolor fermentum semper at eu lorem.
{% endblockquote %}

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque hendrerit lacus ut purus iaculis feugiat. Sed nec tempor elit, quis aliquam neque. Curabitur sed diam eget dolor fermentum semper at eu lorem.

引用书上的句子
1
2
3
{% blockquote David Levithan, Wide Awake %}
Do not just seek happiness for yourself. Seek happiness for all. Through kindness. Through mercy.
{% endblockquote %}

Do not just seek happiness for yourself. Seek happiness for all. Through kindness. Through mercy.

David LevithanWide Awake
引用 Twitter
1
2
3
{% blockquote @DevDocs https://twitter.com/devdocs/status/356095192085962752 %}
NEW: DevDocs now comes with syntax highlighting. http://devdocs.io
{% endblockquote %}

NEW: DevDocs now comes with syntax highlighting. http://devdocs.io

引用网络上的文章
1
2
3
{% blockquote Seth Godin http://sethgodin.typepad.com/seths_blog/2009/07/welcome-to-island-marketing.html Welcome to Island Marketing %}
Every interaction is both precious and an opportunity to delight.
{% endblockquote %}

Every interaction is both precious and an opportunity to delight.

代码块

在文章中插入代码。

别名: code

1
2
3
{% codeblock [title] [lang:language] [url] [link text] %}
code snippet
{% endcodeblock %}

样例

普通的代码块
1
2
3
{% codeblock %}
alert('Hello World!');
{% endcodeblock %}
1
alert('Hello World!');
指定语言
1
2
3
{% codeblock lang:objc %}
[rectangle setX: 10 y: 10 width: 20 height: 20];
{% endcodeblock %}
1
[rectangle setX: 10 y: 10 width: 20 height: 20];
附加说明
1
2
3
{% codeblock Array.map %}
array.map(callback[, thisArg])
{% endcodeblock %}
Array.map
1
array.map(callback[, thisArg])
附加说明和网址
1
2
3
4
{% codeblock _.compact http://underscorejs.org/#compact Underscore.js %}
_.compact([0, 1, false, 2, '', 3]);
=> [1, 2, 3]
{% endcodeblock %}
_.compactUnderscore.js
1
2
_.compact([0, 1, false, 2, '', 3]);
=> [1, 2, 3]

反引号代码块

另一种形式的代码块,不同的是它使用三个反引号来包裹。

1
``` [language] [title] [url] [link text] code snippet ```

Pull Quote

在文章中插入 Pull quote。

1
2
3
{% pullquote [class] %}
content
{% endpullquote %}

jsFiddle

在文章中嵌入 jsFiddle。

1
{% jsfiddle shorttag [tabs] [skin] [width] [height] %}

Gist

在文章中嵌入 Gist。

1
{% gist gist_id [filename] %}

iframe

在文章中插入 iframe。

1
{% iframe url [width] [height] %}

Image

在文章中插入指定大小的图片。

1
{% img [class names] /path/to/image [width] [height] [title text [alt text]] %}

在文章中插入链接,并自动给外部链接添加 target="_blank"属性。

1
{% link text url [external] [title] %}
text url [external] [title]

Include Code

插入 source 文件夹内的代码文件。

1
{% include_code [title] [lang:language] path/to/file %}

Youtube

在文章中插入 Youtube 视频。

1
{% youtube video_id %}

Vimeo

在文章中插入 Vimeo 视频。

1
{% vimeo video_id %}

引用文章

引用其他文章的链接。

1
2
{% post_path slug %}
{% post_link slug [title] %}

引用资源

引用文章的资源。

1
2
3
{% asset_path slug %}
{% asset_img slug [title] %}
{% asset_link slug [title] %}

Raw

如果您想在文章中插入 Swig 标签,可以尝试使用 Raw 标签,以免发生解析异常。

1
2
3
{% raw %}
content
{% endraw %}

流程图

概述

流程图的语法大致分为两部分。

  • 定义元素
  • 连接元素

定义元素

1
tag=>type: content:>url1
  1. tag:标签,用于连接元素时使用

  2. type:该标签的类型。共有6种类型如下:

    1
    2
    3
    4
    5
    6
    7
    start 
    end
    operation
    subroutine
    condition
    input
    output
  3. content:流程语句中放置的内容

  4. type:与content之间一定要有一个空格,否则会出问题!
    url:链接,与流程语句绑定

连接元素

使用->符号,如:

1
2
c2(yes)->io->e
c2(no)->op2->e

实例

牢记tag=>type: content:>url

1
2
3
4
5
6
7
8
9
10
11
12
13
st=>start: Start|past:>http://www.baidu.com
e=>end: End:>http://www.baidu.com
op1=>operation: My Operation|past
op2=>operation: Stuff|current
sub1=>subroutine: My Subroutine|invalid
cond=>condition: Yes or No?|approved:>http://www.baidu.com
c2=>condition: Good idea|rejected
io=>inputoutput: catch something...|request

st->op1(right)->cond
cond(yes, right)->c2
cond(no)->sub1(left)->op1
c2(yes)->io->e
1
2
3
4
5
6
7
8
9
st=>start: Start
e=>end: End
cond=>condition: Option
op1=>operation: solution_1
op2=>operation: solution_2

st->cond
cond(yes)->op1->e
cond(no)->op2->e
1
2
3
4
5
6
7
8
9
10
11
st=>start: Start
e=>end: Why are you worried?
cond1=>condition: Do you have a problem?
cond2=>condition: Can you solve it?
op=>operation: Since you can't solve it,

st->cond1
cond1(yes)->cond2
cond1(no)->e
cond2(yes)->e
cond2(no)->op->e

mermaid

gantt
        dateFormat  YYYY-MM-DD
        title Adding GANTT diagram functionality to mermaid
        section A section
        Completed task            :done,    des1, 2014-01-06,2014-01-08
        Active task               :active,  des2, 2014-01-09, 3d
        Future task               :         des3, after des2, 5d
        Future task2               :         des4, after des3, 5d
        section Critical tasks
        Completed task in the critical line :crit, done, 2014-01-06,24h
        Implement parser and jison          :crit, done, after des1, 2d
        Create tests for parser             :crit, active, 3d
        Future task in critical line        :crit, 5d
        Create tests for renderer           :2d
        Add to mermaid                      :1d















llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll