Dokuwiki 的插件

Dokuwiki 插件简介

DokuWiki 支持 Plugin (插件)。可以到 DokuWiki Plugins 查找并下载插件。

常用的插件

插件安装的一般方法

1、使用 Wiki管理界面中的 插件管理器 进行安装

2、手工安装

  1. 下载压缩文件
  2. 解压缩并上传至 <dokuwiki>/lib/plugins 目录
  3. 根据需要修改模版 (并非所有插件都需要此步骤)

一些插件可以使用 Wiki管理界面中的 配置管理器 进行配置,如:

  • Blog
  • Tag
  • Feed
  • BookmarkMe

常用插件的使用方法

下面收集了一些常用插件的使用方法:

Box Plugin

Syntax

The full syntax:

<box width classes colours | title text> contents text </box>

  • width — any legal CSS width value
  • classes — any number of classes which use the styles in your template or the plugin's own stylesheet to determine the look of the box. The box plugins comes with the following classes already defined:
    • round — box will have rounded corners
    • blue — blue colour scheme
    • red — red colour scheme
    • green — green colour scheme
    • orange — orange colour scheme
    • left — float the box left within the wiki page
    • right — float the box right within the wiki page

if no classes are specified the default styles will be used, that is square corners in a colour scheme based on the default Dokuwiki colour scheme.

  • colours — 1-4 colours in CSS hex or rgb notation, e.g. #F00 #fcab94 rgb(255,255,0). The colours are applied in order to:
    1. content background
    2. title background
    3. outer box background
    4. borders

if less than four colours are specified, the first colour is used for the missing colours.

  • title text — text (including dokuwiki markup) displayed above the box contents, with distinct style.
  • caption text — text (no markup allowed) displayed below the box contents, with distinct style.

The opening <box … > including the title must all appear on one line. The box contents can appear over as many lines as are needed.

Example

A simple box:

<box> the box contents </box>

the box contents

Some more complex boxes

<box 80% round orange|a title> the box contents</box>

a title

the box contents

<box 50% left blue>the box contents</box|a caption>

the box contents

a caption

<box 60% round #f99 #fc9 #fcc #f60|title>the box contents></box|caption>

title

the box contents>

caption

See the plugin in action here. The sample page shows all the styles available with the plugin.

Note Plugin

Syntax

<note [important|warning|tip]>
……
</note>

Example

<note>
This is my note ! Remember it !!
</note>

This is my note ! Remember it !!

<note important>
Warning ! You're about to lose your mind ;-)
</note>

Warning ! You're about to lose your mind ;-)

<note tip>
The clues are in the images.
</note>

The clues are in the images.

<note warning>
Beware of the dog when you open the door !!
</note>

Beware of the dog when you open the door !!

<note warning>
Beware of the dog when you open the door !!
<note tip>
The clues are in the images.
</note>
</note>

Beware of the dog when you open the door !!

The clues are in the images.

Folded Plugin

Usage & Example

Inline:

This is example ++text | with some of it only shown when you unfold it++. 
And after that the text just continues to flow in the same paragraph.

This is example text. And after that the text just continues to flow in the same paragraph.

Block:

This is example text.

++++ Title |

| This table | is only shown | when you unfold the block |

{{page>some other wiki page}}

++++

This is example text.

Title

Code Plugin

Syntax

<code lang number |[fh] text |[sh]>
{code to highlight}
</code>
  • lang” (if present) specifies the given code's (programming-) language;
  • number” (if present) specifies the first number to use when numbering the given code's lines;
  • the first ”|” (if present) delimits the first argument(s) from the remaining ones which are used to produce a header or footer above/below the high­ligh­ted code;
  • a ”h” (for “header”)1) following immediately the pipe cha­rac­ter cau­ses the remaining ”text” to get placed above the code, a ”f” (for “foot”)2) places the ”text” below the code (note that this flag is optional; if omitted it de­faults to ”f”);
  • the ”text” is used as-is with the additional benefit of get­ting wrapped by an anchor tag which allows for addressing the code from other pages.
  • the second ”|” (if present) delimits the header/footer text;
  • a ”s”(for “show”, the default) or ”h”(for “hide”) character (if present) controls the code block's initial folding state.
  • the ”{code to highlight}” is either the plain text to process or a pointer to an external_files.

Example

ex1:

<code>
some text
and more
</code>
some text
and more

ex2:

<code 1>
some text
and more
</code>
1: some text
2: and more

ex3:

<code JavaScript 12|Listing 2>
var de = function() {
return (typeof(window.de) == 'object') ? window.de : {};
}();
</code>
12: var de = function() {
13: return (typeof(window.de) == 'object') ? window.de : {};
14: }();

Listing 2

ex4:

<code JavaScript 12|h Listing 2>
var de = function() {
return (typeof(window.de) == 'object') ? window.de : {};
}();
</code>

Listing 2

12: var de = function() {
13: return (typeof(window.de) == 'object') ? window.de : {};
14: }();

ex5:

<code console>
$ sudo apt-get update
$ sudo apt-get upgrade
</code>
$ sudo apt-get update
$ sudo apt-get upgrade

ex6:

<code html 1|t The DokuWiki Start-Page>
extern> http://wiki.splitbrain.org/
</code>

The DokuWiki Start-Page

  1: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2:  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3: <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
  4:  lang="en" dir="ltr">
  5: <head>
  6:   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  7:   <title>
  8:     dokuwiki    [DokuWiki]
  9:   </title>
 10:
 11:   <meta name="generator" content="DokuWiki snapshot?" />
 12: <meta name="robots" content="index,follow" />
 13: <meta name="date" content="2008-08-16T19:24:02+0200" />
 14: <meta name="keywords" content="dokuwiki" />
 15: <link rel="search" type="application/opensearchdescription+xml" href="/lib/exe/opensearch.php" title="DokuWiki" />
 16: <link rel="start" href="/" />
 17: <link rel="contents" href="/dokuwiki?do=index" title="Index" />
 18: <link rel="alternate" type="application/rss+xml" title="Recent Changes" href="/feed.php" />
 19: <link rel="alternate" type="application/rss+xml" title="Current Namespace" href="/feed.php?mode=list&amp;ns=" />
 20: <link rel="alternate" type="text/html" title="Plain HTML" href="/_export/xhtml/dokuwiki" />
 21: <link rel="alternate" type="text/plain" title="Wiki Markup" href="/_export/raw/dokuwiki" />
 22: <link rel="stylesheet" media="all" type="text/css" href="/lib/exe/css.php?s=all&amp;t=default" />
 23: <link rel="stylesheet" media="screen" type="text/css" href="/lib/exe/css.php?t=default" />
 24: <link rel="stylesheet" media="print" type="text/css" href="/lib/exe/css.php?s=print&amp;t=default" />
 25: <script type="text/javascript" charset="utf-8" src="/lib/exe/js.php?edit=0&amp;write=0" ></script>
 26: <script type="text/javascript" charset="utf-8" ><!--//--><![CDATA[//><!--
 27: addInitEvent(function(){
 28:     for ( i=0; i < document.forms.length; i++ ) {
 29:         if (document.forms[i].method == 'post') {
 30:             var myElement = document.createElement('input');
 31:             myElement.setAttribute('type', 'hidden');
 32:             myElement.name = 'bb2_screener_';
 33:             myElement.value = '1231261099 208.97.171.4';
 34:             document.forms[i].appendChild(myElement);
 35:         }
 36:     }
 37: });
 38: //--><!]]></script>
 39:
 40:   <link rel="shortcut icon" href="/lib/tpl/default/images/favicon.ico" />
 41:
 42:   <meta name="verify-v1" content="JGFr2bAbWfSEjoxXebaJ6p8SyjY7IVLq6i5l6hGpHkE=" />
 43: <script type="text/javascript">
 44: var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
 45: document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
 46: </script>
 47: <script type="text/javascript">
 48: var pageTracker = _gat._getTracker("UA-83791-1");
 49: pageTracker._trackPageview();
 50: </script>
 51: </head>
 52:
 53: <body>
 54: <div class="dokuwiki">
 55:
 56:   <div class="stylehead">
 57:
 58:     <div class="header">
 59:       <div class="pagename">
 60:         [[<a href="/dokuwiki?do=backlink"  title="Backlinks">dokuwiki</a>]]
 61:       </div>
 62:       <div class="logo">
 63:         <a href="/"  name="dokuwiki__top" id="dokuwiki__top" accesskey="h" title="[H]">DokuWiki</a>      </div>
 64:
 65:       <div class="clearer"></div>
 66:     </div>
 67:
 68:
 69:     <div class="bar" id="bar__top">
 70:       <div class="bar-left" id="bar__topleft">
 71:         <form class="button btn_source" method="post" action="/dokuwiki"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="" /><input type="submit" value="Show pagesource" class="button" accesskey="Show pagesource v" title="Show pagesource [V]" /></div></form>        <form class="button btn_revs" method="get" action="/dokuwiki"><div class="no"><input type="hidden" name="do" value="revisions" /><input type="submit" value="Old revisions" class="button" accesskey="Old revisions o" title="Old revisions [O]" /></div></form>      </div>
 72:
 73:       <div class="bar-right" id="bar__topright">
 74:         <form class="button btn_recent" method="get" action="/dokuwiki"><div class="no"><input type="hidden" name="do" value="recent" /><input type="submit" value="Recent changes" class="button" accesskey="Recent changes r" title="Recent changes [R]" /></div></form>        <form action="/" accept-charset="utf-8" class="search" id="dw__search"><div class="no"><input type="hidden" name="do" value="search" /><input type="text" id="qsearch__in" accesskey="f" name="id" class="edit" title="[F]" /><input type="submit" value="Search" class="button" title="Search" /><div id="qsearch__out" class="ajax_qsearch JSpopup"></div></div></form>&nbsp;
 75:       </div>
 76:
 77:       <div class="clearer"></div>
 78:     </div>
 79:
 80:         <div class="breadcrumbs">
 81:       <span class="bchead">Trace:</span> <span class="bcsep">&raquo;</span> <span class="curid"><a href="/dokuwiki"  class="breadcrumbs" title="dokuwiki">dokuwiki</a></span>          </div>
 82:
 83:
 84:   </div>
 85:
 86:   <div class="plugin_translation"><span>Translations of this page<sup><a href="/localization" class="wikilink1" title="localization">?</a></sup>:</span> <ul>  <li><div class="li"><span class="curid"><a href="/dokuwiki" class="wikilink1" title="dokuwiki">en</a></span></div></li>  <li><div class="li"><a href="/cs:dokuwiki" class="wikilink1" title="cs:dokuwiki">cs</a></div></li>  <li><div class="li"><a href="/da:dokuwiki" class="wikilink2" title="da:dokuwiki" rel="nofollow">da</a></div></li>  <li><div class="li"><a href="/de:dokuwiki" class="wikilink1" title="de:dokuwiki">de</a></div></li>  <li><div class="li"><a href="/el:dokuwiki" class="wikilink1" title="el:dokuwiki">el</a></div></li>  <li><div class="li"><a href="/es:dokuwiki" class="wikilink1" title="es:dokuwiki">es</a></div></li>  <li><div class="li"><a href="/fr:dokuwiki" class="wikilink1" title="fr:dokuwiki">fr</a></div></li>  <li><div class="li"><a href="/hu:dokuwiki" class="wikilink1" title="hu:dokuwiki">hu</a></div></li>  <li><div class="li"><a href="/it:dokuwiki" class="wikilink1" title="it:dokuwiki">it</a></div></li>  <li><div class="li"><a href="/ja:dokuwiki" class="wikilink1" title="ja:dokuwiki">ja</a></div></li>  <li><div class="li"><a href="/ko:dokuwiki" class="wikilink1" title="ko:dokuwiki">ko</a></div></li>  <li><div class="li"><a href="/nl:dokuwiki" class="wikilink1" title="nl:dokuwiki">nl</a></div></li>  <li><div class="li"><a href="/no:dokuwiki" class="wikilink1" title="no:dokuwiki">no</a></div></li>  <li><div class="li"><a href="/pl:dokuwiki" class="wikilink1" title="pl:dokuwiki">pl</a></div></li>  <li><div class="li"><a href="/ru:dokuwiki" class="wikilink1" title="ru:dokuwiki">ru</a></div></li>  <li><div class="li"><a href="/zh:dokuwiki" class="wikilink1" title="zh:dokuwiki">zh</a></div></li>  <li><div class="li"><a href="/zh-tw:dokuwiki" class="wikilink1" title="zh-tw:dokuwiki">zh-tw</a></div></li></ul></div>
 87:   <div class="page">
 88:     <!-- wikipage start -->
 89:     <!-- TOC START -->
 90: <div class="toc">
 91: <div class="tocheader toctoggle" id="toc__header">Table of Contents</div>
 92: <div id="toc__inside">
 93:
 94: <ul class="toc">
 95: <li class="level1"><div class="li"><span class="li"><a href="#dokuwiki" class="toc">DokuWiki</a></span></div>
 96: <ul class="toc">
 97: <li class="level2"><div class="li"><span class="li"><a href="#download" class="toc">Download</a></span></div></li>
 98: <li class="level2"><div class="li"><span class="li"><a href="#read_more" class="toc">Read More</a></span></div></li>
 99: <li class="level2"><div class="li"><span class="li"><a href="#copyright" class="toc">Copyright</a></span></div></li></ul>
100: </li></ul>
101: </div>
102: </div>
103: <!-- TOC END -->
104:
105:
106:
107: <h1><a name="dokuwiki" id="dokuwiki">DokuWiki</a></h1>
108: <div class="level1">
109:
110: <p>
111:
112: <a href="http://www.dokuwiki.org/wiki%3Adokuwiki" class="media" title="http://www.dokuwiki.org/wiki%3Adokuwiki"><img src="/_media/wiki:dokuwiki-128.png" class="medialeft" align="left" alt="" /></a> DokuWiki is a standards compliant, simple to use <a href="http://en.wikipedia.org/wiki/Wiki" class="interwiki iw_wp" title="http://en.wikipedia.org/wiki/Wiki">Wiki</a>, mainly aimed at creating documentation of any kind. It is targeted at developer teams, workgroups and small companies. It has a simple but powerful <a href="/wiki:syntax" class="wikilink1" title="wiki:syntax">syntax</a> which makes sure the datafiles remain readable outside the Wiki and eases the creation of structured texts. All data is stored in plain text files – no database is required.
113: </p>
114:
115: <p>
116: Read the <a href="http://www.dokuwiki.org/manual" class="interwiki iw_doku" title="http://www.dokuwiki.org/manual">DokuWiki Manual</a> to unleash the full power of DokuWiki.
117: </p>
118:
119: </div>
120:
121: <h2><a name="download" id="download">Download</a></h2>
122: <div class="level2">
123:
124: <p>
125:
126: DokuWiki is available at <a href="http://www.splitbrain.org/go/dokuwiki" class="urlextern" title="http://www.splitbrain.org/go/dokuwiki">http://www.splitbrain.org/go/dokuwiki</a>
127: </p>
128:
129: </div>
130:
131: <h2><a name="read_more" id="read_more">Read More</a></h2>
132: <div class="level2">
133:
134: <p>
135:
136: All documentation and additional information besides the <a href="/syntax" class="wikilink1" title="syntax">syntax description</a> is maintained in the DokuWiki at <a href="http://www.dokuwiki.org/" class="interwiki iw_doku" title="http://www.dokuwiki.org/">www.dokuwiki.org</a>.
137: </p>
138:
139: <p>
140: <strong>About DokuWiki</strong>
141:
142: </p>
143: <ul>
144: <li class="level1"><div class="li"> <a href="http://www.dokuwiki.org/features" class="interwiki iw_doku" title="http://www.dokuwiki.org/features">A feature list</a> <img src="/lib/images/smileys/icon_exclaim.gif" class="middle" alt=":!:" /></div>
145: </li>
146: <li class="level1"><div class="li"> <a href="http://www.dokuwiki.org/users" class="interwiki iw_doku" title="http://www.dokuwiki.org/users">Happy Users</a></div>
147: </li>
148: <li class="level1"><div class="li"> <a href="http://www.dokuwiki.org/press" class="interwiki iw_doku" title="http://www.dokuwiki.org/press">Who wrote about it</a></div>
149: </li>
150: <li class="level1"><div class="li"> <a href="http://www.dokuwiki.org/blogroll" class="interwiki iw_doku" title="http://www.dokuwiki.org/blogroll">What Bloggers think</a></div>
151: </li>
152: <li class="level1"><div class="li"> <a href="http://www.wikimatrix.org/show/DokuWiki" class="urlextern" title="http://www.wikimatrix.org/show/DokuWiki">Compare it with other wiki software</a></div>
153: </li>
154: </ul>
155:
156: <p>
157:
158: <strong>Installing DokuWiki</strong>
159:
160: </p>
161: <ul>
162: <li class="level1"><div class="li"> <a href="http://www.dokuwiki.org/requirements" class="interwiki iw_doku" title="http://www.dokuwiki.org/requirements">System Requirements</a></div>
163: </li>
164: <li class="level1"><div class="li"> <a href="http://www.splitbrain.org/go/dokuwiki" class="urlextern" title="http://www.splitbrain.org/go/dokuwiki">Download DokuWiki</a> <img src="/lib/images/smileys/icon_exclaim.gif" class="middle" alt=":!:" /></div>
165: </li>
166: <li class="level1"><div class="li"> <a href="http://www.dokuwiki.org/changes" class="interwiki iw_doku" title="http://www.dokuwiki.org/changes">Change Log</a></div>
167: </li>
168: <li class="level1"><div class="li"> <a href="http://www.dokuwiki.org/Install" class="interwiki iw_doku" title="http://www.dokuwiki.org/Install">How to install or upgrade</a> <img src="/lib/images/smileys/icon_exclaim.gif" class="middle" alt=":!:" /></div>
169: </li>
170: <li class="level1"><div class="li"> <a href="http://www.dokuwiki.org/config" class="interwiki iw_doku" title="http://www.dokuwiki.org/config">Configuration</a></div>
171: </li>
172: </ul>
173:
174: <p>
175:
176: <strong>Using DokuWiki</strong>
177:
178: </p>
179: <ul>
180: <li class="level1"><div class="li"> <a href="http://www.dokuwiki.org/syntax" class="interwiki iw_doku" title="http://www.dokuwiki.org/syntax">Wiki Syntax</a></div>
181: </li>
182: <li class="level1"><div class="li"> <a href="http://www.dokuwiki.org/manual" class="interwiki iw_doku" title="http://www.dokuwiki.org/manual">The manual</a> <img src="/lib/images/smileys/icon_exclaim.gif" class="middle" alt=":!:" /></div>
183: </li>
184: <li class="level1"><div class="li"> <a href="http://www.dokuwiki.org/FAQ" class="interwiki iw_doku" title="http://www.dokuwiki.org/FAQ">Frequently Asked Questions (FAQ)</a></div>
185: </li>
186: <li class="level1"><div class="li"> <a href="http://www.dokuwiki.org/glossary" class="interwiki iw_doku" title="http://www.dokuwiki.org/glossary">Glossary</a></div>
187: </li>
188: <li class="level1"><div class="li"> <a href="http://search.dokuwiki.org" class="urlextern" title="http://search.dokuwiki.org">Search for DokuWiki help and documentation</a></div>
189: </li>
190: </ul>
191:
192: <p>
193:
194: <strong>Customizing DokuWiki</strong>
195:
196: </p>
197: <ul>
198: <li class="level1"><div class="li"> <a href="http://www.dokuwiki.org/tips" class="interwiki iw_doku" title="http://www.dokuwiki.org/tips">Tips and Tricks</a></div>
199: </li>
200: <li class="level1"><div class="li"> <a href="http://www.dokuwiki.org/Template" class="interwiki iw_doku" title="http://www.dokuwiki.org/Template">How to create and use templates</a></div>
201: </li>
202: <li class="level1"><div class="li"> <a href="http://www.dokuwiki.org/plugins" class="interwiki iw_doku" title="http://www.dokuwiki.org/plugins">Installing plugins</a></div>
203: </li>
204: <li class="level1"><div class="li"> <a href="http://www.dokuwiki.org/development" class="interwiki iw_doku" title="http://www.dokuwiki.org/development">Development Resources</a></div>
205: </li>
206: </ul>
207:
208: <p>
209:
210: <strong>DokuWiki Feedback and Community</strong>
211:
212: </p>
213: <ul>
214: <li class="level1"><div class="li"> <a href="http://www.dokuwiki.org/mailinglist" class="interwiki iw_doku" title="http://www.dokuwiki.org/mailinglist">Join the mailing list</a> <img src="/lib/images/smileys/icon_exclaim.gif" class="middle" alt=":!:" /></div>
215: </li>
216: <li class="level1"><div class="li"> <a href="http://forum.dokuwiki.org" class="urlextern" title="http://forum.dokuwiki.org">Check out the user forum</a></div>
217: </li>
218: <li class="level1"><div class="li"> <a href="http://www.dokuwiki.org/irc" class="interwiki iw_doku" title="http://www.dokuwiki.org/irc">Talk to other users in the IRC channel</a></div>
219: </li>
220: <li