wiki:syntax
差别
这里会显示出您选择的修订版和当前版本之间的差别。
后一修订版 | 前一修订版 | ||
wiki:syntax [2024/10/24 16:09] – 创建 - 外部编辑 127.0.0.1 | wiki:syntax [2025/02/23 12:14] (当前版本) – ↷ 链接因页面移动而自动修正 chenxi2410030 | ||
---|---|---|---|
行 1: | 行 1: | ||
- | ====== | + | ====== |
- | [[doku> | + | 此文来自官方网站[[https://www.dokuwiki.org/zh:wiki: |
- | ===== Basic Text Formatting ===== | + | [[doku> |
- | DokuWiki supports **bold**, //italic//, __underlined__ and '' | + | ===== 基本文本格式 ===== |
- | | + | DokuWiki |
- | Of course you can **__//'' | + | |
- | You can use < | + | DokuWiki支持 **粗体**, //斜体//, __下划线__ 以及 '' |
+ | 当然,你也可以 **__//'' | ||
- | You can use <sub>subscript</ | + | 可以使用 |
- | You can mark something as <del>deleted</del> as well. | + | 可以使用 |
- | You can mark something as <del>deleted</ | + | 您也可以使用 |
- | **Paragraphs** are created from blank lines. If you want to **force a newline** without a paragraph, you can use two backslashes followed by a whitespace or the end of line. | + | 您也可以使用 < |
- | This is some text with some linebreaks\\ Note that the | + | **段落** 是由空行所建立的。如果您想 **强制建立新行** 而不建立段落,您可以使用两个连续的反斜杠+空格或是回车作为标记。请看样例: |
- | two backslashes are only recognized at the end of a line\\ | + | |
- | or followed by\\ a whitespace \\this happens without it. | + | |
- | This is some text with some linebreaks\\ Note that the | + | 这是一些有着换行标记的文字。\\ 请注意 |
- | two backslashes are only recognized at the end of a line\\ | + | 反斜杠只在回车符之前\\ |
- | or followed by\\ a whitespace | + | 或者在\\ 一个空格之前的时候才有效。 |
- | You should use forced newlines only if really needed. | + | 这是一些有着换行标记的文字。\\ 请注意 |
+ | 反斜杠只在回车符之前\\ | ||
+ | 或者在\\ 一个空格之前的时候才有效。 \\而这样就并不起作用。 | ||
- | ===== Links ===== | + | 请只在必须的时候才使用强制的换行标记。 |
- | DokuWiki supports multiple ways of creating links. | ||
- | ==== External | + | ===== 链接 ===== |
- | External links are recognized automagically: | + | DokuWiki 支持多种形式的链接。 |
- | DokuWiki supports multiple ways of creating links. External links are recognized | + | ==== 外部链接 ==== |
- | automagically: | + | |
- | link text as well: [[http:// | + | |
- | addresses like this one: < | + | |
- | ==== Internal ==== | + | 外部链接会被自动地识别:http:// |
- | Internal links are created by using square brackets. You can either just give a [[pagename]] or use an additional [[pagename|link text]]. | + | DokuWiki支持多种形式的链接。外部链接会被自动地识别: |
+ | http://www.google.com 或者简单地写作 www.google.com | ||
+ | - 当然您也可以为链接设置名字: | ||
+ | 类似这样的电子邮件地址: < | ||
- | Internal links are created by using square brackets. You can either just give | + | ==== 内部链接 ==== |
- | a [[pagename]] or use an additional [[pagename|link text]]. | + | |
- | [[doku>pagename|Wiki pagenames]] are converted to lowercase automatically, | + | 内部链接可以用方括号创建。您可以只给出链接的地址:[[pagename]],也可以附加上链接的名字:[[pagename|我的链接]]。 |
- | You can use [[some: | + | 内部链接可以用方括号创建。您可以只给出链接的地址:[[pagename]], |
+ | 也可以附加上链接的名字:[[pagename|我的链接]]。 | ||
- | You can use [[some: | + | [[doku> |
- | For details about namespaces see [[doku> | + | 您可以通过在页面名中使用冒号的方式来使用 |
- | Linking to a specific section is possible, too. Just add the section name behind a hash character as known from HTML. This links to [[syntax# | + | 您可以通过在页面名中使用冒号的方式来使用 |
- | This links to [[syntax# | + | 如果您需要关于命名空间(namespaces)的更详细的信息,请参见 |
- | Notes: | + | 您也可以链接到一个网页内部的某一节,只需要将该节书签的名称以一个# |
- | | + | |
- | * DokuWiki does not use [[wp> | + | |
- | * When a section' | + | |
- | ==== Interwiki ==== | + | 注: |
- | DokuWiki | + | * 到 [[syntax|已存在页面]] 的链接和到 [[nonexisting|未存在页面]] 的链接,其外观是不同的。 |
+ | * 默认情况下,DokuWiki | ||
+ | * 当一节的标题改变时,该节的书签也会改变,因此,请不要太依赖页面内的链接。 | ||
- | DokuWiki supports [[doku> | + | ==== 图像链接 ==== |
- | For example this is a link to Wikipedia' | + | |
- | ==== Windows Shares ==== | + | 您也可以用图像来作为一个内部或者外部的链接,只需同时使用链接和[[# |
- | Windows shares like [[\\server\share|this]] are recognized, too. Please note that these only make sense in a homogeneous user group like a corporate [[wp> | + | |
- | Windows Shares like [[\\server\share|this]] are recognized, too. | + | [[http:// |
- | Notes: | + | 请注意:在链接名中使用语法,只有显示图像的语法会被识别,请不要使用其它语法。 |
- | + | ||
- | * For security reasons direct browsing of windows shares only works in Microsoft Internet Explorer per default (and only in the "local zone" | + | |
- | * For Mozilla and Firefox it can be enabled through different workaround mentioned in the [[http:// | + | |
- | <?php | + | |
- | /** | + | |
- | * Customization of the english language file | + | |
- | * Copy only the strings that needs to be modified | + | |
- | */ | + | |
- | $lang[' | + | |
- | </ | + | |
- | + | ||
- | ==== Image Links ==== | + | |
- | + | ||
- | You can also use an image to link to another internal or external page by combining the syntax for links and [[# | + | |
- | + | ||
- | [[http:// | + | |
- | + | ||
- | [[http:// | + | |
- | Please note: The image formatting is the only formatting syntax accepted in link names. | + | DokuWiki 支持完整的[[# |
- | The whole [[# | ||
- | ===== Footnotes | + | ===== 脚注 |
- | You can add footnotes | + | 您可以使用两个连续小括号来添加脚注((看这里,这是一个脚注))。 |
- | | + | |
- | ===== Sectioning | + | ===== 标题段落 |
- | You can use up to five different levels of headlines to structure your content. If you have more than three headlines, a table of contents is generated automatically -- this can be disabled by including the string | + | 您可以使用最多达5层的标题来使您的页面更富结构性。如果您使用了三个以上的标题,那么 DokuWiki 会自动在页面上生成一个名为“本页目录”的标题列表。当然,您也可以关闭这项特性,只需在编辑时在页面里加入 |
- | ==== Headline Level 3 ==== | + | ==== H3标题 |
- | === Headline Level 4 === | + | === H4标题 |
- | == Headline Level 5 == | + | == H5标题 |
- | ==== Headline Level 3 ==== | + | ==== H3标题 |
- | === Headline Level 4 === | + | === H4标题 |
- | == Headline Level 5 == | + | == H5标题 |
- | By using four or more dashes, you can make a horizontal line: | + | 您可以通过连续的4个以上“-”号来创建一条水平分割线: |
---- | ---- | ||
- | ===== Media Files ===== | + | ===== 图像和其它文件 |
- | You can include external and internal | + | 您可以使用双大括号来在页面中加入 |
- | Real size: | + | 原始大小: |
- | Resize to given width: | + | 指定宽度(50 pixel): |
- | Resize to given width and height((when the aspect ratio of the given width and height doesn' | + | 指定宽度和高度(200×50)((若指定宽高比例不合适,图像将被裁减)): |
- | Resized external image: {{https://www.php.net/ | + | 重新指定宽度和高度的外部图像(100x100): |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | By using left or right whitespaces you can choose the alignment. | + | 使用左方或者右方的空格,您可以选择对齐方式: |
{{ wiki: | {{ wiki: | ||
行 157: | 行 136: | ||
{{ wiki: | {{ wiki: | ||
- | Of course, you can add a title (displayed as a tooltip by most browsers), too. | + | 当然,您也可以指定一个图像的名字,将鼠标移到图像上可以看到效果。 |
- | {{ wiki: | + | {{ wiki: |
- | {{ wiki: | + | {{ wiki: |
- | For linking an image to another page see [[#Image Links]] above. | + | 如果您指定的文件名(无论是外部的还是内部的)不是一个图像'' |
- | ==== Supported Media Formats | + | ==== 支持的媒体格式 |
- | DokuWiki | + | DokuWiki |
- | | Image | '' | + | | 图像 |
- | | Video | '' | + | | 视频 |
- | | Audio | '' | + | | 音频 |
| Flash | '' | | Flash | '' | ||
- | If you specify a filename that is not a supported media format, then it will be displayed as a link instead. | + | 如果指定不支持的媒体格式的文件名,则它将作为链接显示。 |
- | By adding | + | 加上 |
{{wiki: | {{wiki: | ||
- | {{wiki: | + | {{wiki: |
- | ==== Fallback Formats | + | ==== 备用的文件格式 |
- | Unfortunately not all browsers understand all video and audio formats. To mitigate the problem, you can upload your file in different formats for maximum browser compatibility. | + | 并非所有浏览器都支持所有的视频和音频格式,要解决这个问题,你可以上传不同的文件格式,以获得最大的浏览器兼容性。 |
- | For example consider this embedded | + | 例如有一个 |
- | {{video.mp4|A funny video}} | + | {{video.mp4|一个很有意思的视频}} |
- | When you upload a '' | + | 如果同时上传了 |
- | Additionally | + | 此外,DokuWiki |
- | ===== Lists ===== | + | ===== 列表 |
- | Dokuwiki | + | Dokuwiki |
- | * This is a list | + | * 列表 |
- | * The second item | + | * 第二项 |
- | * You may have different levels | + | * 下一层 |
- | * Another item | + | * 第三项 |
- | - The same list but ordered | + | - 带编号的列表 |
- | - Another item | + | - 第二项 |
- | - Just use indention for deeper levels | + | - 用缩进表示更深的层 |
- | - That's it | + | - 完了 |
< | < | ||
- | | + | * 列表 |
- | * The second item | + | * 第二项 |
- | * You may have different levels | + | * 下一层 |
- | * Another item | + | * 第三项 |
- | - The same list but ordered | + | - 带编号的列表 |
- | - Another item | + | - 第二项 |
- | - Just use indention for deeper levels | + | - 用缩进表示更深的层 |
- | - That's it | + | - 完了 |
</ | </ | ||
- | Also take a look at the [[doku> | + | 同时可以关注 |
- | ===== Text Conversions | + | ===== 文本转换 |
- | DokuWiki | + | DokuWiki |
- | The text to image conversion is mainly done for smileys. And the text to HTML conversion is used for typography replacements, | + | 文本到图片的转换,主要用作表情符号。文本到 |
+ | ==== 表情符号 ==== | ||
- | ==== Text to Image Conversions ==== | + | DokuWiki 会将一些常用的 [[wp> |
- | DokuWiki converts commonly used [[wp> | + | * 8-) ` 8-) ` |
+ | * 8-O ` 8-O ` | ||
+ | * :-( ` :-( ` | ||
+ | * :-) ` :-) ` | ||
+ | * =) ` =) ` | ||
+ | * :-/ ` :-/ ` | ||
+ | * :-\ ` :-\ ` | ||
+ | * :-? ` :-? ` | ||
+ | * :-D ` :-D ` | ||
+ | * :-P ` :-P ` | ||
+ | * :-O ` :-O ` | ||
+ | * :-X ` :-X ` | ||
+ | * :-| ` :-| ` | ||
+ | * ;-) ` ;-) ` | ||
+ | * ^_^ ` ^_^ ` | ||
+ | * :?: ` :?: ` | ||
+ | * :!: ` :!: ` | ||
+ | * LOL ` LOL ` | ||
+ | * FIXME ` FIXME ` | ||
+ | * DELETEME ` DELETEME ` | ||
- | * 8-) %% 8-) %% | ||
- | * 8-O %% 8-O %% | ||
- | * :-( %% :-( %% | ||
- | * :-) %% :-) %% | ||
- | * =) %% =) %% | ||
- | * :-/ %% :-/ %% | ||
- | * :-\ %% :-\ %% | ||
- | * :-? %% :-? %% | ||
- | * :-D %% :-D %% | ||
- | * :-P %% :-P %% | ||
- | * :-O %% :-O %% | ||
- | * :-X %% :-X %% | ||
- | * :-| %% :-| %% | ||
- | * ;-) %% ;-) %% | ||
- | * ^_^ %% ^_^ %% | ||
- | * m( %% m( %% | ||
- | * :?: %% :?: %% | ||
- | * :!: %% :!: %% | ||
- | * LOL %% LOL %% | ||
- | * FIXME %% FIXME %% | ||
- | * DELETEME %% DELETEME %% | ||
- | ==== Text to HTML Conversions ==== | ||
- | Typography: [[DokuWiki]] can convert simple text characters to their typographically correct entities. Here is an example of recognized characters. | + | ===== 层次显示 ===== |
- | -> <- <-> => <= <=> >> << -- --- 640x480 (c) (tm) (r) | + | 有时候(特别是讨论时)您想把某些文字(尤为各次的回复)标示作不同的层次,您可以使用下列的语法: |
- | "He thought ' | + | |
< | < | ||
- | -> <- <-> => <= <=> >> << -- --- 640x480 (c) (tm) (r) | + | 我认为我们应该一起行动 |
- | "He thought ' | + | |
- | </ | + | |
- | The same can be done to produce any kind of HTML, it just needs to be added to the [[doku>entities|pattern file]]. | + | > 不行,不能一起行动 |
- | There are three exceptions which do not come from that pattern file: multiplication entity (640x480), ' | ||
- | |||
- | ===== Quoting ===== | ||
- | |||
- | Some times you want to mark some text to show it's a reply or comment. You can use the following syntax: | ||
- | |||
- | < | ||
- | I think we should do it | ||
- | |||
- | > No we shouldn' | ||
- | |||
- | >> Well, I say we should | ||
- | |||
- | > Really? | ||
- | |||
- | >> Yes! | ||
- | |||
- | >>> | ||
</ | </ | ||
- | I think we should do it | + | 我认为我们应该一起行动 |
- | > No we shouldn' | + | > 不行,不能一起行动 |
- | >> Well, I say we should | ||
- | > Really? | + | ===== 表格 ===== |
- | >> Yes! | + | DokuWiki 可以用简单的语法创建表格。 |
- | >>> | + | ^ 标题 1 ^ 标题 2 ^ 标题 3 ^ |
+ | | (WOK) | ||
+ | | (2,1) | ||
+ | | (3,1) | ||
- | ===== Tables ===== | + | 表格的每一行都以分隔符 '' |
- | DokuWiki supports a simple syntax to create tables. | + | ^ 标题 1 ^ 标题 2 ^ 标题 3 ^ |
+ | | (1,1) | ||
+ | | (2,1) | ||
+ | | (3,1) | ||
- | ^ Heading 1 ^ Heading 2 ^ Heading 3 ^ | + | 要水平合并单元格,只需要将后一个单元格设置为空即可,如上面演示的一样。请确保每一行有相同数量的单元格分隔符! |
- | | Row 1 Col 1 | Row 1 Col 2 | Row 1 Col 3 | | + | |
- | | Row 2 Col 1 | some colspan (note the double pipe) || | + | |
- | | Row 3 Col 1 | Row 3 Col 2 | Row 3 Col 3 | | + | |
- | Table rows have to start and end with a '' | + | 竖直的标题列也是可以实现的: |
- | | + | | ^ 标题 |
- | | + | ^ 标题 |
- | | Row 2 Col 1 | some colspan (note the double pipe) || | + | ^ 标题 4 |
- | | Row 3 Col 1 | + | ^ 标题 5 |
- | To connect cells horizontally, | + | 可以看到,单元格前面的分隔符决定了单元格的格式。 |
- | Vertical tableheaders are possible, too. | + | | ^ 标题 1 ^ 标题 2 ^ |
+ | ^ 标题 3 | (1,2) | ||
+ | ^ 标题 4 | 不再合并单元格 | | | ||
+ | ^ 标题 5 | (2,2) | ||
- | | | + | 您也可以垂直合并两格或多格。只要在下面的格内输入'':::'' |
- | ^ Heading | + | ^ 标题 |
- | ^ Heading 4 | + | | (1,0) |
- | ^ Heading 5 | + | | (2,1) |
+ | | (3,1) | ||
- | As you can see, it's the cell separator before a cell which decides about the formatting: | + | 除跨行合并语法' |
- | | + | ^ 标题 |
- | | + | | (1,1) |
- | | + | | (2,1) |
- | | + | | (3,1) |
- | You can have rowspans (vertically connected cells) by adding '' | + | 您可以对齐表格的文字。只需要添加多余两个的空格在您需要对齐的方向的反向即可:如果需要右对齐,在左边添加两个空格;反之,则在右边添加。在两边均添加空格可以实现中间对齐。 |
- | ^ Heading 1 ^ Heading 2 ^ Heading 3 ^ | + | ^ |
- | | Row 1 Col 1 | + | | 右对齐 |
- | | Row 2 Col 1 | + | | 左对齐 |
- | | Row 3 Col 1 | + | | xxxxxxxxxxxx |
- | Apart from the rowspan syntax those cells should not contain anything else. | + | 下面是源文件中的格式: |
- | | + | ^ 有对齐的表格 |
- | | Row 1 Col 1 | this cell spans vertically | Row 1 Col 3 | | + | | 右对齐| |
- | | Row 2 Col 1 | ::: | Row 2 Col 3 | | + | |左对齐 |
- | | Row 3 Col 1 | ::: | Row 2 Col 3 | | + | |
- | + | ||
- | You can align the table contents, too. Just add at least two whitespaces at the opposite end of your text: Add two spaces on the left to align right, two spaces on the right to align left and two spaces at least at both ends for centered text. | + | |
- | + | ||
- | ^ Table with alignment | + | |
- | | | + | |
- | |left | | + | |
- | | xxxxxxxxxxxx | xxxxxxxxxxxx | xxxxxxxxxxxx | | + | |
- | + | ||
- | This is how it looks in the source: | + | |
- | + | ||
- | | + | |
- | | right| | + | |
- | |left | + | |
| xxxxxxxxxxxx | xxxxxxxxxxxx | xxxxxxxxxxxx | | | xxxxxxxxxxxx | xxxxxxxxxxxx | xxxxxxxxxxxx | | ||
- | Note: Vertical alignment is not supported. | + | 注意:不支持垂直对齐 |
- | ===== No Formatting | + | ===== 无格式区块 |
- | If you need to display text exactly like it is typed (without any formatting), | + | 若要略过某段内含维基语法,不对该段文字作任何处理, 可以使用 |
< | < | ||
- | This is some text which contains addresses like this: http:// | + | 正如本段示范里,本来包含了网址:http:// |
</ | </ | ||
- | The same is true for %%// | ||
- | | + | 使用百分号对 %%// |
- | This is some text which contains addresses like this: http:// | + | |
- | | + | |
- | | + | |
+ | 使用百分号对 | ||
- | ===== Code Blocks | + | ===== 代码区块 |
- | You can include code blocks into your documents by either indenting them by at least two spaces | + | 在一段文字的最前面加上 2 个空白,来直接作为「文本框」不对它做加工处理(就像前面那些说明一样)。或者也可以用 |
- | | + | |
< | < | ||
- | This is preformatted code all spaces are preserved: like | + | 就像 |
</ | </ | ||
< | < | ||
- | This is pretty much the same, but you could use it to show that you quoted a file. | + | 这段跟上段很像,但是改用 < |
+ | remember, information | ||
+ | knowledge is not wisdom | ||
+ | wisdom is not truth | ||
+ | truth is not beauty | ||
+ | beauty is not love | ||
+ | love is not music | ||
+ | music is the best | ||
+ | |||
+ | -- frank zappa | ||
</ | </ | ||
- | Those blocks were created by this source: | + | 这些区域的源码如下: |
- | | + | |
< | < | ||
- | | + | |
</ | </ | ||
< | < | ||
- | | + | |
+ | remember, information | ||
+ | knowledge is not wisdom | ||
+ | wisdom is not truth | ||
+ | truth is not beauty | ||
+ | beauty is not love | ||
+ | love is not music | ||
+ | music is the best | ||
+ | |||
+ | -- frank zappa | ||
</ | </ | ||
- | ==== Syntax Highlighting ==== | ||
- | [[wiki:DokuWiki]] | + | ==== 语法的高亮度显示 ==== |
+ | |||
+ | [[DokuWiki]] | ||
+ | |||
+ | 用法就类似前例的 | ||
<code java> | <code java> | ||
- | /** | + | /** |
* The HelloWorldApp class implements an application that | * The HelloWorldApp class implements an application that | ||
* simply displays "Hello World!" | * simply displays "Hello World!" | ||
- | */ | + | |
- | class HelloWorldApp { | + | |
- | | + | |
System.out.println(" | System.out.println(" | ||
} | } | ||
行 418: | 行 385: | ||
</ | </ | ||
- | The following language strings are currently recognized: //4cs 6502acme 6502kickass 6502tasm 68000devpac abap actionscript3 | + | 目前支持的语言有: // |
- | There are additional [[doku> | + | ==== 可下载的代码块 ==== |
- | ==== Downloadable Code Blocks ==== | + | 若您使用上述的 |
- | + | ||
- | When you use the '' | + | |
< | < | ||
行 436: | 行 401: | ||
</ | </ | ||
- | If you don't want any highlighting but want a downloadable file, specify a dash ('' | + | 若您不想把语法高亮显示出,但想方便浏览者下载,您可以用链接号 |
- | + | ||
- | ===== RSS/ATOM Feed Aggregation ===== | + | |
- | [[DokuWiki]] can integrate data from external XML feeds. For parsing the XML feeds, [[http:// | + | |
- | + | ||
- | ^ Parameter | + | |
- | | any number | will be used as maximum number items to show, defaults to 8 | | + | |
- | | reverse | + | |
- | | author | + | |
- | | date | show item dates | | + | |
- | | description| show the item description. All HTML tags will be stripped | | + | |
- | | nosort | + | |
- | | //n//[dhm] | refresh period, where d=days, h=hours, m=minutes. (e.g. 12h = 12 hours). | | + | |
- | + | ||
- | The refresh period defaults to 4 hours. Any value below 10 minutes will be treated as 10 minutes. [[wiki: | + | |
- | + | ||
- | By default the feed will be sorted by date, newest items first. You can sort it by oldest first using the '' | + | |
- | + | ||
- | **Example: | + | |
- | + | ||
- | {{rss> | + | |
- | + | ||
- | {{rss> | + | |
- | ===== Control Macros ===== | ||
- | Some syntax influences how DokuWiki renders a page without creating any output it self. The following control macros are availble: | ||
- | ^ Macro ^ Description | | + | ===== 控制宏 ===== |
- | | %%~~NOTOC~~%% | + | |
- | | %%~~NOCACHE~~%% | DokuWiki caches all output by default. Sometimes this might not be wanted (eg. when the %%< | + | |
- | ===== Syntax Plugins ===== | + | 控制宏会影响 DokuWiki 对页面的渲染,而自身不输出任何內容。可用的控制宏如下: |
- | DokuWiki's syntax can be extended by [[doku>plugins|Plugins]]. How the installed plugins are used is described on their appropriate description pages. The following syntax plugins are available in this particular | + | ^ 宏 ^ 描述| |
+ | | %%~~NOTOC~~%% | ||
+ | | %%~~NOCACHE~~%% | DokuWiki | ||
- | ~~INFO: | + | ===== 扩展插件 ===== |
+ | 使用[[doku> |
wiki/syntax.1729757340.txt.gz · 最后更改: 2024/10/24 16:09 由 127.0.0.1