wiki:syntax
差别
这里会显示出您选择的修订版和当前版本之间的差别。
两侧同时换到之前的修订记录前一修订版后一修订版 | 前一修订版上一修订版两侧同时换到之后的修订记录 | ||
wiki:syntax [2023/07/06 06:49] – [RSS/ATOM源聚合] ob | wiki:syntax [2023/07/06 12:17] – 外部编辑 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. |
- | DokuWiki 支持多种创建链接的方式。 | + | ===== Links ===== |
- | ==== 外部链接 ==== | + | DokuWiki supports multiple ways of creating links. |
- | 外部链接会自动识别:http:// | + | ==== External ==== |
- | 您也可以设置链接文本: | + | 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: < | ||
- | DokuWiki 支持多种创建链接的方式. | + | ==== Internal ==== |
- | 外部链接会自动识别: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> |
- | 你可以只给出一个 | + | |
- | [[doku> | + | You can use [[some: |
- | 你可以通过冒号(: | + | 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# |
- | 链接至页面的 [[syntax# | + | Notes: |
- | 注意: | + | * Links to [[syntax|existing pages]] are shown in a different style from [[nonexisting]] ones. |
+ | * DokuWiki does not use [[wp> | ||
+ | * When a section' | ||
- | * [[syntax|有效页面]] 与 [[nonexisting|失效页面]] 的显示样式不同。 | + | ==== Interwiki ==== |
- | * DokuWiki 并不自动使用 [[wp> | + | |
- | * 请勿过度使用特定区域,因为当文档标题改变时它并不会同步改变。 | + | |
- | ==== 内部维基 ==== | + | DokuWiki supports [[doku> |
- | DokuWiki | + | |
- | + | | |
- | | + | |
==== Windows Shares ==== | ==== Windows Shares ==== | ||
- | DokuWiki 同样支持 | + | Windows shares like [[\\server\share|this]] are recognized, too. Please note that these only make sense in a homogeneous user group like a corporate |
- | | + | |
- | 注意: | + | Notes: |
- | * 为了安全,此功能默认只会在同网络下的 IE 浏览器中被启用。 | + | * For security reasons direct browsing of windows shares only works in Microsoft Internet Explorer per default (and only in the "local zone" |
- | * [[http:// | + | * For Mozilla and Firefox it can be enabled through different workaround mentioned in the [[http:// |
<?php | <?php | ||
/** | /** | ||
行 94: | 行 93: | ||
</ | </ | ||
- | ==== 图片链接 | + | ==== 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:// | ||
行 103: | 行 101: | ||
[[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. |
- | DokuWiki 支持五种层级的标题。 倘若多于三个标题,DokuWiki 会自动生成一个表格,通过引用 ''< | + | ===== 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 ''< |
- | === 四级标题 === | + | |
- | == 五级标题 == | + | |
- | | + | ==== 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: | + | |
- | 给定宽度:{{wiki: | + | Real size: |
- | 给定宽度与高度 ((当给定的长宽比与原始的不匹配时,DokuWiki 会先裁剪图片,再调整图片大小)):{{wiki: | + | Resize to given width: |
- | 外部图片:{{https:// | + | Resize to given width and height((when the aspect ratio of the given width and height doesn' |
- | 原始尺寸:{{wiki:dokuwiki-128.png}} | + | Resized external image: {{https:// |
- | 给定宽度:{{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: | ||
行 156: | 行 157: | ||
{{ wiki: | {{ wiki: | ||
- | 你还能给图片添加一个标题: | + | Of course, you can add a title (displayed as a tooltip by most browsers), too. |
{{ wiki: | {{ wiki: | ||
行 162: | 行 163: | ||
{{ wiki: | {{ wiki: | ||
- | 如果想通过图片来链接一个网页请看[[#Image|这里]]。 | + | For linking an image to another page see [[# |
- | ==== 支持的媒体 | + | ==== Supported Media Formats |
- | DokuWiki | + | DokuWiki |
- | | 图片 | + | | Image | '' |
- | | 视频 | + | | Video | '' |
- | | 音频 | + | | Audio | '' |
| Flash | '' | | Flash | '' | ||
- | 倘若引用不被支持的类型,DokuWiki 会直接显示原始链接。 | + | 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 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 |
</ | </ | ||
- | 你可以看看[[doku> | + | 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 ==== | ==== 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, |
- | DokuWiki 同样支持垂直的标题: | + | Vertical tableheaders are possible, too. |
| ^ 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 '' |
< | < | ||
- | 这是一些包含如下地址的文本: http:// | + | This is some text which contains addresses like this: 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> | ||
- | 点击[[doku> | + | ==== Downloadable Code Blocks |
- | ==== 可下载的代码块 | + | |
- | 倘若你使用上述的 | + | When you use the '' |
< | < | ||
行 431: | 行 431: | ||
</ | </ | ||
</ | </ | ||
- | |||
<file php myexample.php> | <file php myexample.php> | ||
行 437: | 行 436: | ||
</ | </ | ||
- | 使用横杠(-)来禁用语法高亮:'' | + | 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). | | ||
- | ===== 嵌入 HTML和PHP | + | 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 '' |
- | HTML 的例子: | + | **Example:** |
- | + | ||
- | < | + | |
- | < | + | |
- | 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> | ||
行 513: | 行 461: | ||
- | ===== 宏 ===== | + | ===== Control Macros |
- | 部分宏可以影响 | + | Some syntax influences how DokuWiki |
^ Macro ^ Description | | ^ Macro ^ Description | | ||
- | | %%~~NOTOC~~%% | + | | %%~~NOTOC~~%% |
- | | %%~~NOCACHE~~%% | 默认 | + | | %%~~NOCACHE~~%% | DokuWiki |
+ | |||
+ | ===== Syntax Plugins ===== | ||
- | ===== 语法插件 ===== | + | DokuWiki' |
- | 可以通过[[doku> | ||
~~INFO: | ~~INFO: | ||
wiki/syntax.txt · 最后更改: 2023/08/04 14:46 由 弘毅