差别
这里会显示出您选择的修订版和当前版本之间的差别。
| wiki:syntax [2025/09/10 02:14] – 创建 - 外部编辑 127.0.0.1 | wiki:syntax [2026/05/08 01:21] (当前版本) – startpedia | ||
|---|---|---|---|
| 行 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 |
| - | ==== External | + | ==== 外部链接 |
| - | External links are recognized automagically: | + | 外部链接会被自动识别:http:// |
| - | DokuWiki | + | DokuWiki |
| - | | + | http:// |
| - | | + | |
| - | | + | |
| - | ==== Internal | + | ==== 内部链接 |
| - | Internal links are created by using square brackets. You can either just give a [[pagename]] or use an additional | + | 内部链接通过方括号创建。你可以直接给出一个[[页面名]],或者使用带额外[[页面名|链接文本]]的形式。 |
| - | | + | |
| - | a [[pagename]] or use an additional | + | 或者使用带额外[[页面名|链接文本]]的形式。 |
| - | [[doku>pagename|Wiki pagenames]] are converted to lowercase automatically, | + | [[doku>页面名|Wiki页面名]]会被自动转换为小写,且不允许使用特殊字符。 |
| - | You can use [[some:namespaces]] by using a colon in the pagename. | + | 你可以在页面名中使用冒号来创建[[某些:命名空间]]。 |
| - | | + | |
| - | For details about namespaces see [[doku> | + | 关于命名空间的详情请参考[[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#internal|this Section]]. | + | 也可以链接到特定章节,只需在井号后添加章节名称即可,如同 |
| - | | + | |
| - | Notes: | + | 注意事项: |
| - | * Links to [[syntax|existing pages]] are shown in a different style from [[nonexisting]] ones. | + | * 指向[[syntax|已存在页面]]的链接与指向[[不存在页面]]的链接显示样式不同。 |
| - | * DokuWiki | + | * DokuWiki |
| - | * When a section' | + | * 当章节标题更改时,其书签也会随之改变,因此请勿过度依赖章节链接。 |
| - | ==== Interwiki | + | ==== 跨 Wiki 链接 |
| - | DokuWiki | + | DokuWiki |
| - | DokuWiki | + | DokuWiki |
| - | | + | |
| - | ==== Windows | + | ==== Windows |
| - | Windows shares like [[\\server\share|this]] are recognized, too. Please note that these only make sense in a homogeneous | + | 像[[\\server\share|这个]]这样的 Windows 共享也会被识别。请注意,这仅在 |
| - | Windows | + | Windows |
| - | Notes: | + | 注意事项: |
| - | * For security reasons direct browsing of windows shares only works in Microsoft Internet Explorer | + | * 出于安全原因,默认情况下只有 |
| - | * For Mozilla | + | * 对于 |
| <?php | <?php | ||
| /** | /** | ||
| - | | + | |
| - | | + | |
| */ | */ | ||
| $lang[' | $lang[' | ||
| </ | </ | ||
| - | ==== Image Links ==== | + | ==== 图片链接 |
| - | You can also use an image to link to another internal or external page by combining the syntax for links and [[#images_and_other_files|images]] (see below) like this: | + | 你也可以通过组合链接语法和[[#图片和其他文件|图片]]语法,使用图片链接到其他内部或外部页面,如下所示: |
| [[http:// | [[http:// | ||
| 行 101: | 行 101: | ||
| [[http:// | [[http:// | ||
| - | Please note: The image formatting is the only formatting syntax accepted in link names. | + | 请注意:图片格式是链接名称中唯一接受的格式语法。 |
| - | The whole [[#images_and_other_files|image]] and [[#links|link]] syntax is supported (including image resizing, internal and external images and URLs and interwiki links). | + | 所有[[#图片和其他文件|图片]]和[[#链接|链接]]语法(包括调整图片大小、内部/ |
| - | ===== 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 | + | 你可以使用最多五个不同级别的标题来组织内容。如果有超过三个标题,系统会自动生成目录 —— 可以通过在文档中包含 |
| - | ==== 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 ===== | + | ===== 媒体文件 |
| - | You can include external and internal | + | 你可以使用花括号包含外部和内部的[[doku> |
| - | Real size: | + | 原始尺寸: |
| - | Resize to given width: | + | 按指定宽度缩放: |
| - | Resize to given width and height((when the aspect ratio of the given width and height doesn' | + | 按指定宽度和高度缩放((如果指定的宽高比与图片原始宽高比不符,缩放前会先按新比例进行裁剪)): {{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: |
| - | {{ 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 supports ordered and unordered lists. To create a list item, indent your text by two spaces and use a '' | + | 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 | + | ==== 文本转图片转换 |
| - | DokuWiki | + | DokuWiki |
| * 8-) %% 8-) %% | * 8-) %% 8-) %% | ||
| 行 254: | 行 253: | ||
| * DELETEME %% DELETEME %% | * DELETEME %% DELETEME %% | ||
| - | ==== Text to HTML Conversions | + | ==== 文本转 |
| - | Typography: | + | 排版:[[DokuWiki]] |
| -> <- <-> => <= <=> >> << -- --- 640x480 (c) (tm) (r) | -> <- <-> => <= <=> >> << -- --- 640x480 (c) (tm) (r) | ||
| - | "He thought ' | + | “他想着 ‘这是男人的世界……’” |
| < | < | ||
| 行 266: | 行 265: | ||
| </ | </ | ||
| - | 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 | + | | 行 1 列 1 | 行 1 列 2 |
| - | | Row 2 Col 1 | some colspan (note the double pipe) || | + | | 行 2 列 1 | 跨列单元格(注意双竖线) |
| - | | Row 3 Col 1 | Row 3 Col 2 | + | | 行 3 列 1 | 行 3 列 2 |
| - | Table rows have to start and end with a '' | + | 表格行必须以 |
| - | ^ Heading | + | ^ 标题 |
| - | | Row 1 Col 1 | Row 1 Col 2 | + | | 行 1 列 1 | 行 1 列 2 |
| - | | Row 2 Col 1 | some colspan (note the double pipe) || | + | | 行 2 列 1 | 跨列单元格(注意双竖线) |
| - | | Row 3 Col 1 | Row 3 Col 2 | + | | 行 3 列 1 | 行 3 列 2 |
| - | To connect cells horizontally, | + | 要水平合并单元格,只需将下一个单元格完全留空,如上所示。请确保始终有相同数量的单元格分隔符! |
| - | Vertical tableheaders are possible, too. | + | 也支持垂直表头。 |
| - | | ^ Heading | + | | ^ 标题 |
| - | ^ Heading | + | ^ 标题 |
| - | ^ Heading | + | ^ 标题 |
| - | ^ Heading | + | ^ 标题 |
| - | As you can see, it's the cell separator before a cell which decides about the formatting: | + | 如你所见,单元格之前的单元格分隔符决定了格式: |
| - | | ^ Heading | + | | ^ 标题 |
| - | ^ Heading | + | ^ 标题 |
| - | ^ Heading | + | ^ 标题 |
| - | ^ Heading | + | ^ 标题 |
| - | You can have rowspans (vertically connected cells) by adding | + | 你可以通过在下方的单元格中添加 |
| - | ^ Heading | + | ^ 标题 |
| - | | Row 1 Col 1 | this cell spans vertically | + | | 行 1 列 1 | 此单元格垂直跨行 |
| - | | Row 2 Col 1 | ::: | Row 2 Col 3 | | + | | 行 2 列 1 | ::: |
| - | | Row 3 Col 1 | ::: | Row 2 Col 3 | | + | | 行 3 列 1 | ::: |
| - | Apart from the rowspan syntax those cells should not contain anything else. | + | 除了垂直合并语法外,这些单元格不应包含任何其他内容。 |
| - | ^ Heading | + | ^ 标题 |
| - | | Row 1 Col 1 | this cell spans vertically | + | | 行 1 列 1 | 此单元格垂直跨行 |
| - | | Row 2 Col 1 | ::: | Row 2 Col 3 | | + | | 行 2 列 1 | ::: |
| - | | Row 3 Col 1 | ::: | Row 2 Col 3 | | + | | 行 3 列 1 | ::: |
| - | 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 | + | ^ 带对齐的表格 |
| - | | right| | + | | 右对齐| |
| - | |left | + | |左对齐 |
| | xxxxxxxxxxxx | xxxxxxxxxxxx | xxxxxxxxxxxx | | | xxxxxxxxxxxx | xxxxxxxxxxxx | xxxxxxxxxxxx | | ||
| - | This is how it looks in the source: | + | 这是它在源码中的样子: |
| - | ^ Table with alignment | + | ^ 带对齐的表格 |
| - | | 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:// | + | 这段文本包含像 |
| </ | </ | ||
| - | The same is true for %%//__this__ text// with a smiley | + | 同样,%%//__这段文本__// 带着表情符号 |
| < | < | ||
| - | | + | |
| </ | </ | ||
| - | | + | |
| - | ===== 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 preformatted code all spaces are preserved: like <-this | + | 这是预格式化的代码,所有空格都会保留:就像 |
| </ | </ | ||
| < | < | ||
| - | This is pretty much the same, but you could use it to show that you quoted a file. | + | 这和上面几乎一样,但你可以用它来表示引用自某个文件的内容。 |
| </ | </ | ||
| - | Those blocks were created by this source: | + | 这些代码块由以下源码创建: |
| - | | + | |
| < | < | ||
| - | | + | |
| </ | </ | ||
| < | < | ||
| - | | + | |
| </ | </ | ||
| - | ==== Syntax Highlighting | + | ==== 语法高亮 |
| - | [[wiki: | + | [[wiki: |
| <code java> | <code java> | ||
| /** | /** | ||
| - | | + | * HelloWorldApp |
| - | | + | |
| */ | */ | ||
| class HelloWorldApp { | class HelloWorldApp { | ||
| public static void main(String[] args) { | public static void main(String[] args) { | ||
| - | System.out.println(" | + | System.out.println(" |
| } | } | ||
| } | } | ||
| </ | </ | ||
| - | 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 cfdg cfm chaiscript chapel cil c_loadrunner clojure c_mac cmake cobol coffeescript c cpp cpp-qt cpp-winapi csharp css cuesheet c_winapi dart dcl dcpu16 dcs delphi diff div dos dot d ecmascript eiffel email epc e erlang euphoria ezt f1 falcon fo fortran freebasic freeswitch fsharp gambas gdb genero genie gettext glsl gml gnuplot go groovy gwbasic haskell haxe hicest hq9plus html html4strict html5 icon idl ini inno intercal io ispfpanel java5 java javascript jcl j jquery julia kixtart klonec klonecpp kotlin latex lb ldif lisp llvm locobasic logtalk lolcode lotusformulas lotusscript lscript lsl2 lua m68k magiksf make mapbasic mathematica matlab mercury metapost mirc mk-61 mmix modula2 modula3 mpasm mxml mysql nagios netrexx newlisp nginx nimrod nsis oberon2 objc objeck ocaml-brief ocaml octave oobas oorexx oracle11 oracle8 oxygene oz parasail parigp pascal pcre perl6 perl per pf phix php-brief php pic16 pike pixelbender pli plsql postgresql postscript povray powerbuilder powershell proftpd progress prolog properties providex purebasic pycon pys60 python qbasic qml q racket rails rbs rebol reg rexx robots roff rpmspec rsplus ruby rust sas sass scala scheme scilab scl sdlbasic smalltalk smarty spark sparql sql sshconfig standardml stonescript swift systemverilog tclegg tcl teraterm texgraph text thinbasic tsql twig typoscript unicon upc urbi uscript vala vbnet vb vbscript vedit verilog vhdl vim visualfoxpro visualprolog whitespace whois winbatch wolfram xbasic xml xojo xorg_conf xpp yaml z80 zxbasic// |
| - | There are additional | + | 语法高亮还有额外的[[doku> |
| - | ==== Downloadable Code Blocks | + | ==== 可下载的代码块 |
| - | When you use the '' | + | 当你像上面那样使用 |
| < | < | ||
| 行 436: | 行 435: | ||
| </ | </ | ||
| - | If you don't want any highlighting but want a downloadable file, specify a dash ('' | + | 如果你不需要高亮但希望提供可下载的文件,请在语言代码位置指定一个短横线('' |
| - | ===== RSS/ | + | ===== RSS/ |
| - | [[DokuWiki]] can integrate data from external XML feeds. For parsing the XML feeds, [[http:// | + | |
| - | ^ Parameter | + | [[DokuWiki]] 可以集成外部 XML 订阅源的数据。解析 XML 订阅源使用的是 [[http://simplepie.org/|SimplePie]] 。SimplePie 能理解的所有格式都可以在 DokuWiki 中使用。你可以通过多个额外的空格分隔参数来影响渲染效果: |
| - | | 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: | + | ^ 参数 ^ 描述 ^ |
| + | | 任意数字 | 将用作显示的最大项目数,默认为 8 | | ||
| + | | reverse | ||
| + | | author | ||
| + | | date | 显示项目的日期 | | ||
| + | | description| 显示项目的描述。所有 HTML 标签将被剥离 | | ||
| + | | nosort | ||
| + | | //n//[dhm] | 刷新周期,其中 d=天,h=小时,m=分钟(例如 12h = 12 小时)。 | | ||
| - | By default the feed will be sorted by date, newest items first. You can sort it by oldest first using the '' | + | 刷新周期默认为 4 小时。任何低于 10 分钟的值将被视为 10 分钟。[[wiki: |
| - | **Example:** | + | 默认情况下,订阅源将按日期排序,最新的项目在前。你可以使用 '' |
| + | |||
| + | **示例:** | ||
| {{rss> | {{rss> | ||
| 行 460: | 行 460: | ||
| {{rss> | {{rss> | ||
| + | ===== 控制宏 ===== | ||
| - | ===== Control Macros ===== | + | 某些语法会影响 DokuWiki 渲染页面的方式,但其本身不产生任何输出。以下是可用的控制宏: |
| - | Some syntax influences how DokuWiki | + | ^ 宏 ^ 描述 | |
| + | | %%~~NOTOC~~%% | ||
| + | | %%~~NOCACHE~~%% | DokuWiki | ||
| - | ^ 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> | + | |
| ~~INFO: | ~~INFO: | ||
| - | |||