本文抄自wiki.js.doc,主要介绍 markdown 的使用
某些时候使用正确标签语法但是不能渲染出目标样式,尝试在标签后添加空格或者加回车换行符;
Sometimes the correct tag syntax is used but the target style is not rendered, try adding spaces or line breaks after the tags
Markdown是一种具有纯文本格式语法的轻量级标记语言。它是在主要代码库(如GitHub)上编写文档的事实语法,Wiki.js支持完整的[CommonMark规范](https://spec.commonmark.org/)+增加了一些有用的扩展(包括Github Flavored Markdown插件)。
Markdown is a lightweight markup language with plain text formatting syntax. It's the de-facto syntax for writing documentation on major code repositories such as GitHub. Wiki.js supports the full [CommonMark specification](https://spec.commonmark.org/) + adds some useful extensions (including the Github Flavored Markdown addons).
在每行文字前使用 > 的符号,后面加一个空格。/Using a **greater-than** symbol, followed by a space, before each line of text.
> hello world
> 你好世界
hello world
你好世界
通过在blockquote之后的单独一行添加一个class,你可以改变blockquote的外观。请注意,这些样式是Wiki.js特有的,在其他应用程序中会退回到标准的blockquote样式 By adding a class on a separate line, after the blockquote, you can change the look of the blockquote. Note that these stylings are specific to Wiki.js and will fallback to standard blockquote styling in other applications.
is-info
is-success
is-warning
is-danger
> hello world
{.is-info}
This is a default unstyled blockquote.
This is a
{.is-info}
blockquote.
This is a
{.is-success}
blockquote.
This is a
{.is-warning}
blockquote.
This is a
{.is-danger}
blockquote.
在把想加粗的文字前后用**包围Using **double asterisks** symbols before and after the text selection.
By selecting text, then clicking the button in the toolbar.
By selecting text, then pressing CTRL + b
hello **world**
hello world
Using triple backticks symbols before and after the text selection, on dedicated lines.
Using the Code Block tool in the left toolbar.
```
function lorem (ipsum) {
const dolor = 'consectetur adipiscing elit'
}
```
默认情况下,代码块被呈现为普通的预格式化文本。然而,最好是对编程代码使用语法高亮,使其更容易阅读。要指定代码块中使用的编程语言,只需在开头的三个反单引号后添加语言关键词。
`By default, a code block is rendered as plain preformatted text. It’s however preferable to use syntax highlighting for programming code, allowing for easier readability. To specify the programming language used in the code block, simply add the language keyword right after the opening triple backticks:
```java
// some code here
```
请参考参考列表中大约185种支持的编程语言\Refer to the reference list of about 185 supported programming languages.
使用页眉并将{.tabset}
类添加到父页眉中。父级页眉文本将不会在最终结果中显示。
注意,你可以使用任何级别的页眉,只要子页眉高一个级别。例如,如果一个父级标题是###
(h3),标签标题必须是####
(h4)。父类的最大标题级别为5,子类为6(看起来可比较抽象查看下方示例)。
Using headers and adding the {.tabset}
class to the parent header. The parent header text will not be shown in the final result.
Note that you can use any header level, as long as the children headers are one level higher. For example, if a parent header is ###
(h3), the tabs headers must be ####
(h4). The maximum header level for a parent being 5 and the children 6.
# Tabs {.tabset}
## First Tab
Any content here will go into the first tab...
## Second Tab
Any content here will go into the second tab...
## Third Tab
Any content here will go into the third tab...
使用语法标记:identifier:
Using the syntax `:identifier:`
查看Emoji Cheat Sheet 获得所有可用表情。See the Emoji Cheat Sheet for the full list of possible options.
:apple:
Can be also be used :fire: inline
Can also be used inline.
使用语法[^1]
表示脚注在正文中的位置,[^1]: 这是一个脚注
表示实际的脚注。 脚注本身会自动出现在页面底部的横线下。
Use the syntax [^1]
for the location of the footnote in the main text, and [^1]: this is a footnote
for the actual footnote. Footnotes themselves will automatically appear at the bottom of the page under a horizontal line.
使用1到6个#号开头并使用空格分开标题和#号(查看示例) Using between 1 and 6 # symbol(s), followed by a space, before the text selection.
On the desired line, then clicking the dropdown button in the toolbar.
On the desired line, press CTRL + ALT + Right to increase the header level.
On the desired line, press CTRL + ALT + Left to decrease the header level.
# Header 1
## Header 2
### Header 3
#### Header 4
##### Header 5
###### Header 6
在独立行上写三个 ---
Using --- symbols on a dedicated line.
hello
---
world
hello
world
图片上传限制1MB,为加快页面加载速度建议把原始图片转换成gif再上传。
使用
语法/Using the syntax 
.
{.radius-10}
有时候图片尺寸需要缩放Sometimes images are too large or maybe you want the image to fill up all the available space.
只需要在图片资源后加例如 =100x200 具体效果自行实验Simply at the dimensions at the end of the image path in the following format:

也可以你也可以省略其中一个值来自动保持图像比例(推荐使用)You can also omit one of the values to automatically keep the image ratio
:


使用=100%x来填满屏幕It's also possible to use other units, like %. Useful when you need the image to take all the available space
:

使用来图片圆角{.radius-5} 5代表圆角半径可以调整 Use
{.radius-5} to round the corners of images
:
{.radius-10}
使用*号包围目标字符. Using a single asterisk symbol before and after the text selection.
By selecting text, then clicking the button in the toolbar.
By selecting text, then pressing CTRL+ I
hello *world*
hello world
使用语法[显示字符](链接地址)
Using the syntax [Link Text](Link Target)
.
Using the Link tool in the left toolbar.
点击左侧工具栏图形图表来制作任意想要的图形 Click on the left toolbar graphical chart to create any graph you want
如何使用 how to
在每行行首插入 1. ,1是顺序列表开始数字,如果是2表示以2开始计数自增Using an number, followed by a dot symbol, followed by a space, before each line of text.
By selecting text, then clicking the button in the toolbar.
1. Lorem ipsum dolor sit amet
1. Consectetur adipiscing elit
1. Morbi vehicula aliquam
虽然你可以按顺序对每行进行数字编号,但在每行使用单独数字1会更方便。最后的结果会自动递增。这样,在以后添加或删除一行时,你就不需要为每一行重新编号。
While you can number each line numerically in order, it's easier to use the number **1** on each line. The final result will be incremented automatically. This way you don't need to re-number every single line when adding or removing a line later on.
用双波浪线 ~~ 包围字符 Using double tildes symbols before and after the text selection.
Lorem ~~ipsum~~ dolor
Lorem ipsum dolor
使用单波浪线 ~ 包围字符Using a single tilde symbol before and after the text selection.
By selecting text, then clicking the button in the toolbar.
Lorem ~ipsum~ dolor
Lorem ipsum dolor
用上尖角号包围目标字符,Using a single caret symbol before and after the text selection.
By selecting text, then clicking the superscript button in the toolbar.
Lorem ^ipsum^ dolor
Lorem ipsum dolor
使用语法 - []
或者 - [x]
,- [x]
表示选中, Using the syntax - [ ] or a - [x].
- [x] Checked task item
- [x] Another checked task item
- [ ] Unchecked task item
在行首加-
,Using an asterisk or a dash symbol, followed by a space, before each line of text.
- Lorem ipsum dolor sit amet
- Consectetur adipiscing elit
- Morbi vehicula aliquam
通过添加class在无序列表的末尾,他有链接和网格两种样式,By adding a class on a separate line, after the list, you can change the look of the list:
links-list
grid-list
例如/For example:
- Grid Item 1
- Grid Item 2
- Grid Item 3
{.grid-list}
- [Lorem ipsum dolor sit amet *Subtitle description here*](https://www.google.com)
- [Consectetur adipiscing elit *Another subtitle description here*](https://www.google.com)
- [Morbi vehicula aliquam *Third subtitle description here*](https://www.google.com)
{.links-list}
will result in:
and:
请注意,这些样式是针对Wiki.js的,在其他应用程序中会退回到标准列表样式。
Note that these stylings are specific to Wiki.js and will fallback to standard list styling in other applications.