wiki:syntax
差别
这里会显示出您选择的修订版和当前版本之间的差别。
| 两侧同时换到之前的修订记录前一修订版后一修订版 | 前一修订版 | ||
| wiki:syntax [2023/07/06 12:17] – 外部编辑 127.0.0.1 | wiki:syntax [2025/10/11 02:55] (当前版本) – 外部编辑 127.0.0.1 | ||
|---|---|---|---|
| 行 1: | 行 1: | ||
| - | ====== | + | ====== |
| - | [[doku> | + | [[doku> |
| - | ===== Basic Text Formatting | + | ===== 基本文本格式 |
| - | DokuWiki | + | DokuWiki |
| - | DokuWiki | + | DokuWiki |
| - | | + | |
| - | You can use <sub>subscript</ | + | 您也可以使用 |
| - | | + | |
| - | 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 | + | 或紧随其后\\ 一个空格 |
| - | | + | |
| - | | + | |
| - | | + | |
| - | You should use forced newlines only if really needed. | + | ===== 链接 ===== |
| - | ===== Links ===== | + | DokuWiki 支持多种创建链接的方式。 |
| - | DokuWiki supports multiple ways of creating links. | + | ==== 外部链接 ==== |
| - | ==== External ==== | + | 外部链接会自动识别:http:// |
| - | External links are recognized automagically: | + | 您也可以设置链接文本: |
| - | DokuWiki supports multiple ways of creating links. External links are recognized | + | 像这样的电子邮件地址也可以识别: < |
| - | automagically: | + | |
| - | link text as well: [[http:// | + | |
| - | addresses like this one: < | + | |
| - | ==== Internal ==== | + | DokuWiki 支持多种创建链接的方式. |
| + | 外部链接会自动识别:http:// | ||
| + | 您也可以设置链接文本: [[http:// | ||
| + | 像这样的电子邮件地址也可以识别: | ||
| - | Internal links are created by using square brackets. You can either just give a [[pagename]] or use an additional [[pagename|link text]]. | + | ==== 内部链接 ==== |
| - | Internal links are created by using square brackets. You can either just give | + | 内部链接是使用方括号创建的。你可以只给出一个 |
| - | a [[pagename]] or use an additional | + | |
| - | [[doku> | + | 内部链接是使用方括号创建的。 |
| + | 你可以只给出一个 | ||
| - | You can use [[some: | + | [[doku> |
| - | You can use [[some:namespaces]] by using a colon in the pagename. | + | 你可以通过冒号(: |
| - | 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# | + | 通过井号(# |
| - | Notes: | + | 链接至页面的 [[syntax# |
| - | * Links to [[syntax|existing pages]] are shown in a different style from [[nonexisting]] ones. | + | 注意: |
| - | * DokuWiki does not use [[wp> | + | |
| - | * When a section' | + | |
| - | ==== Interwiki ==== | + | * [[syntax|有效页面]] 与 [[nonexisting|失效页面]] 的显示样式不同。 |
| + | * DokuWiki 并不自动使用 [[wp> | ||
| + | * 请勿过度使用特定区域,因为当文档标题改变时它并不会同步改变。 | ||
| - | DokuWiki supports [[doku> | + | ==== 内部维基 ==== |
| - | | + | DokuWiki |
| - | | + | |
| + | | ||
| ==== Windows Shares ==== | ==== 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 | + | DokuWiki 同样支持 |
| - | | + | |
| - | Notes: | + | 注意: |
| - | * For security reasons direct browsing of windows shares only works in Microsoft Internet Explorer per default (and only in the "local zone" | + | * 为了安全,此功能默认只会在同网络下的 IE 浏览器中被启用。 |
| - | * For Mozilla and Firefox it can be enabled through different workaround mentioned in the [[http:// | + | * [[http:// |
| <?php | <?php | ||
| /** | /** | ||
| 行 93: | 行 94: | ||
| </ | </ | ||
| - | ==== 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:// | ||
| 行 101: | 行 103: | ||
| [[http:// | [[http:// | ||
| - | Please note: The image formatting is the only formatting syntax accepted in link names. | + | 请注意:此语法是唯一可被链接名称接受的变种语法。 |
| - | The whole [[# | + | [[# |
| + | ===== 脚注 ===== | ||
| - | ===== Footnotes ===== | + | 使用双层括号来引用脚注 ((脚注))。 |
| - | You can add footnotes | + | 使用双层括号来引用脚注 |
| - | You can add footnotes ((This is a footnote)) by using double parentheses. | + | ===== 标题 ===== |
| - | ===== Sectioning ===== | + | DokuWiki 支持五种层级的标题。 倘若多于三个标题,DokuWiki 会自动生成一个表格,通过引用 ''< |
| - | 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 ''< | + | ==== 三级标题 ==== |
| + | === 四级标题 === | ||
| + | == 五级标题 == | ||
| - | ==== Headline Level 3 ==== | + | |
| - | === Headline Level 4 === | + | === 四级标题 |
| - | == Headline Level 5 == | + | == 五级标题 |
| - | ==== Headline Level 3 ==== | + | 使用大于 |
| - | === Headline Level 4 === | + | |
| - | == Headline Level 5 == | + | |
| - | + | ||
| - | By using four or more dashes, you can make a horizontal line: | + | |
| ---- | ---- | ||
| - | |||
| ===== Media Files ===== | ===== Media Files ===== | ||
| - | You can include external and internal | + | 通过花括号来引用 |
| + | 原始尺寸:{{wiki: | ||
| - | Real size: | + | 给定宽度:{{wiki: |
| - | Resize to given width: | + | 给定宽度与高度 ((当给定的长宽比与原始的不匹配时,DokuWiki 会先裁剪图片,再调整图片大小)):{{wiki: |
| - | Resize to given width and height((when the aspect ratio of the given width and height doesn' | + | 外部图片:{{https:// |
| - | Resized external image: {{https:// | + | 原始尺寸:{{wiki:dokuwiki-128.png}} |
| + | 给定宽度:{{wiki: | ||
| + | 给定宽度与高度:{{wiki: | ||
| + | 外部图片:{{https:// | ||
| - | Real size: {{wiki: | ||
| - | Resize to given width: | ||
| - | Resize to given width and height: {{wiki: | ||
| - | Resized external image: {{https:// | ||
| - | + | 在大括号内不同位置添加空格( )可改变图片的对齐方式: | |
| - | By using left or right whitespaces you can choose the alignment. | + | |
| {{ wiki: | {{ wiki: | ||
| 行 157: | 行 156: | ||
| {{ wiki: | {{ wiki: | ||
| - | Of course, you can add a title (displayed as a tooltip by most browsers), too. | + | 你还能给图片添加一个标题: |
| {{ wiki: | {{ wiki: | ||
| 行 163: | 行 162: | ||
| {{ wiki: | {{ wiki: | ||
| - | For linking an image to another page see [[# | + | 如果想通过图片来链接一个网页请看[[#Image|这里]]。 |
| - | ==== 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. | + | 倘若引用不被支持的类型,DokuWiki 会直接显示原始链接。 |
| - | 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 mp4 video: | + | 例如你想引用这个视频: |
| {{video.mp4|A funny video}} | {{video.mp4|A funny video}} | ||
| - | When you upload a '' | + | 那么倘若你上传了 |
| - | Additionally DokuWiki supports a " | + | 假如你上传了与视频同名的图片 |
| - | ===== 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 | + | - 是不是很方便? |
| < | < | ||
| - | * 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 | + | - 是不是很方便? |
| </ | </ | ||
| - | Also take a look at the [[doku> | + | 你可以看看[[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 ==== | ==== Text to Image Conversions ==== | ||
| - | DokuWiki | + | 一般来说,DokuWiki |
| * 8-) %% 8-) %% | * 8-) %% 8-) %% | ||
| 行 254: | 行 254: | ||
| * DELETEME %% DELETEME %% | * 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) | -> <- <-> => <= <=> >> << -- --- 640x480 (c) (tm) (r) | ||
| - | "He thought ' | + | "他认为这是男人的世界……" |
| < | < | ||
| -> <- <-> => <= <=> >> << -- --- 640x480 (c) (tm) (r) | -> <- <-> => <= <=> >> << -- --- 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> | + | 通过配置 |
| - | There are three exceptions which do not come from that pattern file: multiplication entity | + | 然而有三个例外:乘号 |
| - | ===== 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' | + | > 不,我们不能干 |
| - | >> | + | >> |
| - | > Really? | + | > 讲真? |
| - | >> | + | >> |
| - | >>> | + | >>> |
| </ | </ | ||
| - | I think we should do it | + | 我认为我可以干 |
| - | > No we shouldn' | + | > 不,我们不能干 |
| - | >> | + | >> |
| - | > Really? | + | > 讲真? |
| - | >> | + | >> |
| - | >>> | + | >>> |
| - | ===== Tables | + | ===== 表格 |
| - | DokuWiki | + | DokuWiki |
| - | ^ Heading | + | ^ 标题 |
| | Row 1 Col 1 | Row 1 Col 2 | Row 1 Col 3 | | | Row 1 Col 1 | Row 1 Col 2 | Row 1 Col 3 | | ||
| | Row 2 Col 1 | some colspan (note the double pipe) || | | Row 2 Col 1 | some colspan (note the double pipe) || | ||
| | Row 3 Col 1 | Row 3 Col 2 | Row 3 Col 3 | | | Row 3 Col 1 | Row 3 Col 2 | Row 3 Col 3 | | ||
| - | Table rows have to start and end with a '' | + | 对于表格中的普通行,该行必须以“|”开头和结尾,对于标题,必须以“^”开头和结尾。 |
| ^ Heading 1 ^ Heading 2 ^ Heading 3 ^ | ^ Heading 1 ^ Heading 2 ^ Heading 3 ^ | ||
| 行 316: | 行 316: | ||
| | Row 3 Col 1 | Row 3 Col 2 | Row 3 Col 3 | | | Row 3 Col 1 | Row 3 Col 2 | Row 3 Col 3 | | ||
| - | To connect cells horizontally, | + | 通过留白一单元以链接两个水平相邻的单元格(别忘了分隔符)。 |
| - | Vertical tableheaders are possible, too. | + | DokuWiki 同样支持垂直的标题: |
| | ^ Heading 1 ^ Heading 2 ^ | | ^ Heading 1 ^ Heading 2 ^ | ||
| 行 325: | 行 325: | ||
| ^ Heading 5 | Row 2 Col 2 | Row 2 Col 3 | | ^ Heading 5 | Row 2 Col 2 | Row 2 Col 3 | | ||
| - | As you can see, it's the cell separator before a cell which decides about the formatting: | + | 同你所见,单元分隔符决定了该单元的格式: |
| | ^ Heading 1 ^ Heading 2 ^ | | ^ Heading 1 ^ Heading 2 ^ | ||
| 行 332: | 行 332: | ||
| ^ Heading 5 | Row 2 Col 2 | Row 2 Col 3 | | ^ Heading 5 | Row 2 Col 2 | Row 2 Col 3 | | ||
| - | You can have rowspans (vertically connected cells) by adding | + | 通过添加 |
| ^ Heading 1 ^ Heading 2 ^ Heading 3 ^ | ^ Heading 1 ^ Heading 2 ^ Heading 3 ^ | ||
| 行 339: | 行 339: | ||
| | Row 3 Col 1 | ::: | Row 2 Col 3 | | | Row 3 Col 1 | ::: | Row 2 Col 3 | | ||
| - | Apart from the rowspan syntax those cells should not contain anything else. | + | 除了行合并语法之外,这些单元格不应包含任何其他内容 |
| ^ Heading 1 ^ Heading 2 ^ Heading 3 ^ | ^ Heading 1 ^ Heading 2 ^ Heading 3 ^ | ||
| 行 346: | 行 346: | ||
| | Row 3 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 | ^ Table with alignment | ||
| 行 353: | 行 353: | ||
| | xxxxxxxxxxxx | xxxxxxxxxxxx | xxxxxxxxxxxx | | | xxxxxxxxxxxx | xxxxxxxxxxxx | xxxxxxxxxxxx | | ||
| - | This is how it looks in the source: | + | 看看源码长的样子: |
| ^ Table with alignment | ^ Table with alignment | ||
| 行 360: | 行 360: | ||
| | 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), enclose the area either with '' | + | 如果您需要显示与键入的文本完全相同的文本(不带任何格式), 请使用'' |
| < | < | ||
| - | This is some text which contains addresses like this: http:// | + | 这是一些包含如下地址的文本: http:// |
| </ | </ | ||
| - | The same is true for %%// | + | 对于带有笑脸的也是如此%%// |
| < | < | ||
| 行 376: | 行 376: | ||
| The same is true for %%// | The same is true for %%// | ||
| - | ===== Code Blocks | + | ===== 代码块 |
| - | You can include code blocks into your documents by either indenting them by at least two spaces (like used for the previous examples) or by using the tags '' | + | 您可以通过将代码块缩进至少两个空格(如前面的示例中使用的那样)或使用标签'' |
| This is text is indented by two spaces. | This is text is indented by two spaces. | ||
| 行 390: | 行 390: | ||
| </ | </ | ||
| - | Those blocks were created by this source: | + | 看看代码长的样子: |
| This is text is indented by two spaces. | This is text is indented by two spaces. | ||
| 行 402: | 行 402: | ||
| </ | </ | ||
| - | ==== Syntax Highlighting | + | ==== 语法高亮 |
| - | [[wiki: | + | [[wiki: |
| <code java> | <code java> | ||
| 行 418: | 行 418: | ||
| </ | </ | ||
| - | The following language strings are currently recognized: //4cs 6502acme 6502kickass 6502tasm 68000devpac abap actionscript3 actionscript ada aimms algol68 apache applescript apt_sources arm asm asp asymptote autoconf autohotkey autoit avisynth awk bascomavr bash basic4gl batch bf biblatex bibtex blitzbasic bnf boo caddcl cadlisp ceylon | + | 以下的标识符会被识别为高亮: |
| - | There are additional [[doku> | ||
| - | ==== Downloadable Code Blocks | + | 点击[[doku> |
| + | ==== 可下载的代码块 | ||
| - | When you use the '' | + | 倘若你使用上述的 |
| < | < | ||
| 行 431: | 行 431: | ||
| </ | </ | ||
| </ | </ | ||
| + | |||
| <file php myexample.php> | <file php myexample.php> | ||
| 行 436: | 行 437: | ||
| </ | </ | ||
| - | 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: | + | ===== 嵌入 HTML和PHP |
| - | By default the feed will be sorted by date, newest items first. You can sort it by oldest first using the '' | + | 通过使用 |
| - | **Example:** | + | HTML 的例子: |
| + | |||
| + | < | ||
| + | < | ||
| + | This is some <span style=" | ||
| + | </ | ||
| + | < | ||
| + | <p style=" | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | This is some <span style=" | ||
| + | </ | ||
| + | < | ||
| + | <p style=" | ||
| + | </ | ||
| + | |||
| + | PHP 的例子: | ||
| + | |||
| + | < | ||
| + | < | ||
| + | echo 'The PHP version: '; | ||
| + | echo phpversion(); | ||
| + | echo ' (generated inline HTML)'; | ||
| + | </ | ||
| + | < | ||
| + | echo '< | ||
| + | echo '< | ||
| + | echo '</ | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | echo 'The PHP version: '; | ||
| + | echo phpversion(); | ||
| + | echo ' (inline HTML)'; | ||
| + | </ | ||
| + | < | ||
| + | echo '< | ||
| + | echo '< | ||
| + | echo '</ | ||
| + | </ | ||
| + | |||
| + | **请注意**:嵌入的 HTML 与 PHP 默认只被显示源代码,并不被执行。 | ||
| + | |||
| + | ===== RSS/ | ||
| + | [[DokuWiki]] 以集成来自外部XML源的数据。为了解析XML源,使用了[[http:// | ||
| + | |||
| + | ^ 参数 | ||
| + | | any number | 将用作要显示的最大项目数,默认为 8 | | ||
| + | | reverse | ||
| + | | author | ||
| + | | date | 显示项目日期 | | ||
| + | | description| 显示项目描述。如果HTML不可用,那么所有HTML标签都将被去除 | | ||
| + | | nosort | ||
| + | | //n//[dhm] | 刷新周期,其中 d=天,h=小时,m=分钟。(例如 12 小时 = 12 小时). | | ||
| + | |||
| + | 刷新周期默认为 4 小时,任何低于 10 分钟的值都将被视为 10 分钟。 [[wiki: | ||
| + | 默认情况下,Feed 将按日期排序,最新项目排在最前面。 你可以使用'' | ||
| + | |||
| + | **例子:** | ||
| {{rss> | {{rss> | ||
| 行 461: | 行 513: | ||
| - | ===== 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 | + | |
| - | ===== Syntax Plugins ===== | + | ^ 宏 ^ 描述 | |
| + | | %%~~NOTOC~~%% | ||
| + | | %%~~NOCACHE~~%% | 默认 DokuWiki 会缓存所有的页面输出。但有时候你可能并不想要这个特性(例如使用了%%< | ||
| - | DokuWiki' | + | ===== 语法插件 ===== |
| + | 可以通过[[doku> | ||
| ~~INFO: | ~~INFO: | ||
wiki/syntax.1688645854.txt · 最后更改: 2025/10/11 02:55 (外部编辑)
