介绍
MarkDown 原理:一个文档语言,使用性比较强
从后台解释语言到 html。下面是使用方法。
标题
通过‘#’个数 区分 h1-6(标题大小)
1 | # This is an h1 tag |
效果:
This is an h1 tag
This is an h2 tag
This is an h6 tag
列表
无序代码:
1 | - 文本1 |
- 文本 1
- 二级文本
- 文本 2
- 文本 3
有序代码
1 | 1. 文本1 |
- 文本 1
- 2121
- 电影
- 文本 2
- 文本 3
换行
空格和回车都可以
1 | Here's a line for us to start with. |
重点
1 | *This text will be italic* |
This text will be italic
This will also be italic
This text will be bold
This will also be bold
This text will be crossed out.
You can combine them
链接
1 | This is [an example](http://example.com/) inline link with a title. |
This is an example inline link with a title.
This link has no title attribute.
参考文献
这个没弄明白
1 | This is [an example][id] reference-style link. |
图片
1 | An image: ![gras](img/image.jpg) |
An image:
模块引用
1 | As Kanye West said: |
As Kanye West said:
We’re living the future so
the present is our past.
表
1 | | First Header | Second Header | |
First Header | Second Header |
---|---|
Content Cell | Content Cell |
Content Cell | Content Cell |
输入代码块
前后加(三个点点点)
```
这儿放你的代码
```
1 | function test() { |
行内代码
1 | Use `gitbook` to convert the `text` in markdown |
Use gitbook
to convert the text
in markdown
syntax to HTML.
语法高亮显示
1 | ```ruby |
效果:
1 | require 'redcarpet' |
脚注
GitBook 支持这种脚注的简单语法。脚注是相对于每个页面。
1 | Text prior to footnote reference.[^2] |
Text prior to footnote reference.[^2]
[^2]: Comment to include in footnote.
前端语言
GitBook 支持在您的文本中使用原始 HTML,不处理 HTML 中的 Markdown 语法:
1 | <div> |
水平规则
1 | Three or more... |
Three or more…
Hyphens
Asterisks
忽略
1 | Let's rename \*our-new-project\* to \*our-old-project\*. |
这个意思就是转义*不让其成为加粗的标记。
Let’s rename *our-new-project* to *our-old-project*.
hexo
由于可以使用 HTML 代码,所以在 hexo 还有几个操作
可展开的代码块
里面按照正常代码块写就行,这里转义 ` 是为了避免显示错误
1 | <details> |
Code
1 | code |
标记
HTML 的标记标签 <mark></mark>
,可以将内容标记为黄色