Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision |
zh-cn:wiki:syntax [2012/04/16 19:18] – [可下载的代码块] haobug | zh-cn:wiki:syntax [2012/04/28 18:21] – [RSS/ATOM Feed 聚合] haobug |
---|
| |
如果您不想要任何高亮,但想要一个可下载的文件,指定破折号(''-'') 作为语言代码:''%%<code - myfile.foo>%%''。 | 如果您不想要任何高亮,但想要一个可下载的文件,指定破折号(''-'') 作为语言代码:''%%<code - myfile.foo>%%''。 |
===== Embedding HTML and PHP ===== | ===== 内嵌 HTML 和 PHP ===== |
| |
You can embed raw HTML or PHP code into your documents by using the ''%%<html>%%'' or ''%%<php>%%'' tags. (Use uppercase tags if you need to enclose block level elements.) | 您可以嵌入原始HTML或PHP代码到文件中,通过使用 ''%%<html>%%'' 或者 ''%%<php>%%'' 标签。(如果您需要包围块级元素,使用大写字母的标签。) |
| |
HTML example: | HTML 例子: |
| |
<code> | <code> |
<html> | <html> |
This is some <span style="color:red;font-size:150%;">inline HTML</span> | 这是一些 <span style="color:red;font-size:150%;">内联 HTML</span> |
</html> | </html> |
<HTML> | <HTML> |
<p style="border:2px dashed red;">And this is some block HTML</p> | <p style="border:2px dashed red;">而这是一个块级元素 block HTML</p> |
</HTML> | </HTML> |
</code> | </code> |
| |
<html> | <html> |
This is some <span style="color:red;font-size:150%;">inline HTML</span> | 这是一些 <span style="color:red;font-size:150%;">内联 HTML</span> |
</html> | </html> |
<HTML> | <HTML> |
<p style="border:2px dashed red;">And this is some block HTML</p> | <p style="border:2px dashed red;">而这是一个块级元素 block HTML</p> |
</HTML> | </HTML> |
| PHP 例子: |
PHP example: | |
| |
<code> | <code> |
<php> | <php> |
echo 'A logo generated by PHP:'; | echo 'PHP 生成的logo:'; |
echo '<img src="' . $_SERVER['PHP_SELF'] . '?=' . php_logo_guid() . '" alt="PHP Logo !" />'; | echo '<img src="' . $_SERVER['PHP_SELF'] . '?=' . php_logo_guid() . '" alt="PHP Logo !" />'; |
echo '(generated inline HTML)'; | echo '(生成内联 html)'; |
</php> | </php> |
<PHP> | <PHP> |
echo '<table class="inline"><tr><td>The same, but inside a block level element:</td>'; | echo '<table class="inline"><tr><td>和上面一样,但是在块级元素内部:</td>'; |
echo '<td><img src="' . $_SERVER['PHP_SELF'] . '?=' . php_logo_guid() . '" alt="PHP Logo !" /></td>'; | echo '<td><img src="' . $_SERVER['PHP_SELF'] . '?=' . php_logo_guid() . '" alt="PHP Logo !" /></td>'; |
echo '</tr></table>'; | echo '</tr></table>'; |
| |
<php> | <php> |
echo 'A logo generated by PHP:'; | echo 'PHP 生成的logo:'; |
echo '<img src="' . $_SERVER['PHP_SELF'] . '?=' . php_logo_guid() . '" alt="PHP Logo !" />'; | echo '<img src="' . $_SERVER['PHP_SELF'] . '?=' . php_logo_guid() . '" alt="PHP Logo !" />'; |
echo '(inline HTML)'; | echo '(生成内联 html)'; |
</php> | </php> |
<PHP> | <PHP> |
echo '<table class="inline"><tr><td>The same, but inside a block level element:</td>'; | echo '<table class="inline"><tr><td>和上面一样,但是在块级元素内部:</td>'; |
echo '<td><img src="' . $_SERVER['PHP_SELF'] . '?=' . php_logo_guid() . '" alt="PHP Logo !" /></td>'; | echo '<td><img src="' . $_SERVER['PHP_SELF'] . '?=' . php_logo_guid() . '" alt="PHP Logo !" /></td>'; |
echo '</tr></table>'; | echo '</tr></table>'; |
</PHP> | </PHP> |
| |
**Please Note**: HTML and PHP embedding is disabled by default in the configuration. If disabled, the code is displayed instead of executed. | **注意**:HTML 和 PHP 在配置中默认是禁用的。如果禁用了,就会显示它们代码,而不会执行它们。 |
| |
| ===== RSS/ATOM Feed 聚合 ===== |
| 所有的能够被SimplePie理解的格式都可以在DokuWiki中使用。您可以通过多个参数来改变渲染,参数之间用空格隔开: |
| |
| |
| [[DokuWiki]] 能够从外部的XML feed中聚合数据。用[[http://simplepie.org/|SimplePie]] 解析这些XML feed。 所有 SimplePie 支持的格式都可以在DokuWiki中使用。 您可以通过多个参数来改变其显示,参数之间用空格隔开: |
| |
===== RSS/ATOM Feed Aggregation ===== | ^ 参数 ^ 描述 ^ |
[[DokuWiki]] can integrate data from external XML feeds. For parsing the XML feeds, [[http://simplepie.org/|SimplePie]] is used. All formats understood by SimplePie can be used in DokuWiki as well. You can influence the rendering by multiple additional space separated parameters: | | 任何数字 | 最多显示多少内容项;默认是8 | |
| | reverse | 将最新条目显示在前面 | |
| | author | 显示条目的作者名 | |
| | date | 显示条目日期 | |
| | description| 显示条目的描述;如果 [[doku>config:htmlok|HTML]] 被禁用,所有的标签将被过滤掉 | |
| | //n//[dhm] | 刷新周期,其中,d=天,h=小时,m=分。例如,12h=12个小时。| |
| |
^ Parameter ^ Description ^ | 刷新周期默认是4小时。小于或者等于10分钟均视为10分钟。[[wiki:DokuWiki]] 通常会提供页面的缓存版,显然,这种做法不适用于包含动态外部内容的页面。上面的参数告诉 [[wiki:DokuWiki]] 如果离上次重新解释的时间已经超出了 //刷新周期//,则重新解释页面。 |
| any number | will be used as maximum number items to show, defaults to 8 | | |
| reverse | display the last items in the feed first | | |
| author | show item authors names | | |
| date | show item dates | | |
| description| show the item description. If [[doku>config:htmlok|HTML]] is disabled all tags will be stripped | | |
| //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:DokuWiki]] will generally try to supply a cached version of a page, obviously this is inappropriate when the page contains dynamic external content. The parameter tells [[wiki:DokuWiki]] to re-render the page if it is more than //refresh period// since the page was last rendered. | |
| |
**Example:** | **举例:** |
| |
{{rss>http://slashdot.org/index.rss 5 author date 1h }} | {{rss>http://slashdot.org/index.rss 5 author date 1h }} |
| |
| |
===== Control Macros ===== | ===== 控制宏 ===== |
| |
Some syntax influences how DokuWiki renders a page without creating any output it self. The following control macros are availble: | 一些语法会影响DokuWiki对页面的解释,而自身不输出任何内容。可用的控制宏如下: |
| |
^ Macro ^ Description | | ^ 宏 ^ 描述 | |
| %%~~NOTOC~~%% | If this macro is found on the page, no table of contents will be created | | | %%~~NOTOC~~%% | 如果页面出现该控制宏,将不会创建目录 | |
| %%~~NOCACHE~~%% | DokuWiki caches all output by default. Sometimes this might not be wanted (eg. when the %%<php>%% syntax above is used), adding this macro will force DokuWiki to rerender a page on every call | | | %%~~NOCACHE~~%% | DokuWiki 默认会缓存所有的输出。有时并不希望这样(例如,当使用了上面的 %%<php>%% 语法),增加这个控制宏将强制 DokuWiki 在每次访问时重新解析页面 | |
| |
===== Syntax Plugins ===== | ===== 语法插件 ===== |
| |
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 DokuWiki installation: | DokuWiki 的语法可以通过 [[doku>plugins|插件]]来扩充。如何使用已安装的插件在它们的描述页中有说明。本 DokuWiki 可用的语法插件如下: |
| |
~~INFO:syntaxplugins~~ | ~~INFO:syntaxplugins~~ |
| |