Syntax Plugins

Asennettujen syntaksiin vaikuttavien plugienien pika esittely ja esimerkkeja kaytosta.

Baselink

Baselink mahdollistaa innerlinkit omalle serverille
Examples:
[[/downloads/manual.pdf]]
[[/downloads/manual.pdf|Educate yourself!]]
[[/manual.pdf|{{big_book.gif}}]]

Comment

Piilotetut commentit

The text /* between the slash-asterik and asterisk-slash */ is hidden

Becomes:

The text is hidden


You can also have multi-line comments:

/**
 * @todo: rewrite this section to reflect changes made recently
 *
 * this is a longer note
 */

But this single line example works too:

/********** added by Esther **********/

Countdown

paivamaara laskuri
<COUNTDOWN:date|description>

This will be replaced with either

XX days until description
XX days since description

Possible formats of date are all GNU date formats that are allowed by strtotime.
Examples:

<COUNTDOWN:mm/dd/yyyy|day to remember>
<COUNTDOWN:dd.mm.yyyy|Ereignis>

Creole

The Creole 0.3 Specs (2006-12-19) are very close to the syntax used by DokuWiki. Only those elements differ:

This Plugin will interpret Creole elements that are not understood by DokuWiki. If the markup collides (as with the header level order), by default DokuWiki's standard markup takes precedence.1) With the exception of the changed behaviour for linebreaks, all your existing wiki pages will look the same.

If you use this plugin to support the Creole syntax, you might want to list your wiki at http://www.wikicreole.org/wiki/WikisSupportingCreole

Components

Listblock

Creole style ordered and unordered lists use a slightly different markup:

Creole (and DokuWiki):

* Item 1          (  * Item 1     )
** Item 1.1       (    * Item 1.1 )
* Item 2          (  * Item 2     )

Output:

  • Item 1
    • Item 1.1
  • Item 2

Creole (and DokuWiki):

# Item 1          (  - Item 1     )
## Item 1.1       (    - Item 1.1 )
# Item 2          (  - Item 2     )

Output:

  1. Item 1
    1. Item 1.1
  2. Item 2

Headings

In Creole, the header ordering is just the other way round. If you have set the markup precedence option to DokuWiki (default), this plugin will assume headers are DokuWiki style if there are equal signs after the title. In Creole, closing (right-side) equal signs are optional. So if omit them, headers are interpreted as Creole.

Creole (and DokuWiki):

= Level 1        (====== Level 1 ======)
== Level 2       (===== Level 2 =====  )
=== Level 3      (==== Level 3 ====    )
==== Level 4     (=== Level 4 ===      )
===== Level 5    (== Level 5 ==        )

Output: (first droped for layout)

Level 4

Level 5

Linebreaks

DokuWiki does not care about (single) line breaks. Creole, however, does treat line breaks in the source as line breaks in the output.

This component is mainly the same as Chris Smith's linebreak plugin. Thanks!

Preformatted

Creole:

{{{
//This// does **not** get [[formatted]]
}}}

Some examples of markup are: {{{** <i>this</i> ** }}}

Output:

//This// does **not** get [[formatted]]

Some examples of markup are: ** <i>this</i> **

Tables

Creole (and DokuWiki):

|Heading Col 1  |Heading Col 2 |   (^Heading Col 1  ^Heading Col 2 ^)
|Cell 1.1       |Cell 1.2      |   (|Cell 1.1       |Cell 1.2      |)
|Cell 2.1       |Cell 2.2      |   (|Cell 2.1       |Cell 2.2      |)

Output:

Heading Col 1 Heading Col 2
Cell 1.1 Cell 1.2
Cell 2.1 Cell 2.2

The difference to DokuWiki is that in Creole there's no special markup for header cells and no cell alignment. In turn, in Creole the ending pipe is optional.

Definitionlist

A definition list is made up of one or more lines of the format shown below:

  ; term : definition
  ; term
  : definition
  ; term
   : definition 1
   : definition 2
term
definition
term
definition
term
definition 1
definition 2

:!: Note the two spaces at the beginning of each line.

The lines can be used in any order, the only requirements is that the first line must be one of the two lines commencing with a semi-colon ”;” and the list is terminated by leaving a line completely blank.

In a slight change over standard Dokuwiki lists, you use new lines within the list in your raw wiki data. The data on the new line is added to the end of the previous line when the definition list is being processed.

Discussion

The Discussion Plugin adds a discussion section after your wiki page for user comments. This is useful to separate page content and the discussion thereof and also, if you don't want to give normal users the right to edit the page but still want user contributed notes. A second component of this plugin shows a list of all pages in a namespace with a discussion section (called discussion threads) ordered by most recent comments. This allows you to create a very simple discussion forum in your wiki.

Components

Discussion Comments

~~DISCUSSION~~
~~DISCUSSION:off~~
~~DISCUSSION:closed~~

This is the main part of the plugin. By including the ~~DISCUSSION~~ instruction in your wiki page, a discussion section will be appended after the normal wiki page content. To turn it off again, use ~~DISCUSSION:off~~. If you want to show the existing discussion but don't want to allow new comments / replies, use ~~DISCUSSION:closed~~.

After each comment there may be up to three buttons (depending on your rights):

  • Edit: Registered users can edit their comments; admins can edit all comments. To remove a comment, just edit it, clear the text and save the empty comment – like you would do with a wiki page. Attention: If there are replies to a comment, removing it will also remove all replies!
  • Reply: To reply to a comment (vs. commenting on the wiki page content), click the Reply button. The comment entry form will then be placed accordingly.
  • Hide / Show: Admins can deactive and reactivate comments easily by this button. Hidden comments aren't shown to normal users and are displayed dimmed to admins.

Of course, the whole DokuWiki syntax can be used in comments as well. But there are problems with headers and footnotes as they may produce conflicting IDs and thus invalid XHTML. I'm looking for a way to either allow only a subset of the wiki syntax or automatically create unique IDs.

There is no toolbar. I don't consider this a major drawback, as raw text is usually enough for comments. Advanced users who know the wiki syntax are still free to use it. A toolbar for inexperienced users would be nice, but it's currently not possible to reuse the DokuWiki toolbar or a subset thereof.

Threads

{{threads>[namespace]&[flags]}}
[namespace] the namespace for which you want a discussion thread list; : is the top namespace, . is the same namespace as the page lies in, * the whole wiki required
[flags] pagelist flags delimited by &, see flags optional

This displays a list of all pages of the given namespace with a discussion section. The list is sorted by the most recent comment.

Gallery

A basic gallery can be added by selecting a namespace like this:
{{gallery>namespace}}

All imagefiles in the selected namespace will be added to the image gallery. Note: those images need to be a valid pagename, eg. all lowercase.

Instead of using a whole namespace of images, you can also specify a single image – this makes most sense when combined with the lightbox mode (see below).

{{gallery>namespace:someimage.jpg}}

The created gallery can be aligned by using whitespace (defaults to centered):

{{gallery> namespace}} (right aligned)
{{gallery>namespace }} (left aligned)
{{gallery> namespace }} (centered)

You can define the wanted thumbnail size by adding its dimension as parameter:

{{gallery>namespace?150x150}}

The default is a dimension of 120×120 pixels.

You can define the number of columns as well:

{{gallery>namespace?6}}

The default number of columns is 5 and can be configured in the config manager. If you specify a 0 no table is used instead all thumbnails are added in a sequence.

To have the filename displayed below the thumbnails add the showname parameter (if this is made the default in the config, you may disable it with noshowname):

{{gallery>namespace?showname}}

If you want the files sorted in the reverse order use the reverse keyword (if this is made the default in the config, you may disable it with noreverse):

{{gallery>namespace?reverse}}

If you don't want to link to the image detail pages but directly to the image itself use the direct parameter (if this is made the default in the config, you may disable it with nodirect):

{{gallery>namespace?direct}}

For fancy JavaScript based inline browsing of the images use the lightbox keyword 2). This feature implicitly sets the direct parameter. If this is made the default in the config, you may disable it with nolightbox.

{{gallery>namespace?lightbox}}

All params can be combined:

{{gallery>namespace?150x150&6&showname}}

You can also specify the size of lightbox images. It is done the same way as with thumbnails, except using a capital 'X'. The default is 800×600.

{{gallery>namespace?lightbox&500X400}}

IMPORTANT: When you have added your pictures they may not show up in the gallery: add '&purge=true' to the end of the URL to clear the cache - and then you should see them.

Goto

You can put the GOTO string anywhere in the document, but it probably makes the most sense to put it at the top.
  ~~GOTO>wiki:syntax~~

The above will force the document to redirect to the syntax page after the default amount of seconds. You can change the default number of seconds by editing the plugin (by default, this is 10 seconds).

You can change the number of seconds on the fly like so:

  ~~GOTO>wiki:syntax?15~~

This will redirect the page after a 15 second pause.

By default, users can't set the pause length to be faster than three seconds, but this can be changed by editing the plugin. The reason for the minimum pause length is that if it's too fast, it becomes difficult to hit the 'Edit Page' button before the redirect happens. If you can't edit the page, then it becomes tricky to remove the redirect.

Note

When you have it installed, use this :
<note>
This is my note ! Remember it !!
</note>

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

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

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

This is my note ! Remember it !!

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

The clues are in the images.

Beware of the dog when you open the door !!

You can use the note keywords important, warning and tip. It is quite easy to add new types of notes if you know a bit of PHP and CSS.

Tag

Allows you to categorize your wiki pages.

Tag

{{tag>[list of tags]}}
[list of tags] a space separated list of tags that describe the content of the current page required

Allows you to categorize your wiki pages. The resulting links point to the corresponding page in the specified tag namespace. If you want a link to point to a page in another namespace, you have to indicate the namespace before the tag name.

Examples:

  • {{tag>tag1 tag2 tag3}}
  • with namespaces: {{tag>:ns1:tag1 ns1:tag2 ns2:subns1:tag3}}

Topic

{{topic>[tag]&[flags]}}
[tag] the category tag for which you want a list of pages required
[flags] pagelist flags delimited by &, see flags optional

This displays a list of all pages that contain the given category tag. The list is sorted alphabetically by page ID. You can also prepend the modifiers + and -. + creates an intersection between the list of pages created by the already defined tags and the pages matching the tag following the + (AND), - removes all pages tagged with the given tag from the list of already found pages.

Example:

  • {{topic>tag1 -tag2}} – Lists all pages tagged with tag1 but not with tag2.
  • {{topic>tag1 +tag2}} – Lists all pages tagged with tag1 and tag2.
  • {{topic>tag1 tag2}} – Lists all pages tagged with either tag1 or tag2 or both.
1) You can change the markup precedence to Creole with the config manager, if you want full Creole support.
2) This feature is based on the Lightbox and Lightbox Plus scripts with some additions
 
playground/esimerkkeja.txt · Viimeksi muutettu: 2008/09/03 15:15 by hyeena
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki