两侧同时换到之前的修订记录前一修订版后一修订版 | 前一修订版 |
wiki:syntax [2023/07/06 06:06] – [语法高亮] ob | wiki:syntax [2023/08/04 14:46] (当前版本) – 已恢复为旧版 (2023/07/06 06:52) 弘毅 |
---|
| |
| |
===== 嵌入 HTML 和 PHP ===== | ===== 嵌入 HTML和PHP ===== |
| |
通过使用 ''%%<html>%%'' or ''%%<php>%%'' 标签来嵌入原始 HTML 和 PHP 代码。(如果想要包含块级元素,请使用大写的标签) | 通过使用 ''%%<html>%%'' or ''%%<php>%%'' 标签来嵌入原始 HTML 和 PHP 代码。(如果想要包含块级元素,请使用大写的标签) |
**请注意**:嵌入的 HTML 与 PHP 默认只被显示源代码,并不被执行。 | **请注意**:嵌入的 HTML 与 PHP 默认只被显示源代码,并不被执行。 |
| |
===== RSS/ATOM Feed Aggregation ===== | ===== RSS/ATOM源聚合 ===== |
[[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: | [[DokuWiki]] 以集成来自外部XML源的数据。为了解析XML源,使用了[[http://simplepie.org/|SimplePie]] . SimplePie理解的所有格式也可以在DokuWiki中使用。您可以通过多个额外的空格分隔参数来影响渲染: |
| |
^ Parameter ^ Description ^ | ^ 参数 ^ 描述 ^ |
| any number | will be used as maximum number items to show, defaults to 8 | | | any number | 将用作要显示的最大项目数,默认为 8 | |
| reverse | display the last items in the feed first | | | reverse | 首先显示feed中的最后一项 | |
| author | show item authors names | | | author | 显示项目作者姓名 | |
| date | show item dates | | | date | 显示项目日期 | |
| description| show the item description. If [[doku>config:htmlok|HTML]] is disabled all tags will be stripped | | | description| 显示项目描述。如果HTML不可用,那么所有HTML标签都将被去除 | |
| nosort | do not sort the items in the feed | | | nosort | 不 Feed 中的项目进行排序 | |
| //n//[dhm] | refresh period, where d=days, h=hours, m=minutes. (e.g. 12h = 12 hours). | | | //n//[dhm] | 刷新周期,其中 d=天,h=小时,m=分钟。(例如 12 小时 = 12 小时). | |
| |
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. | 刷新周期默认为 4 小时,任何低于 10 分钟的值都将被视为 10 分钟。 [[wiki:DokuWiki]] 常会尝试提供页面的缓存版本,显然当页面包含动态外部内容时,这是不合适的。该参数告诉 [[wiki:DokuWiki]] 如果渲染页面的时间超过了刷新周期,则会重新渲染页面。 |
| 默认情况下,Feed 将按日期排序,最新项目排在最前面。 你可以使用''reverse''参数按照最旧排序或者使用''nosort''按原样显示。 |
| |
By default the feed will be sorted by date, newest items first. You can sort it by oldest first using the ''reverse'' parameter, or display the feed as is with ''nosort''. | **例子:** |
| |
**Example:** | |
| |
{{rss>http://slashdot.org/index.rss 5 author date 1h }} | {{rss>http://slashdot.org/index.rss 5 author date 1h }} |
| |
| |
===== 宏 ===== | ===== 控制宏 ===== |
| |
部分宏可以影响 DokuWiki 在页面中的渲染。例如: | 部分宏可以影响 DokuWiki 在页面中的渲染。例如: |
| |
^ Macro ^ Description | | ^ 宏 ^ 描述 | |
| %%~~NOTOC~~%% | 禁用表格 | | | %%~~NOTOC~~%% | 禁用表格 | |
| %%~~NOCACHE~~%% | 默认 DokuWiki 会缓存所有的页面输出。但有时候你可能并不想要这个特性(例如使用了%%<php>%%语法),引用此宏可以强制让 DokuWiki 在每次被调用时重新渲染页面 | | | %%~~NOCACHE~~%% | 默认 DokuWiki 会缓存所有的页面输出。但有时候你可能并不想要这个特性(例如使用了%%<php>%%语法),引用此宏可以强制让 DokuWiki 在每次被调用时重新渲染页面 | |