Page Formatting ~ Other Features

Advanced Features

These involve data entry forms, embedded HTML & PHP code, <file> & <code> blocks, RSS feeds, control macros & syntax plugins.

HTML Input Forms

The Bureaucracy Plugin allows HTML forms to be created, with input format validation automatically handled by the plugin. User input can be emailed to a preconfigured address or used to create new pages using a template.
e.g.

New Account
<form>
action mail xyz@xyz.xyz
thanks "Thanks for requesting an account."
fieldset "New Account"
textbox "Full Name"
email "E-Mail Addr" !
textbox "Username"
password "Password"
submit "Apply for Account"
</form>

See the Bureaucracy Plugin documentation for further details.

Embedding HTML Code

You can embed raw HTML code into your documents by using the <html> & </html> tags. HTML embedding is disabled by default, and if so, the code is displayed instead of executed.
e.g.

This is some <span style="color:red;font-size:150%;">inline HTML</span>

<p style="border:2px dashed red;">And this is some block HTML</p>
<html>
This is some <span style="color:red;font-size:150%;">inline HTML</span>
</html>
<HTML>
<p style="border:2px dashed red;">And this is some block HTML</p>
</HTML>

Embedding PHP Code

You can embed raw PHP code into your documents by using the <php> & </php> tags. PHP embedding is disabled by default, and if so, the code is displayed instead of executed.
e.g.

echo 'A logo generated by PHP:'; echo '<img src="' . $_SERVER['PHP_SELF'] . '?=' . php_logo_guid() . '" alt="PHP Logo !" />'; echo '(inline HTML)';

echo '<table class="inline"><tr><td>The same, but inside a block level element:</td>';
echo '<td><img src="' . $_SERVER['PHP_SELF'] . '?=' . php_logo_guid() . '" alt="PHP Logo !" /></td>';
echo '</tr></table>';
<php>
echo 'A logo generated by PHP:';
echo '<img src="' . $_SERVER['PHP_SELF'] . '?=' . php_logo_guid() . '" alt="PHP Logo !" />';
echo '(generated inline HTML)';
</php>
<PHP>
echo '<table class="inline"><tr><td>The same, but inside a block level element:</td>';
echo '<td><img src="' . $_SERVER['PHP_SELF'] . '?=' . php_logo_guid() . '" alt="PHP Logo !" /></td>';
echo '</tr></table>';
</PHP>

Syntax Highlighting

DokuWiki can highlight source code, which makes it easier to read. It uses the GeSHi Generic Syntax Highlighter – so any language supported by GeSHi is supported. The syntax is the same as in the <code> or <file> blocks of other sections, but this time the name of the used language is inserted inside the tag, i.e. <file java> or <code fhf> or <code lua>.
e.g.
<file java>

/** 
 * The HelloWorldApp class implements an application that
 * simply displays "Hello World!" to the standard output.
 */
class HelloWorldApp {
    public static void main(String[] args) {
        System.out.println("Hello World!"); //Display the string.
    }
}

<code fhf>

=Text(
TextIf(GetLabelledText(%INDI._ATTR-TO_DO.NOTE2%,"Birth:")="","","Birth: ") .  
TextIf(GetLabelledText(%INDI._ATTR-TO_DO.NOTE2%,"Baptism:")="","","Baptism: ") . 
TextIf(GetLabelledText(%INDI._ATTR-TO_DO.NOTE2%,"Census:")="","","Census: ") 
)

See Wiki Syntax Highlighting for full details and languages supported.

You can also include expressions inline such as %INDI.BIRT.DATE% by enclosing them in two single quotes on each side e.g. ''%INDI.BIRT.DATE%''

Downloadable Code Blocks

When you use the <code> or <file> syntax as above, you might want to make the shown code available for download as well. You can do this by specifying a file name after language code like this:

<file php myexample.php>
<?php echo "hello world!"; ?>
</file>
myexample.php
<?php echo "hello world!"; ?>

If you don't want any highlighting but want a downloadable file, specify a dash (-) as the language code: <code - myfile.foo>.

RSS/ATOM Feed Aggregation

The DokuWiki {{rss>URL Parameters}} macro can integrate data from external XML feeds. For parsing the XML feeds, 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:

Parameter Description
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 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. 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 DokuWiki to re-render the page if it is more than refresh period since the page was last rendered.
e.g.
The following 5 RSS feeds are generated by the macro code listed below them.

{{rss>http://slashdot.org/index.rss 5 author date 1h}}

Control Macros

Some syntax influences how DokuWiki renders a page, sometimes without creating any output itself. The following control macros may be available depending on the Syntax Plugins Plugins installed:

Macro Syntax Plugin Description
~~NOTOC~~ No table of contents (ToC) will be created.
~~NOCACHE~~ A default output cache isn't always wanted (e.g. when PHP used).
Add this macro to render a page on every call.
~~NOSUBJECTINDEX~~ SubjectIndex Prevent indexing of {{entry>…}} tags in page by the plugin.
~~PAGEINDEX~~ Page-Index List all pages in the current namespace in a bullet list.
~~PAGEINDEX=namespace~~ Page-Index List all pages in the specified namespace in a bullet list.
~~GOTO>pagename~~ GOTO Redirect to a specified pagename after the default 10 secs.
~~GOTO>pagename?15~~ GOTO Redirect to a specified pagename after 15 secs (min 3 secs).
~~INFO:keyword~~ Info Display some DokuWiki information determined by the keyword.
~~CLOUD~~ Cloud Show a cloud of the 50 most frequently used words.
~~CLOUD:99~~ Cloud Show a cloud of the 99 most frequently used words.
~~TAGCLOUD~~ Cloud & Tag Show a cloud of the 50 most frequent category tags.
~~TAGCLOUD:99~~ Cloud & Tag Show a cloud of the 99 most frequent category tags.
{{tag>tag1 tag2 tag3}} Tag Assign a space separated list of category tags to a page.
{{topic>tag #flags}}Tag List all pages containing a category tag according to optional Pagelist Plugin flags.
{{topic>tag1 tag2}} Tag List all pages containing either category tag1 or tag2 or both.
{{topic>tag1 +tag2}} Tag List all pages containing both category tag1 and tag2.
{{topic>tag1 -tag2}} Tag List all pages containing category tag1 but not tag2.
{{alphaindex>namespace}} Alphaindex Create an alphabetical index of all pages in the specified namespace.
{{alphaindex>.#n}} Alphaindex Create an alphabetical index of all pages nested n deep in current namespace.
{{alphaindex>|nons}} Alphaindex Create an alphabetical index of all pages, but no namespace nodes.
{{changes>namespace}} Changes List 10 pages recently changed in the namespace.
See Changes Plugin for details.
{{changes>n&type=create}} Changes List n pages recently changed by create/edit/minor.
Supports Pagelist Plugin.
{{backlinks>.}} fh backlink List all pages that hyper-link to the current page.
{{fhsearch}} fh Extended Search Add the Algolia search to a Page Syntax.
{{fh}} fh Plugin Display custom fh logo.
{{page>page&flags}} Include Include text of another page. See Include Plugin for details.
{{namespace>namespace}} Include Include text of whole namespace optionally governed by flags.
{{tagtopic>tags&flags}} Include Include text of pages with topic tags optionally governed by flags.
{{NEWPAGE>namespace}} New page Create a new page where >namespace is optional.
{{pushfile>filepath}} Pushfile Download a file where filepath is the namespace & file as explained in Download Links.
{{pushfile>filepath|filename}}Pushfile Download a file where filename replaces the filename part of the filepath.
{{entry>sect;head;text*}}SubjectIndex Create a new index entry for this page.
{{subjectindex>options}} SubjectIndex Add a subject index list on this page.
{{videosite>id}} Video Sharing Link to a video with id at a videosite such as http://www.youtube.com.
{{youtube>id}} Video Sharing Link to a video with 11-character share id from YouTube.
{{youtube>id?size}} Video Sharing Link to YouTube where size is widthxheight or keyword small, medium, or large.
{{youtube>id?size|title}} Video Sharing Link to YouTube with a title and left, centre, right aligned as Image Files.

Syntax Plugins

DokuWiki's syntax can be extended by 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: