Table of Contents

Block Quote Plugin

The blockquote plugin creates semantically correct quotes by using the blockquote XHTML tag. In contrast to the default wiki markup for quoting, the content of the quote can contain any wiki markup which then gets interpreted as it would outside of the quote environment. Thus, also nested quotes are possible.

Syntax

The plugin provides two additional pairs of markup tags, the blockquote and the cite markup. The blockquote allows an additional citation source to be given after the blockquote keyword in the opening tag. The cite markup was mainly created to allow the addition of more complex citation sources (including links, text formatting etc) inside the blockquote environment, although it can also be used standalone. See the examples below.

Examples

Loads of markup

The following code

<blockquote>
Test with loads of markup...

Another paragraph with a little [[http://nowhere|link]] to nowhere. Oh, and while we are at it, what about some **bold**, some //italic// and some __underlined__ text? And finally, an itemization:

  * item 1
    * item 1.1
    * item 1.2
  * item 2
    - ordered item 2.1
    - ordered item 2.2
      - ordered item 2.2.1
  * item 3

Works :-)
</blockquote>

results in

Test with loads of markup…

Another paragraph with a little link to nowhere. Oh, and while we are at it, what about some bold, some italic and some underlined text? And finally, an itemization:

  • item 1
    • item 1.1
    • item 1.2
  • item 2
    1. ordered item 2.1
    2. ordered item 2.2
      1. ordered item 2.2.1
  • item 3

Works :-)

The cite attribute

The following code

<blockquote J. Random Hacker>Test with a cite attribute...</blockquote>

results in

Test with a cite attribute…

The cite command

The following code

<blockquote>Test with a cite command...<cite>J. Random Hacker, [[http://localhost/~jrhacker]]</cite></blockquote>

results in

Test with a cite command…J. Random Hacker, http://localhost/~jrhacker

· 2012/07/16 17:45 · Alan Shea

BookCreator Plugin

The bookcreator plugin allow to select some pages from wiki and export to create a little book PDF or text (like a similar function of Wikipedia)

The component for syntax, displays the list of pages selected for exporting and manage selections; the component for action, handle the selection by a add/removing pages, show a toolbar (like a similar toolbar of Wikipedia).

On the list of selected pages, You can use drag and drop to change the order, save your selection for restore in a second time or share with other users.

To work, this plugin needs cookies; the PDF export required dw2pdf plugin; the TEXT ONLY export required text plugin.

Usage

To use this plugin, use these two simple ways:

~~BOOK~~

or

~~ARCHIVEBOOK:number&sort~~

in the page 'wiki:ebook' (create it first).

With ~~BOOK~~ You can show and manage your list of selected pages

  • Reset all selection
  • Exclude a page from list
  • View the excluded pages and “include” them back
  • Create the PDF book on selected pages
  • Create a printable version of selected pages
  • Extract only text of selected pages
  • Drag and drop to change exporting order of page (use Tool-Man JavaScript library )
  • Set a title for the PDF document
  • Save and restore selections on a specific namespace (use ACL's rights)


With ~~ARCHIVEBOOK:number&sort~~ You can show a list of saved selections (books) anywhere into your wiki

  • Restore a selection to manage/export again
  • sort by date/title
  • show only first number selections

Optionally you can specify the number of selections to display and the order. Default is 10 items ordered by date (first last updated). Each of selection is linked to book's page for it.

Installation

To add or remove a page to selection, you simply need to call the page passing it a “do=addtobook” PHP argument. The easiest way to implement this is to add a button or similar somewhere in your template design.

Default template

Use the following to add another button in the upper or bottom button row of the default template1)

· 2012/07/16 17:48 · Alan Shea

Box Plugin

Highlight particularly important parts of your wiki in boxes that stand out with Box Plugin.

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


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.

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

Box Plugin Examples

testing

a title

the box contents

'let us start a quote and not finish it.

Boxed & titled

this isn't also boxed

using hex colours

lorem ipsum dolor …

using rgb colours

lorem ipsum dolor …


This is a test of the box using named color rgb colors and I want a border but don't know how to add one. There, it's done… but what colors are available?

Oh, I see now (I read the docs) and everything is ok.

The bottom credits goes here (if only I could align this right)


this is also boxed

boxed & captioned

as is this

title with formatting, a link and rounded corners :-)

boxes can also contain markup…
  • a list
  • of several
  • items
<div class='box'>
  <b class='xtop'><b class='xb1'></b><b class='xb2'></b><b class='xb3'></b><b class='xb4'></b></b>
  <div class='xbox'>
    <p class='box_title'>Title text would go here</p>
    <div class='box_content'>
      <p>Including this html snippet of a box</p>
      <p>All those &lt;b&gt; tags handle the rounded corners</p>
    </div>
  </div>
  <b class='xbottom'><b class='xb4'></b><b class='xb3'></b><b class='xb2'></b><b class='xb1'></b></b>
</div>

=== headings aren't allowed in boxes ===

but tables are

and plugins … ; definition : list : list : list

and a link

Wow, a lot of stuff

title

a box to match the default dokuwiki colour scheme

Example box

to test what is possible: NICE PLUGIN: You can
  • make Lists
  • other markup
  • set the color of the box

looks good?

title

red box, 80% wide, with a title
this is a blue box
this is a blue box

title

blue box with a title

title

a wide green box
and an orange box

title teste

testing

title test

testing

title teste

testing

title test

testing

Is the colour wrong?

this is also boxed

title test

testing 123456 gagagaga gaggagagaga gaagagagag agagagag agaga gaagagaga gagagagag agagaggag agagaga gag agag

Simple box with rounded edges and title

I wonder what uses I could find for a box…
  • I will have to check this out
  • tomorrow
  • on my wiki
But can there be a box inside of a box?

Yes! there can!

Simple box with rounded edges and no title But with some “code”, not really code, but just code layout
  * I will have to check this out
  * tomorrow
  * on my wiki
Same thing on the right handside But with some “code”, not really code, but just code layout
  * I will have to check this out
  * tomorrow
  * on my wiki

Headline

This is a right-hand side box with a picture and caption.


Boxes in boxes works but will create another line per box, an inline option would be nice.

This is the parent

this is a child

Child Box

this is another child

Another child that i would like inlined with one before

This is the parent

this is a child

Child Box

this is a nested child

Another child that i would like inlined with one before
· 2012/07/16 17:50 · Alan Shea

BTable Plugin

This plugin can help your team to schedule meetings or making other decisions in a team. The syntax looks like this:

<btable [id]>
  <columns>
    ^ [column] ^ [column] ^ ... ^
  </columns>
  <rows>
    ^ [row] ^ [row] ^ ... ^
  </rows>
</btable>

That means, you can simply put a <btable> tag on the page and gets a fully selectable boolean table with export functionality.

[id] the ID of the btable; must be unique2); appears as title required
[column] an option for which users can tick a checkbox whether it's 'true' or not ('false') required
[row] an option which users can select from a combobox to insert boolean values for it required

<btable Test>

<columns>
  Person A ^ Person B ^ Person C ^ Person D ^ Person E
</columns>
<rows>
  10-10-2007 ^ 17-10-2007 ^ 24-10-2007
</rows>

</btable>

<btable Test Double>

<columns>
  Person A ^ Person B ^ Person C ^ Person D ^ Person E
</columns>
<rows>
  10-10-2007 ^ 17-10-2007 ^ 24-10-2007
</rows>

</btable>

· 2012/07/16 17:51 · Alan Shea

Bureaucracy Plugin

The bureaucracy plugin allows you to create an HTML form right within DokuWiki. Input format validation is automatically handled by the plugin and requires no coding. User input can be emailed to a preconfigured address or used to create new pages using a template.

On an open wiki, you might want to use the CAPTCHA plugin to avoid automated spam. When it is installed, Bureaucracy automatically integrates the captcha check in its form submission handling.

The SMTP plugin may help when your DokuWiki can't send mails.

When you use Bureaucracy's template action, you can add in the template a dataentry of the Data plugin that structures and stores your information for good accessibility, whereas the dataentry you can use placeholders of bureaucracy to place information from the form.

The recent Struct plugin draws heavy inspiration from the data plugin and allows for central management of wanted structured data while keeping the functionality of the data plugin. The struct plugin supports integration with the Bureaucracy Plugin. This allows reusing the input mechanisms of the different types in Bureaucracy forms and creation of structured data when pages are created through Bureaucracy's template action.

Additional Actions

An additional plugin to look at is pagemod, which adds a pagemod action for the Bureaucracy plugin to add data to an existing page (in addition to the current templating and mailing functionality)

Additional Fields

The Data plugin can not only be useful in templates as mentioned above, but it also provides a data_aliastextbox field that lets you create fields with types and type aliases of the data plugin. Some of these types have a nice layout e.g. pagesuggestions or listing using predefined options from type aliases. See example.

With Struct plugin, you can use any field from any defined schema as a field in a bureaucracy form. You can also add a whole schema to the form.

Warning

Without the CAPTCHA, this plugin should only be used on closed wikis, because it could easily be abused as a spam gateway.

Usage

Let's start with an example:

A sample form with validation errors

<form>
Action mail me@example.com
Thanks "Thanks for submitting your valuable data."

Fieldset "A set of fields"
Textbox  "Employee Name" "=Your Name"
number "Your Age" >13 <99
email "Your E-Mail Address"
textbox "Occupation (optional)" !
password "Some password"

fieldset "even more fields"
select "Please select an option" "Peaches|Apples|Oranges"
static "Some static text that could be an agreement"
yesno "Read the agreement?"
textarea "Tell me about your self"
textbox "You need to write 'agree' here" /^agree$/
submit "Submit Query"
</form>

As you can see, you can define a email address where the data should be sent to and a thank you text to be shown when a user submitted the form. What follows are the various fields to fill in.

Field definitions

  • Fields are defined by giving a type and a label.
    • For fieldsets and the submit button, the label is optional.
  • Some fields, like the select type, need a third parameter.
  • Additional constraints can be added after the main options.
  • Arguments need to be wrapped in double quotes when they contain spaces e.g. "S p a c e s"
  • Including a " by using "" e.g. "With ""quotes"" in the string"

The plugin takes care of validating the form, the field types, and set constraints.

Fields

  • action
    • The first parameter needs to be a supported action (see below).
      Currently supported are mail, template, script.
      Or if respective plugin is installed: pagemod or struct_lookup.
    • Additional parameters for type mail:
      • one or more email addresses to send the data to (required)
    • Additional parameters for type template:
      • name of a page or namespace (trailing colon) to use as template or a single underscore _ to try and use the target namespace template (use an absolute path) (required)
      • namespace:prefix or namespace: (mind the trailing colon) where new pages shall be created (optional)
      • separator to use when combining multiple fields into the pagename (optional)
    • Additional parameters for type script:
      • the name of the script-file in the conf/plugin/bureaucracy/ directory
    • Multiple actions can be defined by adding another action field
  • thanks
    • define a text to be displayed when the form was submitted. (optional)
  • fieldset
    • creates a new set of fields
    • a label is optional
    • Can be shown/hidden depending on the value of another field above it (see below)
      • Switching depends on the field given as second parameter (optional)
      • Fieldset is displayed as that field is set
        or has an exact match with the value given as third parameter (optional)
  • static
    • adds some static text to the form
  • wiki
    • similar to static, but parses the input as Wiki syntax
    • should be used sparsely as it is computationally expensive
  • textbox
    • creates a single line input field
    • needs a label
  • password
    • creates a single line password input field
    • needs a label
  • email
    • creates a single line input field
    • needs a label
    • the input is validated to be a valid email address
    • argument @@ marks emailadress as Reply-To address for mail action
    • creates a single line input field
    • needs a label
    • the input is validated to be numeric
    • can be pre-filled with auto-incrementing number, see example.
  • textarea
    • creates a multi-line input field
    • needs a label
    • to change the default size of 10 rows to N rows, use the argument xN ( x23 ) (optional)
    • creates a checkbox
    • needs a label
    • needs default values for yes and no ( "=true value" "!false value" ). If only used for a fieldset the default values are not required.
  • select
    • creates a dropdown list
    • needs a label
    • needs a second argument containing the select options separated by a pipe | char
      ( "Peaches|Apples|Oranges" )
  • multiselect
    • you can select multiple values
    • needs a label
    • needs a second argument containing the select options separated by a pipe | char
      ( "Peaches|Apples|Oranges" )
    • example: multiselect “Label” “Opt1|Opt2|Opt3” =Opt1,Opt3
    • In mail action: all options will be joined by “, ” in e-mail message
    • In template action:
      • if field is marked with “@” all selected options will be joined with page separator
      • during template substitution all options will be joined by “, ” or you can provide optional separator: @@Label(separator)@@
  • radio
    • creates a set of radiobuttons
    • needs a label
    • needs a second argument containing the radio options separated by a pipe | char
      ( "Peaches|Apples|Oranges" )
  • hidden
    • creates an invisible field with static data
    • needs a label
    • needs a default value parameter ( "=some value" )
  • hiddenautoinc
    • needs a label
    • creates an invisible field with a number that increases by 1 on each form submit
  • submit
    • creates a submit button (required)
    • a button label is optional
  • user / users
    • a DokuWiki user or list of DokuWiki users
    • needs a label
    • provides autocompletion
  • date
    • a date in the format YYYY-MM-DD
    • needs a label
    • provides a date picker
  • time
    • a time in the format (H)H:MM(:SS)
    • needs a label
  • usemailtemplate template_id
    • the content of the <code html>..</code> and <code text>..</code> at the template page is used in the email of the mail action, instead of default table with field values.
    • template_id is absolute or relative pageid. If relative, it is solved against the pageid of the form
  • addpage page_tpl page_tgt
    • adds another page page_tgt based on a template page page_tpl
    • only for use with the template action
    • if page_tpl is absolute or relative pageid. If relative, it is solved against the pageid of the form
    • page_tgt is relative to destination of page created by action field. e.g. action field tries to create new:destination, then addpage will try to add new:destination:page_tgt
    • When in the action field a ! is given as template, that template is skipped and only template(s) added by addpage are used.
  • labels
    • parameter is a wiki page containing a list of label translations
  • file
    • let user select a file for upload (which is added to media by template action, or added as attachment in mail action)
    • needs a label
    • an optional addition parameter specifies the namespace to which the upload should go to. . and .. can be used to reference namespaces relative to the new page. Defaults to .
  • data_aliastextbox (needs plugin)
    • requires Data plugin to display the field (See example)
    • needs a label
    • an additional parameter is starting by underscore _ for type of field, using dataplugin type syntax
      • datatypes with a type alias that defines 'valid values' will appear as a (multi)select field
      • otherwise it appears as usual textbox, sometimes with added features as datepicker and pagesuggestions
  • struct_field + struct_fieldhidden (needs plugin)
  • struct_schema (needs plugin)

Constraints and Defaults

  • Start with a > followed by a number to require numeric data bigger than the given number
  • Start with a < followed by a number to require numeric data smaller than the given number
  • Start with a = to set a default value, you can also use placeholders here
  • Use a single ! char to make a field optional
  • Use a single ^ char to give a field the focus (possible for only one field at a page)
  • Use a single @ char to make its value be used for the pagename in template mode (the value will be appended to the pagename, separated by an underscore)
  • Use a double @@ to mark the value of a field as Reply-To address for mail mode
  • Use a number of 0000 for a number field, for completing inputted values with leading zeros upto the same length
  • Use a ++ for a number field to make it auto-increment the counter on each form submit.
  • Enclose a regular expression with / chars to require the the regexp to match before the field is accepted (case insensitive). Examples (for additional information see below):
    • /^[^\/:]+$/ nice for pagenames, the chars / and : aren't allowed
    • /^[0-9 \/()+\-]+$/ nice for phone numbers, allows only numbers and the chars ()-+/
  • Set message for if regular expressions don't match by using **Message. Example:
    • textbox "Your pagename" /^[^\/:]+$/ "**Don't use / or : in your page name"
  • Only for dataplugin field: start with a _ to define type alias.

A simple guide to Regular Expressions

A regular expression is used to define a pattern of text. In its simplest case (as used here) if the pattern can be found then the text is accepted, if the test fails then the text is rejected. Under bureaucracy, when the submit button is pushed text boxes are compared to their regular expressions. If the test passes, then submit can continue, if the test fails then submit rejects the form and asks for a correction.

The simplest possible regular expression (regex) is a single character: /a/. This states that the input text (the string) must contain somewhere within it the letter “a”. “access” would pass, as would “backups” but “Hello World” would fail.

The regex may contain a number of characters: /abc/ which requires that the string “abc” be found somewhere. “Learn your abc” passes but “a bc” fails (there is a space between the “a” and “b”).

Frequently you want to select one of a number of characters. Square brackets group a number of alternatives together: /[abc]/ means that either “a” or “b” or “c” must occur somewhere within the string. Ranges are possible, [a-z] means any lowercase letter. Putting things together, /rfc[0-9][0-9][0-9][0-9]/ matches any four digit request for comments such as “rfc0248” or “rfc4027”.

The brackets are called meta-characters, that is they don't represent real characters (like for instance “a”) but do affect how the string is interpreted. There are a number of meta-characters the most important of which are:

  • “^” which matches the start of a string.
  • “$” which matches the end of a string.
  • “*” which means that the character before it may appear 0 or more times.
  • “+” which means that the character before it must appear 1 or more times.
  • “\” means treat the next character as an ordinary character, not a meta-character.

For example /^[yn]$/ means that the string must start with a “y” or and “n” and have no characters following. “y” and “n” are therefore the only possible strings. /^I[0-9]+$/ matches US interstate roads: “I12”, “I66” and so forth. Somewhat confusingly “^” has another meaning when it occurs immediately after a left bracket, it negates the contents. /[^ab]/ matches any character other than and “a” or “b”.

Looking now at the examples above. /^[^\/:]+$/ starts at the beginning of the string (“^”) accepts any character other than “/” or “:” (“[^\/:]”, note the “\” to make the “/” into a normal slash), accepts these characters 1 or more times (“+”) and then needs to see the end of the string “$”. “/home/doc.txt” fails, there are slashes present. “ puzzled ” is acceptable.

Finally /^[0-9 \/()+\-]+$/. The whole string consists of a one or more characters (“^” to “+$”). These characters must be (“[” to “]”) numbers (“0-9”), spaces (“ ”), slashes and parenthesis (“\/” and “()”), pluses and minuses (“+\-”).

For more information:

External Label Names

By default all labels are used as provided. Eg. they are displayed in the form and they are used as placeholders for the template mode. In some cases you might want to use simpler names for the fields but still have more extensive labels displayed in the form.

This can be achieved with defining label translations in a separate wiki page and give this page in the labels field:

<form>
action mail me@example.com
labels mylabels

fieldset "field"
textbox  "name"
number   "age" >13 <99
submit   "submit"
</form>

The translation page needs to contain a single wiki list with items named label = translation:

  * field  = Tell us about yourself"
  * name   = Your Name
  * age    = Your Age
  * submit = Send your Data

The above would result in the following form:

Note: double slashes // cannot be used in the translation field on the translation page — http://forum.dokuwiki.org/u/SFITCS 2016-12-15 22:27

Dependencies with Fieldsets

Sometimes part of a form should only be asked when a certain answer was picked for a previous question. Simple dependencies like that can be created by using Fieldsets.

Consider the following example:

<form>
action    mail me@example.com

fieldset  "Your Order"
textbox   "Your Name"
select    "What do you want"  "Car|Blimp"

fieldset  "Car Parameters" "What do you want" "Car"
number    "Number of Wheels"
textbox   "Extras"

fieldset  "Blimp Parameters" "What do you want" "Blimp"
select    "Filling" "Helium|Hot Air"
number    "Size"

fieldset  "Payment"
yesno     "Can you pay right now?"

fieldset  "Details" "Can you pay right now?"
textbox   "Name"
number    "Amount"

fieldset  "Confirm Order"
submit "Submit Query"
</form>

In this example, a user can select to order a car or a blimp. Depending on his choice, the second or third fieldset will be hidden or shown accordingly. The second parameter for the fieldset field references a previously defined field and the third parameter the value that field shall have to display the fieldset. Only exact matches are supported here, so best combine this feature with a select field as shown above.

When the user marks the checkbox of the yesno field in the fourth fieldset the fifth fieldset is shown, so the correct details can be noted. Here is no third parameter given to the fieldset, because it will check if the referred yesno field is set (It will not look for the default values eventually set by “=Value” “!Not Value”. If you need the value of the yesno in a template, you have to provide the default values explicitly.).

NOTE:

  • Apparently dependencies don't work when the choice is provided by “radio” (only “select” and “yesno” work) for some reason. There might by a logical explanation for this, maybe.

Dependencies with Fieldsets - creating two levels of selects

How to use dependencies to adapt a select list. Example:

First level “select” list

select "Vehicule" "Car|Motorbike"

Second level “select” lists:

fieldset  "Car spareparts" "Vehicule" "Car"
select "Sparepart1" "4 wheels|steering wheel"

and

fieldset  "Motorbike spareparts" "Vehicule" "Motorbike"
select "Sparepart2" "3 wheels|handle bar"

To show only the shown value of both select fields “Sparepart1” and “Sparepart2” in a template, use the construct

@@Sparepart1|@@@@Sparepart2|@@

The chosen one will be filled out and the not chosen one will be replaced by an empty string (“”).

Sometimes you may want to link to a bureaucracy form and pre-fill one or more fields. This can be easily achieved by adding parameters to your link using @-wrapped field names.

Imagining the form given in the previous section is on a page called orderform. Here is how you could link to a form for ordering Hot Air blimps:

[[orderform?@What do you want@=Blimp&@Filling@=Hot Air|Order a Hot Air Blimp!]]

Action Modes

Bureaucracy does three things:

  1. it displays a neat form
  2. it validates user input
  3. it sends the user's input to an action mode

The last step is where the data is processed. The action to use is defined in the action field, as described above. Currently three modes are supported: mail, template, and script. Additional modes (e.g. to store the data in a database) can easily be added.

Mail Mode

This is a simple action. When used default, all user input will be sent by email to the configured email address. See the example above how to use it. You may specify multiple recipient mail addresses separated by commas.

Example to automate email to an address which the user enters:

Fieldset "Some Information"
Textbox "Employee Name"
email Email_Address
 
 
Action mail @@email_address@@
  • If you add the field usemailtemplate you can define alternative content for the email. The template should contain two code blocks with text and html version of the message. Other text on the page is ignored. In the template you can use placeholders.
  • With the subject field you can replace the default subject
  • and by marking field(s) with the option @@ you add Reply-To address(es) to the mail.

Example:

action mail @MAIL@ forename@surname.name 
usemailtemplate your:template
subject "new special subject"
your:template
======Mail template page======

<code html>
Dear @@Your Name@@,

You are <b>great<b>, you just <i>purchased</i> our @@What do you want@@!

We will deliver it fast as possible, see the 
<a href="http://example.com/conditions">conditions</a>.

Kind regards,
Future Machines company
</code>

<code text>
Dear @@Your Name@@,

You are great, you just purchased our @@What do you want@@!

We will deliver it fast as possible, see [1].

Kind regards,
Future Machines company

[1] http://example.com/conditions
</code>

Template Mode

This action uses given pages as template, will replace defined placeholders with the user input and create wiki pages. This is a very powerful, but somewhat complex concept.

The action line looks as follows:

action template [template] [destination] [separator]
  • template is
    • either a single page,
    • or a whole namespace (with trailing colon). When a namespace is given, all contained sub namespaces and pages will be copied to the destination and replacement patterns will be applied in all pages.
    • when you specify an underscore (_) as template name, the plugin will attempt to use the configured namespace template of the destination namespace.
    • and ! skips this template, but requires at least one via the addpage field
  • destination tells bureaucracy where to create the new page[s]. This is usually a namespace (trailing colon). See section below for more detail.
  • separator new page names can be created by using multiple form field values. This character defines how these should be concatenated (see method 1 of section below)

Defining the destination(s)

When using the template mode you need to define where resulting pages should be created. There are multiple ways to do this.

Method 1 The simplest way is to specify an output namespace and mark up your naming fields using the @ character. Here's an example:

<form>
action   template userstpl users: :

fieldset "Create Your User Page"
select   "What's your Continent?" "Europe|N. America|S. America|Asia|Australia|Africa" @
textbox  "What's your Name?" @
textarea "Enter a short bio" !
submit
</form>

This would create a new page using the continent and name fields. Eg. if I fill in “Europe” and “Andi” for those fields, the resulting page would be users:europe:andi.

Method 2 Sometimes you want some more control over the resulting pagename(s). This can be achieved by using placeholders in the destination parameter and omitting the @ marker in the field definitions.

Placeholders are the field names surrounded by @@ characters. Additionally any strftime parameters can be used. Let's have another example:

<form>
action   template userstpl "users:%Y:@@What's your Name?@@:start"

fieldset "Create Your User Page"
select   "What's your Continent?" "Europe|N. America|S. America|Asia|Australia"
textbox  "What's your Name?"
textarea "Enter a short bio" !
yesno    "Do have publication?"

fieldset "Add your publications" "Do have publication?"
textarea "Publications:"
addpage   users:publicationtemplate publications

fieldset "Finish"
submit
</form>

The above would create a namespace based on the current year and my name and create a start page within it: users:2012:andi:start

Method 3 When working with Dependencies with Fieldsets you might want to add additional pages when a fieldset is shown, but skip the page when the fieldset is hidden. This can be achieved with the special addpage field.

Just put it in the fieldset of question:

addpage additionaltpl somepage

The second fieldset from the example above adds a publication page, via a checkbox. Here the template for additional page is located on absolute path: users:publicationtemplate. Only when the yesno field is checked, the additional page is created on users:2012:andy:start:publications

Creating Templates

The templates need to contain the same fields as your form, and some other placeholders are available too. Some of them can be used as default values for form fields:

Placeholder action
@@Field label@@
##Field label##
Will be replaced by the actual values the user filled into
the form.
@curNS(arg)@
@getNS(arg)@
@noNS(arg)@
@p_get_first_heading(arg)@
Will be replaced with a result of the corresponding dokuwiki function. arg can be both a static value, eg. @curNS(some:test:value)@ or the placeholder of a field, eg. @p_get_first_heading(@@field@@)@.
@@Field label|Nice alternative@@ For empty field the text Nice alternative is shown
@NSBASE@ (only template action) Namespace that contains new page.
eg. if the new page is foo:bar:baz:bang, @NSBASE@ will contain baz
%Y %F %a %Y-%m-%d %s… etc strftime parameters to refer to current time
%% Replaced by % char, needed to avoid accidental time
replacements in your template.
@DATE(<datetime>,%%Y-%%m-%%e)@
@DATE(<datetime>)@
Accepts different datetime formats, which are outputted in the
requested strftime format. Providing no format returns date
with format of the config:dformat setting.
@ID@ @USER@ @MAIL@ … etc DokuWiki replacement patterns for templates are available too
@FORMPAGE_ID@ @FORMPAGE_NS@ @FORMPAGE_CURNS@ … etc Works like replacement patterns but refers to the page with the form
@YEAR@, @MONTH@, @DAY@, @TIME@, @TIMESEC@ Print current: year, month, day, time as hh:mm
and time as hh:mm:ss
@TABLEHTML@, @TABLETEXT@ (only mail action) html or text table of all field values
<noinclude>…</noinclude> Tags with their content are removed
<noreplace>…</noreplace> The content between <noreplace>…</noreplace> is preserved without performing any replacements but tags itself are removed.
@LANG@ Languagecode as configured
@TRANS@ Languagecode obtained from page id of form

For the userstpl from the example above, you could have the following page:

====== @@What's your Name?@@ ======

I'm living in @@What's your Continent?@@. I'm a user since %Y-%m-%d.

@@Enter a short bio|FIXME please fill in your biography@@

The result then would look somewhat like this with all the user data filled in:

====== Andreas Gohr ======

I'm living in Europe. I'm a user since 2007-12-23.

It's me :-)

ACL Checking & runas Option

By default this plugin will check for ACLs in template mode using the permissions of the user filling the form. This means the user needs to have at least read permissions for the template and create permissions for the namespace where the new page should be saved.

However sometimes you may want to give anonymous users a way to create pages in a restricted namespace without giving them any direct access. This is where the runas option comes into play. With this option you can specify a username in the config manager. The user you specify here will always be used for checking the permissions mentioned above, regardless of the user filling the form. This way you can specify the needed access for this particular virtual user in the ACL manager.

Note: the runas user does not need to exist. In fact it is recommended to use a non existing user. Even when it exists, permission checks are done on user level only, groups of the user will be ignored.

Accessing user field infos

When using a user or users field, additional data of the selected users can be used in the template:

  • '@@user.name@@' replaced by user full name
  • '@@user.mail@@' replaced by user e-mail address
  • '@@user.grps@@' replaced by user grps, comma separated
  • '@@user.grps(separator)@@' replaced by user groups, separated by 'separator'
  • '@@users(separator)@@' - replaced by list of user's nicks, separated by 'separator'
  • '@@users(separator).name' - replaced by list of user's full names, separated by 'separator'
  • '@@users(separator).mail' - replaced by list of user's emails, separated by 'separator'
  • separator may be omitted then the comma is used as a separator. Eg. @@users.mail@@, @@users.name@@
  • @@users.grps@@ is not supported

Script Mode

This action gives the data to a PHP script supplied by the administrator. The script then can do whatever it wants with the data.

The script must be placed in conf/plugin/bureaucracy/ directory. It must contain one class that is named helper_plugin_bureaucracy_handler_scriptname and implements the interface dokuwiki\plugin\bureaucracy\interfaces\bureaucracy_handler_interface

That means the class has to have the handleData($fields, $thanks) method with the fields and the thanks-message as parameters. It returns a thanks-message on success or false on error.

Example

This is a simple script handler that will just print the form's arguments in DokuWiki's debug log.

<form>
action script example.php
textbox "Type something"
submit "Write to log"
</form>
conf/plugin/bureaucracy/example.php
<?php
use dokuwiki\plugin\bureaucracy\interfaces\bureaucracy_handler_interface;
 
class helper_plugin_bureaucracy_handler_example implements bureaucracy_handler_interface {
 
    /**
     * Log the form fields to DokuWiki's debug log
     */
    public function handleData($fields, $thanks)
    {
        dbglog($fields, __FILE__ . ': ' . __LINE__);
        dbglog($thanks, __FILE__ . ': ' . __LINE__);
 
        return $thanks;
    }
}

Examples

Checkbox field

Example code for checkbox field:

yesno     "Are you happy?" "=Yes sir" "!No sir"

yesno     "Show fieldset?"
fieldset  "Shown on checking the box" "Show fieldset?"
textbox   "Share your praise"
  • The checkbox returns the default value Yes sir for checking the field, and No sir for unchecking. Leaving out default value(s) does result in no return value.
  • When a fieldset refers to a yesno field, no third argument is needed, instead it checks if the yesno is set. No default values are required for yesno where the fieldset depends on, unless you like a return value to your mail or template from that yesno field of course.

Number field

number "One"
number "Two" ++
number "Third" >3 <40
hiddenautoinc "Four (notice: conflicts with Two)"
number "Fifth" 000
number "Sixth" ++ 000
  • One Number field accepts only numbers
  • Two Number field it remembers the last number and increment it with one, you can change it
  • Third Number field accept any number between 3 and 40
  • Fourth Number field is hidden, and increment every time a form is saved. (At the moment this field conflict with an autoincrementing number field. So don't combine in one form.)
  • Fifth Number field returns values which are completed with leading zeros. Input of 23 will be returned as 023.
  • Sixth Number is a combination of Two and Fifth

Development

Adding a new field type

To add a new type, you need to implement a Helper Plugin inheriting from helper_plugin_bureaucracy_field. There you probably want to overwrite the renderfield() method and probably some other methods as well. Your field will automatically be available as type <plugin>_<component>. Eg. lib/plugins/foo/helper/bang.php creates a new type foo_bang.

If you need more control over adding one or more fields, you can implement an Action Plugin hooking to PLUGIN_BUREAUCRACY_FIELD_UNKNOWN. This event only has a BEFORE event and provides the following data:

$data = array(
   'fields' => &array(), // the fields initialized so far - add yours here
   'args' => array() // the tokenized line, args[0] should be your plugin
);

In your handler you need to check that args[0] is the field type you want to register. If it is, you need to call preventDefault() and add your own field(s) to the fields array. The added field has to be a descendant of helper_plugin_bureaucracy_field!

Adding a new action

To add a new action create a new Helper Plugin inheriting from helper_plugin_bureaucracy_action. This works similar to adding a new field described above.

Theres is also an Event you can hook called PLUGIN_BUREAUCRACY_ACTION_UNKNOWN. Again, there's only a preventable BEFORE event.

FIXME describe passed data in detail. For now check the source.

Influence Template mode

Saving the final page in template mode triggers an event called PLUGIN_BUREAUCRACY_TEMPLATE_SAVE. In the before mode you can prevent saving the page or modify it's content. The after event is triggered after a page has been created.

Passed data:

$data = array(
  'patterns' => &array(), // list of PREG patterns to be replaced
  'values' => &array(), // values for the above patterns
  'id' => string, // ID of the page being written
  'template' => &string, // the loaded template text
  'form' => string, // the page the bureaucracy form was on
  'fields' => helper_plugin_bureaucracy_field[], // all the fields of the form
);

Hook into email action

The event PLUGIN_BUREAUCRACY_EMAIL_SEND gives developers of other plugins access to the submitted form data before it is actually sent in the actionmail.php.

This makes it easier to provide custom fields in bureaucracy emails.

The event data includes the form fields info and all the values, so they can be processed by third-party plugins:

$evdata = [
    'fields' => $fields,
    'values' => &$this->values
];

Customisations

Important! These are hacks - there is no guarantee they'll always work, and they will not survive updates.

If it breaks you get to keep the pieces. :-)

Customise the Date Format

NOTE: The configuration setting for the PHP strftime function in /conf/dokuwiki.php also need to be changed (can also be changed via Admin→Configuration)

$conf['dformat']     = '%d/%m/%Y %H:%M';

To change the default date format from yy-mm-dd to dd-mm-yy (e.g. for Australia)

Change the jQuery datepicker format /plugins/bureaucracy/script/datepicker.js from:-

/**
 * Init datepicker for all date fields
 */
 
jQuery(function(){
    jQuery('.bureaucracy__plugin .datepicker').datepicker({
        dateFormat: "yy-mm-dd",
        changeMonth: true,
        changeYear: true
    });
});

to this:-

/**
 * Init datepicker for all date fields
 */
 
jQuery(function(){
    jQuery('.bureaucracy__plugin .datepicker').datepicker({
        dateFormat: "dd-mm-yy",
        changeMonth: true,
        changeYear: true
    });
});

Change the Bureaucracy error message in /bureaucracy/lang/en/lang.php from:-

$lang['e_date']          = '"%s" needs to be a valid date in the format yyyy-mm-dd.';

to this:-

$lang['e_date']          = '"%s" needs to be a valid date in the format dd-mm-yyyy.';

Change the Bureaucracy date validation in /bureaucracy/helper/fielddate.php from:-

     * Validate field input
     *
     * @throws Exception when empty or wrong date format
     */
    protected function _validate() {
        parent::_validate();
 
        $value = $this->getParam('value');
        if (!is_null($value) && !preg_match('/^\d{4}-\d{2}-\d{2}$/', $value)) {
            throw new Exception(sprintf($this->getLang('e_date'),hsc($this->getParam('display'))));
        }
    }
}

to this:-

     * Validate field input
     *
     * @throws Exception when empty or wrong date format
     */
    protected function _validate() {
        parent::_validate();
 
        $value = $this->getParam('value');
        if (!is_null($value) && !preg_match('/^\d{2}-\d{2}-\d{4}$/', $value)) {
            throw new Exception(sprintf($this->getLang('e_date'),hsc($this->getParam('display'))));
        }
    }
}

As of release 2016-03-11 it is also necessary to change this:-

if(preg_match('/^(\d\d\d\d)-(\d\d?)-(\d\d?)$/', $value, $m)) {

to this:-

if(preg_match('/^(\d\d?)-(\d\d?)-(\d\d\d\d)$/', $value, $m)) {

http://forum.dokuwiki.org/u/SFITCS 2016-11-26 01:16

Now packaged as a plugin - plugin:bureaucracy-auhttp://forum.dokuwiki.org/u/SFITCS 2017-03-10 08:23

Customise the Thankyou message

To allow inserting DokuWiki code into the Thankyou field.

Change the syntax in bureaucracy/syntax.php from:-

$thanks .= '<p>' . $thanks_string . '</p>';

to this:-

$thanks .= p_render('xhtml',p_get_instructions($data['thanks']),$info);

Which then allows the use of a link back to the same page when processing a Bureaucracy form:-

Thanks [[$examplepage|Continue]]

NOTE: If form creates a data plugin edit table the wiki code needs to be quoted (surrounded by “ ” quotes as in the example below)

Thanks "[[$page|Continue]]"

CSS Formatting

Issues

Please report bug or feature request on the Github bugtracker.

· 2023/08/12 00:01 · Alan Shea

CSV Plugin

This is a simple plugin that will display CSV data in table form. The data can either be inline between <csv> and </csv> or be read from a file in the media area using <csv namespace:test.csv></csv>. You can also give an HTTP URL to a CSV file instead of an uploaded media file.

If you are planning to use csv files in the media area, you will most likely need to include the .csv file extension in mime.local.conf so you can upload .csv files. Something like this should get you started:

csv     text/csv

The <csv> tag allows for additional options to be specified as well as a file reference.

Option Description Default value
file=<filename> where <filename> can be any <namespace:file.csv> or <http url>
hdr_rows=<n> Format the first <n> rows of data from the CSV as column headers 1
hdr_cols=<n> Format the first <n> columns of each row as column headers 0
span_empty_cols=[01] Create colspans for each empty (two adjacent commas) cell following a cell with content 0
delim=<char> The delimiter used between cells. Specify tab for a tab separated file. ,

Other options of the form <key>=<value> are possible but not used for displaying csv data yet.

Cells that include a comma as part of the data are expected to be contained between double quotes, which is the typical behaviour of most systems when exporting .csv files.

Empty lines in the csv file or data are displayed as horizontal separators in the table.

Use with a Google Docs Spreadsheet

The HTTP URL can be a shared Google Docs Spreadsheet. The following explains how to export a spreadsheet in CSV format via a URL.

To link to a Google spreadsheet:

  • Open your spreadsheet in Google Docs.
  • Click the “Share” botton in the toolbar, and choose “Anyone with the link” for Visibility.
  • Open your spreadsheet in Google Docs.
  • From the spreadsheet menu select: File | Publish as a Web Page
  • Sheets to Publish: “All Sheets”, and check the box “Automatically republish when changes are made” to ensure your data is auto updated.
  • Click “Start Publishing”. This will activate the options in the box “Get a link to the published data”, below.
  • Change the export type from “Web Page” to “CSV (comma-separated values)”.
  • Change “All sheets” to “Sheet1” (or select the sheet you want to export)
  • Change “All Cells” to the specific range you want to export, beginning with the header row. Use Excel-style notation, like “A1:C6” for the first 3 columns and the first 6 rows.
  • Click “Republish now”
  • Copy the link (check it ends with output=csv) and paste it into your dokuwiki CSV table using the file= attribute described above.

Outline of steps adapted from:

· 2012/07/16 17:53 · Alan Shea

dropfiles Plugin

description: Drop files into the edit area to upload them


A CosmoCode Plugin

Installation

Search and install the plugin using the Extension Manager. Refer to :Plugins on how to install plugins manually.

Examples/Usage

Simply drag and drop a file from your filesystem into the editarea of your page to upload it into the current namespace. If the file already exists you will be given the option to skip, overwrite or rename it.

This Plugin integrates well with the filelisting plugin. If you have both, then you can drag'n'drop files into the file explorer of the filelisting plugin.

Configuration and Settings

  • insertFileLink: Insert a link to every successfully uploaded file at the current cursor position. Deactivated by default.

Development

Change Log

Releases:

  • 2020-03-18 by splitbrain (2020/07/23 21:50)
    Version upped
  • 2019-10-30 by splitbrain (2019/10/30 22:50)
    Version upped
  • 2019-10-29 by splitbrain (2019/10/29 22:50)
    Version upped
  • 2019-06-20 by splitbrain (2019/06/24 21:50)
    Version upped
  • Release 2018-08-02 by micgro42 (2018/08/02 07:18)
    This release fixes a bug with the insertSyntax option that the syntax wouldn't actually be inserted if the text in the editarea had been changed. This release also adds the feature that the marked text will become the label or title in the added syntax.
  • 2017-12-21 by micgro42 (2017/12/21 17:05)
    Fix IE11 Syntax Insert Bug
  • 2017-12-15 by micgro42 (2017/12/15 10:20)
    Bugfixes
  • 2017-12-08 by micgro42 (2017/12/08 10:14)
    Bugfix
· 2024/03/21 19:01 · Alan Shea

editX Plugin

NON-FUNCTIONAL/DISCONTINUED

SEE Move Plugin

plugin:EditX moves or renames pages with their entire edit history, and will also delete pages with or without deleting the edit history.

  • Go to the edit page and click on the link in the the header: Page management for page name (or simply use the action ?do=editx in the URL)
  • use the form to manage a page rename or deletion for the current page.

Moving a page

Move moves a page and all histories to the targeted name, leaving a redirection text on the old page. The move summary will be left in the source page history, the target page history, recent changes, and will be sent to the subscribers or the source of the target page.

If the target page exists or has a conflicting file (page, meta or attic files), the move cannot be done. Therefore if you move a page from A to B, you cannot move B back to A until you delete (no history) page A via this plugin or manually.

Authority requirements

  1. edit authority of the source page
  2. edit authority of the target page
  3. being in groups or users defined in user_rename

Moving a page (Without redirection)

If you want to perform a move without leaving a redirection and a note in the history, just check the checkbox No redirect, the source will be totally removed just as delete does.

Authority requirements

  1. delete file authority of the source page
  2. edit authority of the target page
  3. being in groups or users defined in user_rename_nr

Deleting a page

Delete removes all files in pages/ meta/ and attic/ related to the page, except .mlist. The delete summary will be left in the source page history, recent changes, and will be sent to the subscribers of the source page.

If no delete history is checked, there will be no history in the source page but still in the recent changes.

Authority requirements

  1. delete file authority of the page
  2. being in groups or users defined in user_delete

Configuration

Here are configs in the configuration manager:

  • redirecttext: Text left after moving a page, and @ID@ refers to the target page. If it's left blank, the default text (in the language pack) is used.
    • If you have Redirector plugin installed, you can fill in ~~REDIRECT>:@ID@~~ or #REDIRECT :@ID@.
  • user_rename: The groups and/or users allowed to perform page name (note that edit authority is still needed, see above documentation), listed in comma seperated form.
    • If you want to enable for all with edit authority, leave it blank.
    • If you want to disable for all, write an impossible “user name” such as -.
  • user_rename_nr: similar to above
  • user_delete: similar to above
· 2013/03/25 11:36 · Alan Shea

File List Plugin

The filelist plugin provides a syntax for adding linked and sorted lists of files as selected by wildcard based glob patterns to a wiki page and thus allows dynamically including file listings of arbitrary filesystem locations and media namespaces. Using the additional filename command, one can also add a single link to a file out of a list anywhere in the text, which can be used to automatically keep download links for software releases up to date with the most recent upload.

Usage

The filelist plugin provides two new commands to be used in wiki pages, filelist and filename. The general command syntax for both is the following:

{{[ command ]>[ pattern ][ parameterlist ]}}
  • command must be either filelist or filename.
  • pattern is a searching pattern for files to include in the generated list, defined using the pattern syntax of the unix fnmatch function. An example: If you want to include all files ending on .txt in the folder some/path/3), you would use some/path/*.txt as the pattern (and the parameter direct=1, see parameters below). Analogue to this, to include all jpeg media files in :some:namespace, you'd use :some:namespace:*.jpg.
  • parameterlist can be used to define optional, & separated parameters (defined as key-value-pairs). For a list of supported parameters, see below.

Paths

The filelist plugin supports both absolute as well as relative paths into the filesystem or Dokuwiki media namespaces. All paths are checked against a whitelist of allowed paths for scanning (as defined via the configuration setting ''allowed_absolute_paths''). Paths which are not located below these whitelisted paths are not allowed for globbing and thus filelist/filename calls to such paths fail. Per default, the Dokuwiki basedir as defined in DOKU_INC is included in this whitelist and mapped to the Dokuwiki base-URL, DOKU_URL.

Relative paths into the filesystem are interpreted relative to the Dokuwiki basedir. Relative media paths (without a leading : that is) are interpreted relative to the namespace of the currently active page. Thus, :snippets:dokuwiki:* and * would be interpreted the same on the current page :snippets:dokuwiki:filelist.

Parameters

Name Description Possible values Default
direct Whether to interpret the given pattern as a direct path in the file system or as an dokuwiki media id. Defaults to media id. 0 or 1 0
sort The property by which to sort the internal file list. By default, the file name is used, with upper case being sorted before lower case (use iname for a case insensitive sorting criteria). name, iname, ctime, mtime, size name
order Whether to sort the internal file list ascending or descending. Sorting in ascending order is the default. asc, desc asc
filelist specific parameters
offset The offset in the internal file list from which on to display the list. Default is an offset of 0. any numeric value 0
limit The number of files to display, beginning at index offset. A number of 0 means to display all available files. any numeric value 0
style The style to use for display. list creates an unordered bullet list (the default), olist an ordered list, table a table view and page a heading/section based view of the selected files. list, olist, table, page list
tableheader Whether to show the table header describing the table columns. Off by default. 0 or 1 0
tableshowdate Whether to show the file modification date in the table view. Off by default. 0 or 1 0
tableshowsize Whether to show the file size in the table view. Off by default. 0 or 1 0
recursive Whether to do a recursive file crawl starting at the defined basepath. If this parameter is set to 1, the whitecard part of the search pattern is applied to each found subdirectory. If no files are found, the subdirectory is not included in the search result. All display styles besides table will show the result in a hierarchical structure; table will first flatten the result by prepending all found files with there subtree pathname (note that this happens before sorting). 0 or 1 0
titlefile The filename of a file which to lookup in each subtree if recursive is set to 1 and whose content to use as title for the directory. It will be ignored in the results of the filelisting itself. Defaults to _title.txt. Example: A _title.txt file containing “My special title” found during a crawl on the subpath my/subpath will be rendered as having the name “My special title” instead of “subpath”. any filename _title.txt
filename specific parameters
index Which specific item to select for display from the internal file list. The default is the first one. any numeric value 0

Examples

filename

{{filename>:cp:c61-genset-control-tower-3p.jpg}}

turns into

c61-genset-control-tower-3p.jpg



filelist

Example 1
{{filelist>:datasheets:*.pdf&style=table&tableheader=1&tableshowdate=1&tableshowsize=1&limit=15}}

turns into

FilenameFilesizeLast modified
abb145-300.pdf1.0 MiB2018/05/28 22:28
abb_circuit_breakers.pdf3.1 MiB2018/05/28 22:28
abb_contactors.pdf3.5 MiB2018/05/28 22:28
abb_lw110_lug_ext..pdf552.8 KiB2018/05/28 22:28
af400_dims.pdf165.4 KiB2018/05/28 22:28
altech-buttons.pdf643.2 KiB2018/05/28 22:28
altech_labels.pdf280.9 KiB2018/05/28 22:28
altech_switch_contacts.pdf448.3 KiB2018/05/28 22:28
altech_terminal_blocks.pdf4.6 MiB2018/05/28 22:28
atkinson_elect_uiro.pdf275.0 KiB2018/05/28 22:28
comap_intelicompact-nt-1.3-reference_guide_r3.pdf7.7 MiB2018/05/28 22:28
comap_intelicompact-nt-operator_guide_12-2011.pdf1.6 MiB2018/05/28 22:28
comap_mainscompact-nt-1.0-reference_guide.pdf3.2 MiB2018/05/28 22:28
cooper-bussmann_industrial-control_7400039.pdf222.6 KiB2018/05/28 22:28
crown_battery_renewable_power_products_brochure.pdf972.3 KiB2018/05/28 22:28
Example 2
Example 3
{{filelist>lib/images/*&style=olist&direct=1&recursive=1&sort=iname}}

turns into

  1. _deprecated.txt
  2. admin
    1. acl.png
    2. config.png
    3. plugin.png
    4. popularity.png
    5. README
    6. revert.png
    7. styling.png
    8. usermanager.png
  3. blank.gif
  4. bullet.png
  5. closed-rtl.png
  6. closed.png
  7. diff.png
  8. email.png
  9. email.svg
  10. error.png
  11. external-link.png
  12. external-link.svg
  13. fileicons
    1. 32x32
      1. 7z.png
      2. asm.png
      3. bash.png
      4. bz2.png
      5. c.png
      6. cc.png
      7. conf.png
      8. cpp.png
      9. cs.png
      10. csh.png
      11. css.png
      12. csv.png
      13. deb.png
      14. diff.png
      15. doc.png
      16. docx.png
      17. file.png
      18. gif.png
      19. gz.png
      20. h.png
      21. hpp.png
      22. htm.png
      23. html.png
      24. ico.png
      25. java.png
      26. jpeg.png
      27. jpg.png
      28. js.png
      29. json.png
      30. lua.png
      31. mp3.png
      32. mp4.png
      33. odc.png
      34. odf.png
      35. odg.png
      36. odi.png
      37. odp.png
      38. ods.png
      39. odt.png
      40. ogg.png
      41. ogv.png
      42. pas.png
      43. pdf.png
      44. php.png
      45. pl.png
      46. png.png
      47. ppt.png
      48. pptx.png
      49. ps.png
      50. py.png
      51. rar.png
      52. rb.png
      53. rpm.png
      54. rtf.png
      55. sh.png
      56. sql.png
      57. svg.png
      58. swf.png
      59. sxc.png
      60. sxd.png
      61. sxi.png
      62. sxw.png
      63. tar.png
      64. tgz.png
      65. txt.png
      66. wav.png
      67. webm.png
      68. xls.png
      69. xlsx.png
      70. xml.png
      71. zip.png
    2. 7z.png
    3. asm.png
    4. bash.png
    5. bz2.png
    6. c.png
    7. cc.png
    8. conf.png
    9. cpp.png
    10. cs.png
    11. csh.png
    12. css.png
    13. csv.png
    14. deb.png
    15. diff.png
    16. doc.png
    17. docx.png
    18. dsn.png
    19. file.png
    20. gif.png
    21. gz.png
    22. h.png
    23. hpp.png
    24. htm.png
    25. html.png
    26. ico.png
    27. index.php
    28. java.png
    29. jpeg.png
    30. jpg.png
    31. js.png
    32. json.png
    33. lua.png
    34. mp3.png
    35. mp4.png
    36. new
      1. 7z.png
      2. asm.png
      3. bash.png
      4. bz2.png
      5. c.png
      6. cc.png
      7. conf.png
      8. cpp.png
      9. cs.png
      10. csh.png
      11. css.png
      12. csv.png
      13. deb.png
      14. diff.png
      15. doc.png
      16. docx.png
      17. dsn.png
      18. file.png
      19. gif.png
      20. gz.png
      21. h.png
      22. hpp.png
      23. htm.png
      24. html.png
      25. ico.png
      26. index.php
      27. java.png
      28. jpeg.png
      29. jpg.png
      30. js.png
      31. json.png
      32. lua.png
      33. mp3.png
      34. mp4.png
      35. odc.png
      36. odf.png
      37. odg.png
      38. odi.png
      39. odp.png
      40. ods.png
      41. odt.png
      42. ogg.png
      43. ogv.png
      44. pas.png
      45. pdf.png
      46. php.png
      47. pl.png
      48. png.png
      49. ppt.png
      50. pptx.png
      51. ps.png
      52. py.png
      53. rar.png
      54. rb.png
      55. README
      56. rpm.png
      57. rtf.png
      58. sh.png
      59. sql.png
      60. swf.png
      61. sxc.png
      62. sxd.png
      63. sxi.png
      64. sxw.png
      65. tar.png
      66. tgz.png
      67. txt.png
      68. wav.png
      69. webm.png
      70. xls.png
      71. xlsx.png
      72. xml.png
      73. zip.png
    37. odc.png
    38. odf.png
    39. odg.png
    40. odi.png
    41. odp.png
    42. ods.png
    43. odt.png
    44. ogg.png
    45. ogv.png
    46. orig
      1. 7z.png
      2. asm.png
      3. audio.png
      4. bash.png
      5. bz2.png
      6. c.png
      7. cc.png
      8. conf.png
      9. cpp.png
      10. cs.png
      11. csh.png
      12. css.png
      13. csv.png
      14. deb.png
      15. diff.png
      16. doc.png
      17. docx.png
      18. dsn.png
      19. file.png
      20. gif.png
      21. gz.png
      22. h.png
      23. hpp.png
      24. htm.png
      25. html.png
      26. ico.png
      27. index.php
      28. java.png
      29. jpeg.png
      30. jpg.png
      31. js.png
      32. json.png
      33. lua.png
      34. mp3.png
      35. mp4.png
      36. odc.png
      37. odf.png
      38. odg.png
      39. odi.png
      40. odp.png
      41. ods.png
      42. odt.png
      43. ogg.png
      44. ogv.png
      45. pas.png
      46. pdf.png
      47. php.png
      48. pl.png
      49. png.png
      50. ppt.png
      51. pptx.png
      52. ps.png
      53. py.png
      54. rar.png
      55. rb.png
      56. rpm.png
      57. rtf.png
      58. sh.png
      59. sql.png
      60. swf.png
      61. sxc.png
      62. sxd.png
      63. sxi.png
      64. sxw.png
      65. tar.png
      66. tgz.png
      67. txt.png
      68. wav.png
      69. webm.png
      70. xls.png
      71. xlsx.png
      72. xml.png
      73. zip.png
    47. pas.png
    48. pdf.png
    49. php.png
    50. pl.png
    51. png.png
    52. ppt.png
    53. pptx.png
    54. ps.png
    55. py.png
    56. rar.png
    57. rb.png
    58. README
    59. rpm.png
    60. rtf.png
    61. sh.png
    62. sql.png
    63. svg
      1. 7z.svg
      2. asm.svg
      3. bash.svg
      4. bz2.svg
      5. c.svg
      6. conf.svg
      7. cpp.svg
      8. cs.svg
      9. csh.svg
      10. css.svg
      11. csv.svg
      12. deb.svg
      13. doc.svg
      14. docx.svg
      15. file.svg
      16. gif.svg
      17. gz.svg
      18. h.svg
      19. htm.svg
      20. html.svg
      21. ico.svg
      22. index.php
      23. java.svg
      24. jpeg.svg
      25. jpg.svg
      26. js.svg
      27. json.svg
      28. lua.svg
      29. mp3.svg
      30. mp4.svg
      31. ods.svg
      32. odt.svg
      33. ogg.svg
      34. ogv.svg
      35. pdf.svg
      36. php.svg
      37. pl.svg
      38. png.svg
      39. ppt.svg
      40. pptx.svg
      41. ps.svg
      42. py.svg
      43. rar.svg
      44. rb.svg
      45. README
      46. rpm.svg
      47. rtf.svg
      48. sh.svg
      49. sql.svg
      50. svg.svg
      51. swf.svg
      52. tar.svg
      53. tgz.svg
      54. txt.svg
      55. wav.svg
      56. webm.svg
      57. xls.svg
      58. xlsx.svg
      59. xml.svg
      60. zip.svg
    64. svg.png
    65. swf.png
    66. sxc.png
    67. sxd.png
    68. sxi.png
    69. sxw.png
    70. tar.png
    71. tgz.png
    72. txt.png
    73. wav.png
    74. webm.png
    75. xls.png
    76. xlsx.png
    77. xml.png
    78. zip.png
  14. history.png
  15. icon-list.png
  16. icon-sort.png
  17. index.html
  18. info.png
  19. interwiki
    1. amazon.de.svg
    2. amazon.svg
    3. amazon.uk.svg
    4. callto.svg
    5. doku.svg
    6. google.svg
    7. paypal.svg
    8. phpfn.svg
    9. skype.svg
    10. tel.svg
    11. user.svg
    12. wp.svg
    13. wpde.svg
    14. wpes.svg
    15. wpfr.svg
    16. wpjp.svg
    17. wpmeta.svg
    18. wppl.svg
  20. interwiki.png
  21. interwiki.svg
  22. larger.gif
  23. license
    1. badge
      1. cc-by-nc-nd.png
      2. cc-by-nc-sa.png
      3. cc-by-nc.png
      4. cc-by-nd.png
      5. cc-by-sa.png
      6. cc-by.png
      7. cc-zero.png
      8. cc.png
      9. gnufdl.png
      10. publicdomain.png
    2. button
      1. cc-by-nc-nd.png
      2. cc-by-nc-sa.png
      3. cc-by-nc.png
      4. cc-by-nd.png
      5. cc-by-sa.png
      6. cc-by.png
      7. cc-zero.png
      8. cc.png
      9. gnufdl.png
      10. publicdomain.png
  24. magnifier.png
  25. media_align_center.png
  26. media_align_left.png
  27. media_align_noalign.png
  28. media_align_right.png
  29. media_link_direct.png
  30. media_link_displaylnk.png
· 2012/07/16 17:54 · Alan Shea

Include Plugin

Include another wiki page into the current one.

Examples

{{page>wiki:syntax#Tables}} will include the section about tables of the syntax page.

{{namespace>project_foo}} will include all pages in the project_foo namespace.

{{page>blog:mypage&tags&comments}} will include the page blog:mypage and show the tags from the tag plugin and the number of comments from the discussion plugin. Both plugins need to be installed for this example.

Syntax

Simply enclose the ID of the page to be included in double curly brackets:

{{page>[id]&[flags]}}
{{section>[id]#[section]&[flags]}}
{{namespace>[namespace]&[flags]}}
{{tagtopic>[tag]&[flags]}}
[id] page ID of the page to include; some macros are possible; shortcuts are resolved (:, ., ..) required
[section] limits the included page to a specific section and its subsections optional; default is the whole page
[tag]include pages with tag topic tag, requires plugin:tag required
[flags] flags delimited by &, see flags optional

The plugin offers four syntaxes, {{page>...}} , {{section>...}} , {{namespace>...}} and {{tagtopic>...}}.

Section is aimed more at including sections, page at including whole pages and namespace at including whole namespaces. Tagtopic includes all pages with a tagtopic tag.

Configuration

The plugin can be configured in the DokuWiki configuration manager available in the admin menu. These settings also affect the blog plugin which uses the include plugin to generate the blog page.

noheader Don't display the header of the inserted section
firstseconly Display only the first section of the included page
showtaglogos Show/hide an image for the first tag (if the page has tags)
showfooter Show/hide page footer below the included page
showlink Makes the first headline of a included page/section a link to the included page/section
showpermalink Show/hide a permalink to the included page in the page footer
showdate Show/hide creation date of the page in the page footer
showuser Show/hide user name of the page creator in the page footer
showcomments Show/hide number of comments in the page footer (requires the discussion plugin)
showlinkbacks Show/hide number of linkbacks in the page footer (requires the linkback or backlinks2 plugin)
showtags Show/hide tags in the page footer (requires the tag plugin)
showeditbtn Show/hide edit button below the included page
doredirect Redirect back to original page after an edit
usernamespace Namespace for user pages (see showuser configuration) (default user)
doindent Indent included pages relative to the section of the page they get included in
linkonly Display only a link instead of the whole page content
title Show the title instead of the page id
pageexists Only list page ids of existing pages (see existlink)
existlink Display a link and do so only if page page-id exists
noparlink Don't put the link into a par environment (for inline lists)

Macros

Simple macros are possible to serve a page on a per user or per date base. These are:

@USER@ username
@NAME@ full name of user
@GROUP@ first group the user belongs to
@YEAR@ 4-digit year
@MONTH@ 2-digit month
@WEEK@ 2-digit ISO week number
@DAY@ 2-digit day
@DATE<expr>@ use a calculated date instead of today in date macros

<expr> in @DATE<expr>@ can be one of:

PYEAR previous year
NYEAR next year
PMONTH previous month
NMONTH next month
PWEEK previous week
NWEEK next week
YESTERDAY yesterday's date
TOMORROW tomorrow's date

Examples:

{{page>@MONTH@:@DAY@:birthdays}}

includes the page birthdays in namespace <month>:<day>: eg. 10:15: birthdays for the 15th of october.

{{page>@USER@:message}}

incudes the page message from the namespace <user> of the logged in user

{{page>foo@DATENWEEK@@YEAR@:@WEEK@}}

includes the page <weekno> from the namespace foo<year> with next week's date e.g. foo2012:01 for the 27th of december 2011

Flags

You may use flags to override default all configuration settings:

Setting Default Alternative
firstseconly fullpage includes the whole page firstseconly includes only the first section of a wiki page
showfooter footer shows a footer below the page with info about the included page nofooter hides the page info footer
showeditbtn editbtn shows a button to edit (or create) the included page noeditbtn hides the edit (or create) button
noindent fullpage page section and header retained on the same level as source page noheader strips the title from the included page

Examples:

{{page>concept&firstseconly&footer}}
{{page>mypage&noindent}}
· 2012/07/16 17:54 · Alan Shea

IndexMenu Plugin

IndexMenu allows you to insert a fully customizable index or a list of pages starting from a specified namespace.

Quick Syntax

:!: All the syntax options can be easily accessed with the indexmenu picker in the edit window toolbar.
Main Options
{{indexmenu>ns[#n] [ns1[#n] ns2[#n] …] | [js[#theme]] [tsort] … }}

Arguments inside “[]” parenthesis are optional. The # char is always required with related options.

Full syntax

Settings before the “|” separator:

Main Action Note
ns Main namespace name. Index starts from here. Syntax complies with DokuWiki namespaces paths..” refers to the namespace of the page containing the indexmenu syntax and not to the current DokuWiki namespace context 5) (see the context option for this feature). “..” or an empty value shows the root site namespace.
#n n is a number that specifies how many namespace levels to display open under the main namespace. If it's not defined then the whole tree, till the deeper node, will be open. If 0 or 1 it'll display only nodes under the main namespace. For example: “#2” will display “root:myns1:myns2” but will keep myns2 closed thus hiding “root:myns1:myns2:myns3”. Optional.
ns1[#n] ... nsn[#n] A list of optional namespaces inside the main namespace. Every namespace will be opened or closed at the specified n level. Syntax complies with DokuWiki namespaces. If n is not defined then all namespaces are open, if 0 they are closed. “.” refers to the namespace of the page containing the indexmenu syntax and not to the current DokuWiki namespace context 6) (see the context option for this feature). “..” or an empty value shows the root site namespace. Optional.

Optional settings after the “|” separator:

Option Action Note
js JavaScript render method: the index is an expandable tree menu. Without n, all nodes are open, with it, nodes are open till n level.
navbar The tree opens itself automatically at the current page namespace. Useful in a navigation sidebar. It works with or without js option. Without js option, the indexmenu page is never cached (just like the default DokuWiki index page) and the DokuWiki loading could be slower depending on the amount of child nodes displayed.
context Relative main namespace and optional namespaces will refer to the current DokuWiki namespace context 7) instead of to the namespace of the page containing the indexmenu syntax. Useful in a navigation sidebar. It works with or without js option. In both cases, the indexmenu page is never cached so the DokuWiki loading could be slower depending on the amount of child nodes displayed (In js mode, when a lot of nodes are usually displayed, the max option is recommended). It automatically enable the nocookie option.
tsort Sort (only) pages by title. Useful when useheading is on. By default namespaces are not sorted, you need the nsort option for this.
dsort Sort (only) pages by date creation (first the oldest). By default namespaces are not sorted, you need the nsort option for this.
msort[#meta] Sort (only) pages by a custom metadata information. Without the meta parameter, it looks for the custom sorting number specified with the {{indexmenu_n>N}} syntax (see the below metadata-tag-syntax). meta should refer to the data structure (Array values are managed through the “:” separator, for example: “msort#date:modified). By default, pages without metadata tag are sorted by page name (the default DokuWiki way), but you can override this behaviour adding also the tsort or dsort option in the indexmenu syntax. By default namespaces are not sorted, you need the nsort option for this.
rsort Reverse the sorting of pages. By default namespaces are not sorted, you need the nsort option for this.
nsort Sort also namespaces according to page sort options. To use in addition to the above sort options. tsort option will apply to headpages.
nons Exclude namespaces nodes from index. It shows only the pages. Without js, the closing n namespace option prevents to display nodes below the n namespace level.
nopg Exclude pages nodes from index. It shows only the namespaces.
max#n[#m] If initially closed, the node at n level will retrieve all its child nodes through the AJAX mechanism when opened for the first time. Optionally, the nodes after the n level can be retrieved with AJAX every m sublevels instead of in one go. It affects the server loading and speeds up the loading of pages in DokuWiki with an high amount of pages. It works only in js. Cookie are automatically disabled, just like with nocookie.
theme Theme name for indexmenu icons A theme is a set of icons inside images directory as described in theme-tutorial. Admins can download and share themes in admin panel. It works only in js
id#[random|n] Cookie ID for a js indexmenu where the previously opened/closed nodes by a user are stored. Useful when a page is uncached and you don't use the nocookie option because it forces the same cookie preventing un-useful cookies created every time a page is viewed by the user. By default is always random even when this option is not specified, but you can force it to be a n fixed number ( i.e id#20 ). Read the js-does-not-remember-its-previous-state section. ATTENTION: ID must be unique for every indexmenu in your DokuWiki site or you'll get strange js behaviors. It works only in js
maxjs#n It sets how many js tree levels to render when page loads. Remaining nodes are rendered (slightly slower) only when they are open by users, by optional namespaces option, by cookies or by navbar option. Default n is 1 so that it will speed up the page loading, above all with an high amount of pages. It affects only the user-client CPU speed, not the webserver load. It works only in js
nocookie Disable cookies. By default js indexmenu remember selected,open and closed nodes by user during navigation. With this option it doesn't remember them and the tree is blocked to its start status. It works only in js
noscroll Disable the JavaScript scrolling feature. It could solve visualization problems. It works only in js
notoc Disable the TOC-preview feature. It works only in js

Examples

A sample of an indexmenu JS index that could be used inside a navigation sidebar. Its initial status is blocked by the nocookie option, so, when the page is reloaded, it doesn't remember the open and closed nodes by the user.:

{{indexmenu>..#1|js navbar nocookie}}

JS navigation index with “thread” theme where nodes after the third level are retrieved with Ajax every 2 sublevels. Pages are sorted by title and custom sort number:

{{indexmenu>..#1|js#thread navbar max#3#2 tsort msort}}

Standard DokuWiki index showing only pages inside wiki:plugins and lower namespaces (max two levels):

{{indexmenu>:wiki:plugins#2|nons}}

Js tree showing pages and namespaces both sorted by reverse title. For example,if “archive” contains stuff (“news”,”oldnews“,etc) that you need to quickly organize by time, you could create numbered headpages for every namespace (i.e renaming “oldnews” in “news 2006”, “news” in “news 2010” and so on) and sort them from new to older:

{{indexmenu>:archive#1|js tsort nsort rsort}}

Standard index showing the tree of the current context 8) opened at the second level .

{{indexmenu>playground#2|context}}

Show all current namespace pages .

{{indexmenu>.:#1|context}}

JS tree showing all (and only) the namespaces of the “private” namespace sorted by date creation. “private” is relative and refers to the private namespace under the page containing the indexmenu syntax.

{{indexmenu>private|js nopg dsort}}

Metadata tag syntax

By default nodes on the same tree level are sorted by name (or by title/date if you use the tsort/dsort syntax), but you can also specify a custom sort number for every page inserting a metadata tag in the pages with this syntax:

{{indexmenu_n>N}}

Where N is a number. Then you need to use the “msort” option in your indexmenu tree syntax. If you have the show_sort option enabled in the Configuration Manager, a notice is displayed to admins (only) on every page with this metadata tag (the text defaults to “Indexmenu sort number: N”).

Examples:

You can change the order of this tree containing a mix of standard and useheading pages:

-Root
  |_don
  |_Mirror sessions         (headline title of the ":mirror" page)
  |_pachuco
  |_At the radar station    (headline title of the ":radar" page)
  |_van
  |_vliet

in this way:

{{indexmenu>..#1|msort}}
-Root
  |_vliet                   {{indexmenu_n>1}}
  |_van                     {{indexmenu_n>2}}
  |_don                     {{indexmenu_n>3}}
  |_Mirror sessions         (headline title of the ":mirror" page)
  |_pachuco
  |_At the radar station    (headline title of the ":radar" page)

Pages without sort number, like the last three pages, are sorted by page name as default, but you can force a different sort:

{{indexmenu>..#1|tsort msort}}
-Root
  |_vliet                   {{indexmenu_n>1}}
  |_van                     {{indexmenu_n>2}}
  |_don                     {{indexmenu_n>3}}
  |_At the radar station    (headline title of the ":radar" page)
  |_Mirror sessions         (headline title of the ":mirror" page)
  |_pachuco
· 2012/07/16 17:56 · Alan Shea

Math Publish Plugin

MathPublish plugin.

To toggle to the math mode, you must use the <m>...</m> tag. The math commands must be separated by a space character or surrounded by {}.

<m>x in bbR \ { 1; 2 }</m>

x in bbR \ { 1; 2 }

Example:

S(f)(t)=a_{0}+sum{n=1}{+infty}{a_{n} cos(n omega t)+b_{n} sin(n omega t)} delim{lbrace}{matrix{3}{1}{{3x-5y+z=0} {sqrt{2}x-7y+8z=0} {x-8y+9z=0}}}{ } delim{|}{{1/N} sum{n=1}{N}{gamma(u_n)} - 1/{2 pi} int{0}{2 pi}{gamma(t) dt}}{|} <= epsilon/3

Typical commands

  • x+y : x+y
  • x-y : x-y
  • x*y : x*y
  • x/y : x/y
  • x^y : x^y
  • x_y : x_y
  • x<>y : x<>y
  • x>y : x>y
  • x>=y : x>=y
  • x<y : x<y
  • x⇐y : x⇐y
  • (x) : (x)
  • {x} : {x}

Space

a~b : a~b

Greek:

  • alpha : alpha
  • beta : beta
  • gamma : gamma
  • delta : delta
  • epsilon : epsilon
  • varepsilon : varepsilon
  • zeta : zeta
  • eta : eta
  • theta : theta
  • vartheta : vartheta
  • iota : iota
  • kappa : kappa
  • lambda : lambda
  • mu : mu
  • nu : nu
  • xi : xi
  • pi : pi
  • varpi : varpi
  • rho : rho
  • varrho : varrho
  • sigma : sigma
  • varsigma : varsigma
  • tau : tau
  • upsilon : upsilon
  • phi : phi
  • varphi : varphi
  • chi : chi
  • psi : psi
  • omega : omega
  • Gamma : Gamma
  • Lambda : Lambda
  • Sigma : Sigma
  • Psi : Psi
  • Delta : Delta
  • Xi : Xi
  • Upsilon : Upsilon
  • Omega : Omega
  • Theta : Theta
  • Pi : Pi
  • Phi : Phi

Symbols:

  • infty : infty
  • in : in
  • notin : notin
  • forall : forall
  • exists : exists
  • notexists : notexists
  • partial : partial
  • approx : approx
  • pm : pm
  • inter : inter
  • union : union
  • ortho : ortho
  • parallel : parallel
  • backslash : backslash
  • prime : prime
  • wedge : wedge
  • vert : vert
  • lbrace : {
  • rbrace : }
  • circ : circ
  • varnothing : varnothing
  • subset : subset
  • notsubset : notsubset
  • cdots : cdots
  • vdots : vdots
  • ddots : ddots

Arrows:

  • left : left
  • right : right
  • leftright : leftright
  • doubleleft : doubleleft
  • doubleright : doubleright
  • doubleleftright : doubleleftright
  • nearrow : nearrow
  • searrow : searrow

Sets:

  • bbR : bbR
  • bbN : bbN
  • bbZ : bbZ
  • bbC : bbC

Roots and Limits:

  • sqrt{a} : sqrt{a}
  • root{n}{a} : root{n}{a}
  • lim{a}{x} : lim{a}{x}

Big Operators:

  • int{a}{b}{x} : int{a}{b}{x}
  • doubleint{a}{b}{x} : doubleint{a}{b}{x}
  • tripleint{a}{b}{x} : tripleint{a}{b}{x}
  • oint{a}{b}{x} : oint{a}{b}{x}
  • sum{a}{b}{x} : sum{a}{b}{x}
  • prod{a}{b}{x} : prod{a}{b}{x}
  • bigcup{a}{b}{x} : bigcup{a}{b}{x}
  • bigcap{a}{b}{x} : bigcap{a}{b}{x}

Delimiters:

  • delim{[}{x}{]} : delim{[}{x}{]}
  • delim{]}{x}{]} : delim{]}{x}{]}
  • delim{[}{x}{[} : delim{[}{x}{[}
  • delim{]}{x}{[} : delim{]}{x}{[}
  • delim{lbrace}{x}{rbrace} : delim{lbrace}{x}{rbrace}
  • delim{|}{x}{|} : delim{|}{x}{|}
  • delim{vert}{x}{vert} : delim{vert}{x}{vert}

Matrix:

Syntax : matrix{num of lines}{num of columns}{first_element … last_element}

  • matrix{2}{3}{a b c d e f g} : matrix{2}{3}{a b c d e f g}

Tabular:

Syntax : tabular{lines description}{columns description}{first_element … last_element}

  • lines : sequence of 1 (draw the horizontal line) or 0 (don't draw the horizontal line) - the length of the sequence=num of lines+1
  • columns : sequence of 1 (draw the vertical line) or 0 (don't draw the vertical line) - the length of the sequence=num of columns+1
  • tabular{111}{1111}{a b c d e f g} : tabular{111}{1111}{a b c d e f g}
  • tabular{1001}{101}{1 2 3 4 5 6} : tabular{1001}{101}{1 2 3 4 5 6}

Constructions:

  • vec{express} : vec{express}
  • {express}under{foo} : {express}under{foo}
  • {express}over{foo} : {express}over{foo}
  • overline{express} : overline{express}
  • underline{express} : underline{express}
  • hat{express} : hat{express}
· 2013/02/04 14:01 · Alan Shea

Navigation Sidebar Template

Installing the template

Put the sidebar template directory in the lib/tpl directory alongside the default template. Then, add the following to your conf/local.php file:

$conf['template']    = 'sidebar';  

If you want a tagline, you can define it as follows:

$conf['tagline']    = 'Your own tagline';  

Defining sidebar content

The content of the sidebar is defined in a page called sidebar. You can use a sidebar page per namespace. You have to define the page in a normal wiki way if it doesn't exist yet. (Hint: in DokuWiki, simply searching for the page makes it easy to create it.) The template searches for the sidebar page first in the current namespace, and then higher on if none was found. If no sidebar page is found, the index is displayed by default.

· 2013/01/31 10:39 · Alan Shea

Outdent Plugin

This plugin extends DokuWiki syntax to enable the removal of one level of section indenting.

In native DokuWiki, all the content between headings is included in a section. The indentation for a particular section corresponds to the heading it follows. DokuWiki doesn't provide a way to finish a section and move back to the indentation level of the previous section - at least not without using another heading. This plugin makes that possible.

e.g.

HEADING 1
level 1 section content
  HEADING 2
  level 2 section content
    HEADING 3
    level 3 section content
  level 2 section content
    HEADING 3
level 1 section content

Syntax

==

The two equals signs must be on their own line.

· 2012/07/16 17:57 · Alan Shea

Pagelist Plugin

The Pagelist Plugin – as its name says – lists wiki pages in a nice way.

Syntax

Just wrap a regular unordered list of internal links with the <pagelist> tag:

<pagelist&[flags]>
  * [[..:blog:|Blog Plugin]]
  * [[..:discussion:|Discussion Plugin]]
  * [[..:editor:|Editor Plugin]]
  * [[..:tag:|Tag Plugin]]
  * [[..:wrap|Wrap Plugin|This is shown in the description cell]]
</pagelist>
[flags] flags can be used to alter the appearance of the pagelist, see flags optional

Flags

Setting Default Alternative
style default table with horizontal lines table, list or simplelist standard DokuWiki table or list style
showheader noheader hide the heading row of the pagelist table header show the header
showdate date show the creation or last modification date nodate hide the date
showuser user show creator or contributors nouser hide the user
showdesc nodesc hide the description desc show the description (from metadata)
showcomments nocomments hide the number of comments comments show the number of comments (if Discussion Plugin is installed)
showtags notags hide the tags tags show the tags (if Tag Plugin is installed)
showfirsthl firsthl show the first headline nofirsthl show the page name
rsort/sort nosort no sortation of pages rsort/sort sorts the pages (reverse) alphabetically by pagename

Example

<pagelist&header&comments>
...
</pagelist>

This will show a list of pages with a header line and a comments column (if the Discussion Plugin is installed).

Configuration

The plugin can be configured using the DokuWiki configuration manager available in the admin menu. The settings also apply to plugins which use the helper component of the pagelist plugin, like for example the archive component of the plugin:blog plugin.

style List style (default, list, table)
showheader Show table header
showdate Shows/hides the date column (hide, creation date, modification date)
showuser Shows/hides the user column (hide, creator, contributors)
showdesc Shows/hides a short description taken from the first paragraph of a page (hide, max. 160 characters, max. 500 characters)
showcomments Shows/hides comments of a page (requires the plugin:discussion plugin)
showlinkbacks Shows/hides linkbacks of a page (requires the linkback plugin)
showtags Shows/hides tags of a page (requires the plugin:tag plugin)
sort Sorts the pages alphabetically by pagename
· 2012/07/16 17:59 · Alan Shea

pagemod plugin

Overview

I created this plugin because I have long wished for a way to add data structured in a specific way to a page in a repetitive fashion. A clear example of this is adding data to a table. How about a form on that page which could ask the right questions and when submitted add the information submitted as an additional row at the end of the table.

When I saw the plugin:bureaucracy plugin I knew it could be done and the way that plugin is written lends itself well to extension and so here it is and it works loosely in the following way:

  • A form exists on a page (created by the plugin:bureaucracy plugin), this can be the page to be modified or it can be another page.
  • A results placeholder sits on a page, this placeholder is enclosed by the pagemod tags
  • The form is filled in and submitted inline with the plugin:bureaucracy requirements and the pagemod action rewrites the target page, replacing the placeholders with the output of parsing. It then adds another placeholder, so that you can continue to add to the page.

That's really the functionality, its quite simple.

So here are the features:

  • The form and the target can be the same page or different pages (i.e. a page can update itself or another page).
  • Each pagemod enclosure has an id, so multiple forms can be used to update different parts of a page.
  • The form can update multiple sections of a page. That is there can be multiple pagemod enclosures with different parts of the data in each, it will parse all of them as long as they have the same id as the submitting form.
  • A person can update page that they don't have write access to. Only read access is required to modify a page via the form. This is not a bug, its a feature. It means you can prevent people from modifying a page unless they do it via a form.
    • If want people to only have access to read the resultant page, but not change it, protect the form page.
    • If you don't want people to have access to read the resultant page, deny them read access, then the form will also not work for them.
      • FIXME (Does this mean they still have access to the form, but it generates an error when they try to use it?)

That's it.

Usage

Examples

Form Syntax

Defining a form is done via the plugin:bureaucracy plugin, please check that for complete syntax. But here are the changes:

<form>
action pagemod <target page/namespace> <pagemod_id>

<...various fields for submit...>
submit
</form>

To make bureaucracy use the pagemod action, you need to add action pagemod with the following parameters:

  • target : This is a page id which can include a namespace, so pagemod:same_page or whatever. Since 2009/10/12 release : You can use the special target _self to denote the same page as the enclosure.
  • pagemod_id : This is to identify which pagemod enclosures to translate

Template Syntax

Defining a pagemod template is done within a page with the following code:

<pagemod <pagemod_id> <params>>
wiki text while will be parsed for transform tags like @@field from form@@ or ##field2 from form##

the contents of this section are invisible and will not show up on this page.
</pagemod>

some other wiki text 

then some more

^ table header 1 ^ table header 2 ^
<pagemod table_adder output_before>| @@table value 1@@ | @@table value 2@@ |
</pagemod>

The pagemod enclosure starts with:

<pagemod <pagemod_id> <params>>

where the following is true:

  • pagemod_id : This is the id of the pagemod. The form has an pagemod_id, it will modify all the pagemod enclosures with the same id.
  • params : params are separated by , and can be one of the following:
    • output_after : indicates that the output of the translation must come after the rewrite of the pagemod enclosure, the default is to output before the rewrite
    • output_before : this is the default behaviour, to output the translation before the rewrite of the pagemod enclosure

The pagemod enclosure ends with the following:

</pagemod>

and the contents are not shown when the wiki page is viewed. Translation of the contents of the pagemod enclosure is done inline with the bureaucracy plugin's template function.

Since release 2009/10/12 There also exists the concept of meta variables, they are variables that are generated by the plugin at runtime. They are the following

  • @@meta.date@@ : The current date in dd/mm/yyyy
  • @@meta.datetime@@ : The current datetime according to ISO 8601
  • @@meta.date.format.format@@ : The current date in the format you specify. This format is the one used by the PHP date() function found here (e.g. @@meta.date.format.d/m/Y@@ will achieve the same as @@meta.date@@)
  • @@meta.user.id@@ : The user who submitted the form's username
  • @@meta.user.mail@@ : The users email address (if we know it)
  • @@meta.user.name@@ : The users full name (if we know it)
  • @@meta.page.id@@ : The full id of the page
  • @@meta.page.name@@ : The name of the page
  • @@meta.page.namespace@@ : The namespace of the page

New meta information tag requests should be sent to me for implementation.

2010-03-20 I added a auto-increment meta tag to your plugin. I needed it for a bug tracker/feature request system. If you're interested, I'll send it to you. Just send me an email to laplix¢2010¢at$gmail$dot¢com (remove the money symbols). It is not fully tested yet (right now, I only tested it with _self) but it does what I want, so…
Sounds like a useful addition.. Could you share your code here?? Cheers!

Conclusion

Please let me know of any bugs or issues, requests. I know a large number of people have requested a plugin like this, so I hope people find it useful.

Feedback

Non-editable runtime values (ADDED 2009-10-12)

We're using this plugin to log activity reports so I required the feature to include some non-editable runtime values like current date and user attributes in pagemod's output. I've done it this way:

13a14
>         global $INFO;
32a34,41
>         $patterns[] = '/(@@|##)@DATE@(@@|##)/';
>         $values[]   = strftime($conf['dformat']);
>         $patterns[] = '/(@@|##)@USER@(@@|##)/';
>         $values[]   = $_SERVER['REMOTE_USER'];
>         $patterns[] = '/(@@|##)@NAME@(@@|##)/';
>         $values[]   = $INFO['userinfo']['name'];
>         $patterns[] = '/(@@|##)@MAIL@(@@|##)/';
>         $values[]   = $INFO['userinfo']['mail'];

I've no experience in PHP so maybe this solution isn't optimal but it does work :-)Dmitry Rubinstain.

From Author : This is now possible using the meta tags described in the documentation above

Autodetect current page id (ADDED 2009-10-12)

This plugin rocks ! IMHO, it provides such great features that it should be advertised on the front page. I'm planning to use it as a commenting system. Would it be possible to auto-detect the current page id (like the plugin:backlinks2 plugin does) ? For example :

<form>
action pagemod auto new_comment
fieldset "Add your comments below"
textbox  "Name"
select   "Rate it" "Excellent|Good|Bad"
textarea "Comment"
submit
</form>

It would save an incredible amount of time when you have to insert forms in many pages ! — Laynee 2009/10/05 16:22

From Author : This is now possible using the _self target described in the documentation above

Woohooh! The new version works like a charm ! Thank you very much :) — Laynee 2009/10/12 16:00

Minimalistic Guestbook

I used this plugin for a minimalistic guestbook. Although my wiki can be edited by everyone, I think visitors would be more willing to leave a message through a little form. See http://windhoff.net/wiki/playground/playground how it works. An javascript based alternative to this is the plugin:disqus.

====== Guestbook ======
===== New Comment =====
<form>
action pagemod _self add_comment
fieldset "Write new comment"
textbox  "Name" /^((?!<\/nowiki>).)*$/
email "Email (optional)" /^((?!<\/nowiki>).)*$/ !
textarea "Comment" /^((?!<\/nowiki>).|\n)*$/
submit
</form>

===== Comments =====
<pagemod add_comment output_after>
//@@meta.date.format.r@@://
^<nowiki>@@Name@@</nowiki> |<nowiki>@@Email (optional)@@</nowiki>|
|<nowiki>@@Comment@@</nowiki> ||
</pagemod>

M. 2010/04/02 03:17

Fixed Bugs (And won't/can't fix)

Error message in combination with bureaucracy plugin

Hi, I installed pagemod together with the bureaucracy plugin, but I can't get them to work. After submitting data through a bureaucracy form (e.g. the demo-page) I receive the following error:

Fatal error: Class 'syntax_plugin_bureaucracy_actions' not found in /lib/plugins/bureaucracy/actions/pagemod.php on line 7

What am I doing wrong? I tried this on DokuWiki 2009-12-25c as well as on older versions, with same error.

I've updated my installation to DokuWiki 2009-12-25c, Pagemod 2009-10-12 and Bureaucracy 2010-01-22. I now encounter the same error. I guess Pagemod needs to be updated to work with the latest versions of Bureaucracy. I reinstalled my old version of Bureaucracy (it should be this one) and now it works — Laynee 2010/02/03 18:03
Replace in the file bureaucracy/actions/pagemod.php from line 32 to 40 with that
        // run through fields and prepare replacements
        foreach($data as $opt) {
            $label = preg_quote($opt->getParam('label'));
	        $value = $opt->getParam('value'); 
            if(in_array($opt->getParam('cmd'),$this->nofield)) continue;
	        $label = preg_replace('/([\/\.])/','\\\$1',$label);
            $patterns[] = '/(@@|##)'.$label.'(@@|##)/i';
            $values[]   = $value;
        }

Rdemont 2010/02/19

I tried both solutions above, but still remain with the same error. Something else I might be missing? — LWolf 2010/02/25
Its a type syntax_plugin_bureaucracy_actions needs to be replaced by syntax_plugin_bureaucracy_action. At least, this worked for me — Gerione 2010/3/4
I have the same big problem ! Help me please :-(Ph LAPEYRIE 2010/03/16 23:25
THE SOLUTION = Rdemont + Gerione. It's all right for me. LOLPh LAPEYRIE 2010/03/16 23:51

From Author : Fixed, now working with the new bureacracy, thanks for the help.

Multiple forms on one page (RESOLVED)

Multiple forms + pagemod sections on one page (and not only, read more) do not work.

Scenario 1: I have one page (name it: materials) with two pagemod forms and two datasets,

  • each pair with different id (exactly: am311 and cm113 if that matters),
  • both pairs identical otherwise (same fields, same structure).

Scenario 2: I have one page with form (materials) and two datasets with data (materials:am311 and materials:cm113)

  • each pair with different id (exactly: am311 and cm113 if that matters),
  • both pairs forms/datasets identical otherwise (same fields, same structure).

In both scenarios, data gets added to both datasets, instead of one of them (am311 or cm113).

From Author : This is not a bug in this module, its a bug in bureaucracy. If you have multiple bureaucracy forms on a page, the result is always generated from the first's parameters (action parameters) since it doesn't set these in the form, but re-reads them from the page

From Author : This bug is fixed by redeploying bureaucracy with the file with my patch detailed here, I have mailed Andreas and asked him to include my fix in his code.

From Author : This bug appears to have been fixed, many thanks to the bureaucracy maintainer for this

small bug for @@meta.user.id@@

Great plugin ! I use it all the time. small bug for @@meta.user.id@@ which doesn't work for me : I think it should use return $INFO['user']; instead of return $INFO['userinfo']['user'];

From Author : I cannot replicate this, both accessors work

2011-11-15 From besancon@math.jussieu.fr: I have the same bug with @@meta.user.id@@. According to http://www.dokuwiki.org/devel:environment#global_variables, you get the login name with $INFO['client'] instead of $INFO['userinfo']['user'] which is not documented at all. You have to correct file “bureaucracy/actions/pagemod.php” on line 109 by changing
return $INFO['userinfo']['user'];

to

return $INFO['client'];

Question on Period Use in Field Name

I was wondering if there is a way to use the period in field names, so you could make numbered items like “1. What is your name?”, etc. (using a period currently breaks the template) The only way I'm able to do this currently is writing a static “1. What is your name?” which is followed immediately by a “Name [ ]” line, which gets really cluttered if you're trying to do something like a numbered questionnaire.

On the other hand, is there any way to show a field title like “Please enter you name”, but assign it to a variable like @@name@@ for use in the pagemod tag? I apologize if this question is better asked on the bureaucracy plugin page.— Kououken 2010/03/02

From Author : Fixed in 1.2

Is it possible to check the value of a placeholder?

Hi! I am quite new to wikis, so please forward me to the right place if my question is wrong here. Is there any way to check the value of a placeholder and treat the form depending on its value? Something like “if @@name@@=='Green' then <show output of the form>”? Anna 2010/03/03

From Author : This isn't functionality I am looking at adding, because its open ended in terms of possibilities

Shows an empty screen after submitting the form

After I submit the form the page reloads but shows only the header, footer and sidebar without the content. The results output doesn't work regardless that I try to add them to the same or another page.

The other bureaucracy actions (email and template) work fine.

I have the same problem and I can't find any solutions on this page. I would like to add that my DokuWiki is hosted on a “UniServer” installation and I'm running the latest version of DokuWiki and bureaucracy, but my page only shows the header other then that it's as described above. I'm hoping to bring some attention to this problem by placing this comment — Ric 2010/05/10 23:49
The same happens here, just a blank page after submit when using the “Minimalistic Guestbook” – Any suggestions? — Rainer2010-09-28

From Author : I cannot replicate this even using the latest software,firefox/opera and ie7, please can you give me more information, like does it work, but just not display? What platform version etc

From Author : This has been confirmed fixed by the bug raiser, no idea what I did, but nevertheless the bug has moved on

I already asked this on the bureaucracy page but maybe it could be implemeted here. Is there a way to use multiple drop-downboxes where the input in the first box affects which options are available in the 2nd one and so on? Thanks! - Paul

From Author - This will have to be done in the bureaucracy plugin, I don't have much to do with the front end.

Multiple actions

When looking for the possibility of using both mail and pagemod actions from the same form, I came across a small extension to the pagemod plugin, namely the 'pagemodandmail' action handler. However, likely because both buraucracy and pagemod has come in new versions, I had to do som small adjustments to make it work. So this is the version 1.2 compliant version of the extension.

To install, add the following piece of code as a file named 'pagemodandmail.php' in dokuwikilib/plugins/bureaucracy/actions directory:

<?php // charset=utf-8
/**
 * Action pagemod followed by sendemail for DokuWiki plugin bureaucracy
 */

class syntax_plugin_bureaucracy_action_pagemodandmail extends syntax_plugin_bureaucracy_action {

    /**
     * Simply extract the relevant arguments and call the relevant actions
     */
    function run($data, $thanks, $argv) {
        global $ID;
        global $conf;
        require_once(DOKU_PLUGIN . 'bureaucracy/actions/action.php');
        require_once(DOKU_PLUGIN . 'bureaucracy/actions/pagemod.php');
        require_once(DOKU_PLUGIN . 'bureaucracy/actions/mail.php');

        $pagemodargs = array_slice($argv,0,2);
        $emailargs = array_slice($argv,2);

        $class = 'syntax_plugin_bureaucracy_action_pagemod';
        $pagemodder = new $class();
        $pagemodsuccess = $pagemodder->run($data, $thanks, $pagemodargs);

        $class = 'syntax_plugin_bureaucracy_action_mail';
        $emailer = new $class();
        $emailsuccess = $emailer->run($data, $thanks, $emailargs);

        $rmsg = '';
        if (!$pagemodsuccess) {$rmsg .= "Pagemod failed";}
        if (!$emailsuccess) {$rmsg .= "Emailing failed";}
        if ($rmsg=='') {return $thanks;}
        else {return $rmsg.join(',',$errors);}
    }
}

Use the following notation in the form:

action pagemodandmail <page:to:update> <tag> <email_address1> <email_address2> <email_address3> ....

Example:

<form>
action pagemodandmail support:subsystem:registered_bugs buglist 1st_address@example.com 2nd_address@example.com
Thanks "Thanks for your input."
Fieldset "Error report"
Textbox  "Name" 
email "Email"
select "Subsystem" "sub1|sub2|sub3"
textarea "Description"
textarea "Error message(s)"
submit "Send report"
</form>

The page support:subsystem:registered_bugs must be edited with the following pagemod entry

^ Name ^ Subsystem ^ Description ^ Error message(s) ^
<pagemod buglist output_before>|@@Name@@ |@@Email@@ |@@Subsystem@@ |@@Description@@ |@@Error message(s)@@ |</pagemod>

Knut S. Dale 2010/12/27

Multiple Pages changed from one form

Would such syntax be possible:

<form>
action pagemod _self,another:page:somewhere:else id
fieldset "Ereignis eingeben"
textbox "Ereignis:" /^((?!<\/code>).|\n)*$/
date "Gültig von:"   
date "bis:" 
textarea  "Details:" /^((?!<\/code>).|\n)*$/
submit "Ereignis veröffentlichen"
</form>

making it possible to have one form which places the info on more than one page? - Andy

Bugs

  • I experienced this: if the @@Variable@@ is on the begining of the line, it allways expand into empty string, even if I fill the form. And I found another difference - with bureaucracy template mode, not filled variables were kept as were, but with pagemod mode, they are replaced with empty strings.
  • Use of plugin is problematic if you use it with tables AND use edittable plugin - see description in edittable.
  • Is there a size/length constraint? I am responding to a new page question and it will not let me post a long response.
· 2023/08/12 00:01 · Alan Shea

Redirector Plugin

The pageredirector plugin allows you to redirect users between pages and namespaces by adding a particular pattern to a page.

A simple code redirects to another page:

~~REDIRECT>namespace:page~~

You can also use this syntax since 20120612 version:

#REDIRECT namespace:page
· 2013/03/25 11:24

tablecalc plugin

Overview

Sometimes one may need to do simple calculations in DokuWiki table. The idea was taken from plugin:tablemath plugin, but conception changed a little bit. With the help of the plugin:tablecalc plugin you would be able to insert Excel styles formulas into the table

Download and Installation

Download and install the plugin using the Plugin Manager using the following URL. Refer to :Plugins on how to install plugins manually.

Syntax

To perform a calculation you need to insert XL-style formula into work sheet. Any expression must be started with ~~= and finished by ~~. You can use direct range specification for functions (like XL does) or a special range() function. The range consists of a reference to the start cell and to the finish cell, like this:

r0c4

Please note, that row (r) and column (c) index starts from zero. Row and column prefixes can be swapped. The following is equal of the above:

c4r0

You can also reference to multiple cells in one range:

|r0c0:r1c1||

Furthermore you can use multiple ranges:

r0c0:r1c1,r0c3:r1c4

There is a recommendation not to use references for non-existing cells. For example, this is not correct (though it will work, returning “3”):

| 1 |
| 2 |
| ~~=sum(r0c0:r99c99)~~ |

Instead use constructions like this:

| 1 |
| 2 |
| ~~=sum(range(0,0,col(),row()-1))~~ |

Functions

The following functions are implemented:

x = column, y = row

Func Description
cell(x,y) Returns numeric value of (x,y) cell
row() Returns current row
col() Returns current column
range(x1,y1,x2,y2) Returns internal range for other functions
sum(range) Returns sum of the specified range
count(range) Returns number of elements in the specified range
round(number;decimals) Returns number, rounded to specified decimals
label(string) Binds label to the table
average(range) Returns average of the specified range
min(range) Returns minimum value within specified range
max(range) Returns minimum value within specified range
check(condition;true;false) Executes true statement, if condition is not zero
compare(a;b;operation) Do math compare for a and b. Returns zero when conditions for the operation are not met
calc() FIXME

Though you can use colon as delimiter in functions semi-colon is preferred and recommended.

Operators

Most of the standard Javascript arithmetic operators are supported but some 9) conflict with the table markup so the following operators are available:

Operator Description
+ Addition and unary plus
- Subtraction and unary negative
* Multiplication
/ Division
% Modulus (division remainder)
& Logical AND
<< Shift left
>> Shift right

Examples

I

| 1 | 2 | ~~=r0c0+r0c1~~ | ~~=10.2+1.5~~ |
1 2 3 11.7

II

| 1 | 2 |
| 3 | 4 |
| ~~=sum(r0c0:r1c1)~~ ||
1 2
3 4
10

III

| 1 | 2 | 3 | 4 |
| 5 | 6 | 7 | 8 |
| **~~=sum(r0c0:r1c1,r0c3:r1c4)~~** ||||
1 2 3 4
5 6 7 8
26

IV

|1|
|2|
|3|   
|4|   
|5.74|
|6|
|7|   
|8|   
|9|   
|10|    
|11|   
|~~=sum(range(col(),0,col(),row()-1))~~|
1
2
3
4
5.74
6
7
8
9
10
11
65.74

V

|1|
|2|
|3|   
|4|   
|5|
|6|
|7|   
|8|   
|9|   
|10|    
|~~=average(range(col(),0,col(),row()-1))~~|
1
2
3
4
5
6
7
8
9
10
5.5

VI

| ~~=label(ex6_1)~~1 | 2 |
| 3 | 4 |

Sum: **~~=sum(ex6_1.c0r0:c99r99)~~**
1 2
3 4

Sum: 10

VII

| **~~=label(ex7_1)~~11** | ~~=sum(ex7_2.c0r0:c99r99)~~ |
| 13 | 14 |

| ~~=label(ex7_2)~~1 | 2 |
| 3 | 4 |

Sum: **~~=sum(ex7_1.c0r0:c1r1)~~**
11 10
13 14
1 2
3 4

Sum: 48

VIII

| **~~=min(c0r1:c0r3)~~** | **~~=max(c1r1:c1r3)~~** |
| 1 | 7 |
| 2 | 8 |
| 3 | 9 |

~~=calc()~~
1 9
1 7
2 8
3 9

IX

| 1 | ~~=check(cell(0,row()),#True,#False)~~ |
| 0 | ~~=check(cell(0,row()),#True,#False)~~ |
| x | ~~=check(cell(0,row()),#True,#False)~~ |
|   | ~~=check(cell(0,row()),#True,#False)~~ |
| **** | ~~=check(cell(0,row()),#True,#False)~~ |
1 True
0 False
x False
False
False

X

| 1 | 2 | 1=2 | ~~=check(compare(cell(0,row()),cell(1,row()),#=),#True,#False)~~ |
| 3 | 3 | 3=3 | ~~=check(compare(cell(0,row()),cell(1,row()),#=),#True,#False)~~ |
| 4 | 5 | 4<5 | ~~=check(compare(cell(0,row()),cell(1,row()),#<),#True,#False)~~ |
| 6 | 7 | 6>7 | ~~=check(compare(cell(0,row()),cell(1,row()),#>),#True,#False)~~ |
| 8 | 9 | 8>9 | ~~=check(compare(cell(0,row()),cell(1,row()),#>),#True,#False)~~ |
| 10 | 10 | 10≥10 | ~~=check(compare(cell(0,row()),cell(1,row()),#>=),#True,#False)~~ |
| 11 | 11 | 11≤11 | ~~=check(compare(cell(0,row()),cell(1,row()),#>=),#True,#False)~~ |
| 12 | 12 | 12≠12 | ~~=check(compare(cell(0,row()),cell(1,row()),#!=),#True,#False)~~ |
1 2 1=2 False
3 3 3=3 True
4 5 4<5 True
6 7 6>7 False
8 9 8>9 False
10 10 10≥10 True
11 11 11≤11 True
12 12 12≠12 False

XI

Operator Equation Result
+ ~~= 3 + 2 ~~ 5
- ~~= 3 - 2 ~~ 1
* ~~= 3 * 2 ~~ 6
/ ~~= 6 / 2 ~~ 3
% ~~= 7 % 2 ~~ 1
unary + ~~= +2 ~~ 2
unary - ~~= -2 ~~ -2
& ~~= 3 & 2 ~~ 2
<< ~~= 2 << 7 ~~ 256
>> ~~= 8 >> 2 ~~ 2

ChangeLog

14.04.2010

  • Added labels and cross-table references
  • Added cross-table resolver and forward calculations
  • Added min(),max() and average() functions
  • Added ability to use semi-colon as a function parameters separator
  • Added compare functions
  • Added string escaping (#)
  • Fixed javascript/CPU float point calculation bug
  • Fixed invalid HTML ID's usage</todo>

07.09.2009

  • Initial release

Discussion

col() returns wrong number if the preceeding cells in the same row use colswap, eg:

| A | B | ~~=col()~~ | 
| C    || ~~=col()~~ |

gives:

A B 2
C 1

Michał Sacharewicz 2012/01/11


Is it possible to make math calculations (like multiplication)… So that to add the VAT to the price for example. for or sthg similiar… Vandra Ákos 08/31/2011
very nice indeed, I need to borrow your syntax a bit, so I don't need to use ~~tm: James Lin08/09/2009
Some coding advice: You're working with a blacklist to avoid script inclusion, a whitelist might be more secure. You're using the output of rand() as a HTML ID. Numbers alone are not allowed as IDs in XHTML, you should prefix them with your plugin name. Also have a look at using_idsAndreas Gohr 2009/09/09 15:42
The plugin definitely needs max/min and conditional functions and/or :)
Fixed all of the above — Gryaznov Sergey 2010/04/14

Can you add support for comma as decimal separator? madenate 2010/06/25

I would appreciate this, too. (Nice work, though!) — Christian 2010/09/29

Also, it would be nice if the round() function could use the exact number of specified decimal places, even if these would be zero. See the following image as a sample why it would probably look better:

Table example with round() function applied to columns 3 to 6

Christian 2010/09/29

There's problem when preceeding column to calculation contains markup, it goes bezerk:
^ Date       ^ Description         ^ Hours (Decimal) ^
| 2008-08-29 | xx                  |   6.5  |
| 2008-08-30 | xxx                 |   1.5  |
| 2008-09-03 | xxxx                |  -4.00  | 
| 2008-09-03 | [[:config]] yea |  -4.00  | 
^            ^                     ^  ~~=sum(range(1,0,col(),row()-1))~~  ^

Workaround is to avoid any markup in preceeding columns, i.e in this sample swap Description and Hours columns

glen 2010/12/08 14:04

Bug report

Plugin creates no output

None of the formulas outputs results for me (on Anteater). Any known conflicts with other plug-ins?

mubed 2012/05/30 14:28

· 2013/06/08 00:52 · Alan Shea

Task Plugin

Integrates a simple task management tool into your wiki.

Usage / Components

Task

~~TASK:[user]?[due date][priority]~~
[user] person responsible for this task – either user or full name optional; default is unassigned
[due date] date the task should be completed in YYYY-MM-DD form; if only year or year and month are given, the last day is assumed optional; default is without due date
[priority] low, medium !, high !! or critical !!! expressed with 0 to 3 exclamation marks optional; default is low priority

Place ~~TASK~~ on any page to mark it as a task. The title (first heading) is considered to be the summary of the task, the contents its description.

If a task is unassigned, any registered user of the wiki can accept it. Once a task is taken, the user to whom it is assigned to can change the status of the task to one of these values:

  • rejected – task is not worthwhile or not accepted by user
  • new – reassign task so somebody else can take it
  • accepted – user took over task but did not yet start the work
  • started – work on task started
  • done – work on task completed

If the task is done, other users can verify whether it's really done. If yes, the status can be set to verified.

The priority is reflected by the intensity of the orange shade of the task box.

Next to the title of the task box is an icon. It links to download an .ics file for the task. That can be imported by almost any calendar application that understands the VTODO component of the iCalendar standard.

Tasks (Overview)

{{tasks>[namespace]?[view]&[flags]}}
[namespace] the namespace to look for tasks required
[view] one of the views, see here optional; default is open
[flags] pagelist flags delimited by &, see flags optional

Views

all all tasks
open all task that are new, not yet done (or rejected) if assigned to me or not yet verified if assigned to someone else
my only my open tasks
new new tasks not yet assigned to anybody
done completed but not yet verified tasks
due all open tasks with a due date of today
overdue all open tasks with a due date in the past

Flags

noform Don't show the new task form
· 2012/07/16 18:01 · Alan Shea

Wrap Plugin

Universal plugin which combines the functionality of many other plugins. Wrap wiki text inside containers (divs or spans) and give them a class (choose from a variety of preset classes), a width and/or a language with its associated text direction.

One plugin to rule them all

This plugin gives you the ability to wrap wiki text inside containers (divs or spans) and give them

  1. a certain class (with loads of useful preset classes)
  2. a width
  3. a language with its associated text direction

Examples

The plugin comes with an example page, which should explain a lot and looks like this in the default template:

Syntax

Basic Syntax:

<WRAP classes #id width :language>
"big" content
</WRAP>

or
<block classes #id width :language>
"big" content
</block>

or
<div classes #id width :language>
"big" content
</div>

An uppercase <WRAP> (or alternatively <block> or <div>) creates a div and should be used for “big” containers, surrounding paragraphs, lists, tables, etc.

<wrap classes #id width :language>"small" content</wrap>

or
<inline classes #id width :language>"small" content</inline>

or
<span classes #id width :language>"small" content</span>

A lowercase <wrap> (or alternatively <inline> or <span>) creates a span and should be used for “small” containers, inside paragraphs, lists, tables, etc.

:!: Please note, some things won't work with spans: alignments (including alignments generated by changing the text direction), multi-columns and widths if the according wrap isn't floated as well.

Classes

The following classes are currently available:

class namedescription/notes
columns – similar to columns, side_note, styler, tip
column same as left in LTR languages and same as right in RTL languages
left same as column, will let you float your container on the left
right will let the container float right
center will position the container in the horizontal center of the page
col2..col5 will show the text in multiple columns (2, 3, 4 or 5), only works in modern browsers (Firefox, Chrome and Safari)
widths:!: experimental, might not work as expected, includes mobile support
half fits two columns in a row, should be used in pairs
third fits three columns in a row, should be used in triplets
quarter fits four columns in a row, should be used in quads
alignments – similar to divalign, columns, styler:!: don't work with spans!
leftalign aligns text on the left
rightalign aligns text on the right
centeralign centers the text
justify justifies the text
boxes and notes – similar to box, note, tip
box creates a box around the container (uses colours from style.ini)
info (was information in first version) creates a blue box with an info icon
important creates an orange box with an important icon
alert (:!: was warning in previous versions) creates a red box with an alert icon
tip creates a yellow box with a tip icon
help creates a violet box with a help icon
todo creates a cyan box with an todo icon
download creates a green box with a download icon
round adds rounded corners to any container with a background colour or a border (only works in modern browsers, i.e. no IE)
danger creates a red danger safety note
warning creates an orange warning safety note
caution creates a yellow caution safety note
notice creates a blue notice safety note
safety creates a green safety note
marks – similar to emphasis, important_paragraf, importanttext
hi marks text as highlighted
lo marks text as less significant
em marks text as especially emphasised
miscellaneous
clear similar to clearfloat, should preferably be used with divs, i.e. uppercase <WRAP>s
tabs if wrapped around a list of links, will show those as tabs
hide hides the text per CSS (the text will still appear in the source code, in non-modern browsers and is searchable)
noprint displays text on the screen, but not in print, similar to noprint
onlyprint displays text only in print, but not on the screen
pagebreak forces a new page in printouts (not visible on the screen), similar to pagebreak
nopagebreak tries to avoid a pagebreak in printouts (not visible on the screen)
spoiler shows white text on a white background, only to be revealed by highlighting it; similar to hide
indent indents the text, could be used instead of tab
outdent “outdents” the text, could partly be used instead of outdent
prewrap wraps text inside pre-formatted code blocks, similar to wpre

All tables inside a column or box will always be 100% wide. This makes positioning and sizing tables possible and partly replaces tablewidth.

Known restrictions

  • WRAPs won't export in ODT format.
  • Round corners only work in modern browsers (no IE8 and below).
  • Multiple columns only work in modern browsers (no IE9 and below).
  • Width classes are experimental and only work in modern browsers (no IE8 and below).
  • Normal DokuWiki Headlines used to not work and a work-around was added. Now that headlines do work, the work-around is not needed anymore but kept for backwards-compatibility. The following syntax would produce two different kinds of emulated headlines inside any of the columns or boxes/notes:
    • //**__Big Underlined Headline__**// (They will look a bit different in safety notes.)
    • //**Small Headline**//

You probably need to adjust a few of the classes to your template's needs, especially hi, lo and em if you have a dark or otherwise heavily coloured theme.

The classes are easily adjustable and extensible. Any wishes are welcome.

Widths

You can set any valid widths on any uppercase <WRAP> container: %, px, em, ex, pt, pc, cm, mm, in. Just set the width before or after or with the classes, e.g.

<WRAP someclass 50% anotherclass>...

All except percentages will be reduced to have the maximum width available on smaller screens.

You can also use the width keywords half, third and quarter. To work correctly they need another wrap around them. E.g.

<WRAP group>
  <WRAP half column>...</WRAP>
  <WRAP half column>...</WRAP>
</WRAP>

will result in two columns next to each other, which will wrap underneath each other on smaller screens and mobile devices.

Languages and Text Directions

You can change the language and the direction of a container by simply adding a colon followed by the language code, like this:

<wrap :en>This text is explicitly marked as English.</wrap>

The text direction (rtl, right to left or ltr, left to right) will get inserted automatically and is solely dependent on the language. The list of currently supported languages is taken from: http://meta.wikimedia.org/wiki/Template:List_of_language_names_ordered_by_code

If you like to mark a text with a different text direction than the default one, you should use divs, i.e. uppercase <WRAP>s. Otherwise the text alignment won't change as well.

Demo

You can see a demo of the plugin on wrap_example.

Configuration options

Option Description Default value
noPrefix Which (comma separated) class names should be excluded from being prefixed with “wrap_” tabs, group
restrictedClasses restrict usage of plugin to these (comma separated) classes (empty)
restrictionType restriction type, specifies if classes above shall be included or excluded 0
syntaxDiv Which syntax should be used in the toolbar picker for block wraps? WRAP (other choices: div, block)
syntaxSpan Which syntax should be used in the toolbar picker for inline wraps? wrap (other choices: span, inline)

Toolbar picker

The wrap picker in the editing toolbar adds the most common wrap syntaxes.

  • “columns” creates a set of half columns
  • “simple centered box” creates a standard box (60% wide, centered)
  • “info, tip, important, alert, help, download, todo box” creates specifically themed boxes (also 60% wide, centered)
  • “clear floats” creates a <WRAP clear></WRAP>
  • “especially emphasised, highlighted, less significant” creates the respective marks
· 2013/01/11 18:55 · Alan Shea

Examples for the Wrap Plugin

Basic syntax

An uppercase <WRAP> (or alternatively <block> or <div>) creates a div and should be used for “big” containers, surrounding paragraphs, lists, tables, etc.

<WRAP classes width :language>
"big" content
</WRAP>

or
<block classes width :language>
"big" content
</block>

or
<div classes width :language>
"big" content
</div>

A lowercase <wrap> (or alternatively <inline> or <span>) creates a span and should be used for “small” containers, inside paragraphs, lists, tables, etc.

<wrap classes width :language>"small" content</wrap>

or
<inline classes width :language>"small" content</inline>

or
<span classes width :language>"small" content</span>

:!: Please note, some things won't work with lowercase spans:

  • alignments (including alignments generated by changing the text direction)
  • multi-columns
  • and widths

if the according wrap isn't floated as well.

Classes and Styles

Columns and Floats

You can have columns easily by adding the class column and a width, e.g.

<WRAP column 30%>...content...</WRAP>

Emulated Big Headline

You can emulate a big headline with italic, bold and underlined text, e.g.

//**__Emulated Big Headline__**//

Emulated Small Headline

A smaller headline uses no underlining, e.g.

//**Emulated Small Headline**//

If you need text that is bold and italic, simply use it the other way around:

**//No Headline//**

Different Floating Options

Normally you would only need the class column, but for more sophisticated uses (not only for columns, but for any other classes, like boxes and notes as well) you can have several kinds of “floats”:

  • column is the same as left in LTR languages and the same as right in RTL languages
  • left will let you float your wrap on the left
  • right will let the wrap float right
  • center will position the wrap in the horizontal center of the page

Widths

You can set any valid widths (but only on divs): %, px, em, ex, pt, pc, cm, mm, in, but most of the time you'd only want either

typee.g.note
%30%makes sense in a liquid layout
px420pxmakes sense if your layout has a fixed pixel width or if your container contains images with a certain width
em20emmakes sense if you like your wrap container to grow and shrink with the font size or if your layout is em-based

A table inside a column or box will always be 100% wide. This makes positioning and sizing tables possible.

After using any of the float classes, you might come across something like this, where the following text protrudes into the space where only the floating containers should be …

… to prevent that, you should simply add

<WRAP clear></WRAP>

after your last column.

You can use the same options with spans (as each element that floats is automatically a block level element), but it probably doesn't make too much sense. :!: Widths on spans normally do not work (by design), but can make sense, when it is floating.

:!: Attention: Widths can cause problems and will often look different and break in some browsers. If you're not a web developer, you might not understand any problems regarding the box model. Just try to test your columns in all major browsers and make your widths smaller than you initially think they should be.

All of those options will also work in the boxes and notes wraps (see below).

Multi-columns

For modern browsers (Firefox, Chrome and Safari) you can use multi-columns. Just use col2 for 2 columns, col3 for 3 columns, col4 for 4 columns and col5 for 5 columns.

:!: Note: Multi-columns don't make sense for spans.

Alignments

You can use these different text alignments:

  • leftalign
  • rightalign
  • centeralign
  • justify

Center aligned text …

… and right aligned.

<WRAP centeralign>
Center aligned text ...
</WRAP>

<WRAP rightalign>
... and right aligned.
</WRAP>

:!: You cannot add alignments to spans.

Boxes and Notes

round box 570px center

  • box creates a box around the container and uses the colours from the template's style.ini as default colours (__background_alt__ and __text__)
  • any of the classes info, tip, important, alert, help, download, todo will add a special note container with a corresponding icon
  • the classes danger, warning, caution, notice, safety use safety colours (and no icons)
  • round can be added to anything with a background colour or a border and will only work in modern browsers (no Internet Explorer)

Info

<WRAP info></WRAP>

Tip

<WRAP tip></WRAP>

Important

<WRAP important></WRAP>

Alert

<WRAP alert></WRAP>

Help

<WRAP round help></WRAP>

Download

<WRAP download></WRAP>

Todo

<WRAP todo></WRAP>

Safety Notes:

Danger

<WRAP danger></WRAP>

Warning

<WRAP warning></WRAP>

Caution

<WRAP caution></WRAP>

Notice

<WRAP round notice></WRAP>

Safety

<WRAP round safety></WRAP>

You can use notes and boxes also inside text with spans like this: info, help, alert, important, tip, download, todo and round box and danger, warning, caution, notice, safety.

<wrap info>info</wrap>, <wrap help>help</wrap>, ...

Marks

You can mark text as highlighted, less significant and especially emphasised.

You can mark text as <wrap hi>highlighted</wrap>, <wrap lo>less significant</wrap> and <wrap em>especially emphasised</wrap>.

:!: This might look ugly in some templates and should be adjusted accordingly.

Miscellaneous

Indent

This text will appear indented.

<wrap indent>This text will appear indented.</wrap>

Outdent

This text will appear “outdented”.

<wrap outdent>This text will appear "outdented".</wrap>

Prewrap

Inside this code block the words will wrap to a new line although they are all in one line.
<WRAP prewrap 250px>
<code>
Inside this code block the words will wrap to a new line although they are all in one line.
</code>
</WRAP>

Spoiler

Here follows a spoiler: Darth Vader is Luke's father.

Here follows a spoiler: <wrap spoiler>Darth Vader is Luke's father.</wrap>

Just select the text in the spoiler box to be able to read its content.

Hide

The following text is hidden: John, please revise that sentence.

The following text is hidden: <wrap hide>John, please revise that sentence.</wrap>

:!: Warning: The text will still appear in the source code, in non-modern browsers and is searchable. Do not hide any security risky secrets with it!

Pagebreak

The following will add a pagebreak:

The following will add a pagebreak: <WRAP pagebreak></WRAP>

This has no effect on the browser screen. A pagebreak will force a new page in printouts.

Nopagebreak

The following will try to avoid a pagebreak:

much content, belonging together (like a long table)

The following will try to avoid a pagebreak: <WRAP nopagebreak>much content, belonging together (like a long table)</WRAP>

This also has no effect on the browser screen. It will try to avoid a page break in printouts.

Noprint

This text appears on the screen, but not in print.

<wrap noprint>This text appears on the screen, but not in print.</wrap>

Onlyprint

This text does not appear on the screen, but only in print.

<wrap onlyprint>This text does not appear on the screen, but only in print.</wrap>

Typography

I advice against using the following typography classes. It's better to create semantic classes that reflect their meaning instead.

  • font family: sansserif, serif, monospace
  • font size: bigger, muchbigger, smaller
  • font colour: fgred, fggreen, fgblue, fgcyan, fgviolet, fgyellow, fggrey, fgwhite, fgblack
  • background colour: bgred, bggreen, bgblue, bgcyan, bgviolet, bgyellow, bggrey, bgwhite, bgblack

Combining and Nesting

You can combine and nest all classes and types of boxes, e.g.

Outer green box floats right

Inner nested box floats left and is partly emphasized and highlighted with nested bigger text inside.

Text inside outer right box, but beneath inner left box.

Round tip box underneath, after a clear.

<WRAP box bggreen fgblack 350px right :en>
//**__Outer green box floats right__**//

<WRAP 165px left>
Inner nested box floats left and is partly <wrap em hi>__em__phasized and __hi__ghlighted with nested <wrap bigger>__bigger__ text</wrap> inside</wrap>.
</WRAP>

Text inside outer right box, but beneath inner left box.

<WRAP clear></WRAP>

<WRAP round tip>
Round tip box underneath, after a ''clear''.
</WRAP>

</WRAP>

Language and Text Direction

You can change the language and the reading direction of a wrap container by simply adding a colon followed by the language code, like this:

<WRAP :he>
זה עברית. ((<wrap :en>This means "This is Hebrew.", at least according to [[http://translate.google.com/|Google Translate]].</wrap>))
</WRAP>

זה עברית. 10)

The text direction (rtl, right to left or ltr, left to right) will get inserted automatically and is solely dependent on the language. The list of currently supported languages is taken from: http://meta.wikimedia.org/wiki/Template:List_of_language_names_ordered_by_code (If you specify a language not listed there, it simply won't do anything.)

· 2013/01/11 18:56 · Alan Shea
1)
In /lib/tpl/default/main.php, there are two divs that contain some buttons:
and
''. Just insert the HTML code inside one of the two divs (left or right) ))
<form class="button" method="get" action="<?php wl($ID)?>">
  <div class="no">
    <input type="submit" value="Add/Remove selection" class="button" />
    <input type="hidden" name="do" value="addtobook" />
    <input type="hidden" name="id" value="<?php echo $ID?>" />
  </div>
</form>

Monobook

When using the template “monobook for DokuWiki”, to have an Add/Remove link, in /user/tabs.php, use this code
//pdfbook plugin: add/remove selection
if (file_exists(DOKU_PLUGIN."bookcreator/action.php") &&
    !plugin_isdisabled("bookcreator")){
    $_monobook_tabs["tab-bookcreator"]["text"] = "Add/Remove to selection";
    $_monobook_tabs["tab-bookcreator"]["href"] = wl(getID(), array("do" => "addtobook"), false, "&");
}

Changing the order of wiki pages

To change the order of wiki pages in your book, simply move the pages in the list. To do so, hover over the page title to move, click and drag it to the new location. Release the mouse button to finish moving the page to its new location.

Saving books

Format of stored book pages: when you save a book, it is stored in the format shown below.
====== MyBookName ======
  * [[:first_pages]]
  * [[:second_page]]
  * .....
  * [[:last_page]]
You can also manually create a book from scratch by using the same format. To create a book from scratch, start a new page such as wiki:ebook:mybookname (default). The namespace can be changed at admin side configuration.
2)
If it is not, metadata of the btable with the same id gets mixed up, i.e. answers to choices in a previous btable appear in the new when the choices are the same.
3)
relative to your dokuwiki root
4)
This feature is based on a custom branch of the PrettyPhoto library
5) , 6) , 7) , 8)
the namespace of the page displayed by a user who is navigating your site
9)
The conflicting operators are: ^ | ~
10)
This means “This is Hebrew.”, at least according to Google Translate.