DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:qna

This is an old revision of the document!


QnA Plugin

Compatible with DokuWiki

Elenor Of Tsort, hrun, Ponder Stibbons, 2009-12-02 (RC)

plugin Custom formatting for Q&A (FAQ) sections

Last updated on
2016-02-27
Provides
Syntax
Repository
Source
Conflicts with
fastwiki

This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.

Similar to faq, wrap

Tagged with boxes, formatting

There are number of ways to organize a FAQ sections on a DokuWiki page that use (abuse) different syntax elements to present the questions and answers. The QnA plugin introduces semantically clear syntax for both questions and answers plus a convenient way to create a table of contents for the FAQ.

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

The basic QnA block starts with a question and is followed by one or more optional answers. The questions are marked by triple question mark at the start of a line, the answers — with triple exclamation mark:

??? How do I format a question?
!!! Put triple question mark at the start of a line followed by the question title.

The first line of the question (must be on the same line as the ??? marker) is used as the question title and like DokuWiki headlines does not support any formatting. The rest of the text between the title and the first answer is treated as the question details and can contain almost any DokuWiki syntax (except of headers). This also applies to the answer block — no syntax limitations.

Normally question and answer blocks span until the start of the next block or to the next section. If you want to mix QnA syntax with plain text you can explicitly terminate the block by the question block marker without the question title:

??? How do I terminate a QnA block?
What if I want to put some text after the block and that text doesn't
belong to the answer?

!!! Put triple question mark at the start of a line.
???

This text is not part of the answer.

You can organize multiple questions into sections using slightly modified headline syntax:

=?==== Level 1 headline ======
=?=== Level 2 headline =====
=?== Level 3 headline ====
=?= Level 4 headline ===

The normal headlines are still respected and may be used together with customized ones. The only difference is that they are not shown in the QnA table of contents.

The QnA TOC can be inserted with ~~QNA~~ or ~~FAQ~~ syntax. It will be rendered as an unordered list of all questions on the current page. Note that due to implementation constrains the TOC for the current page may be not properly updated in preview during the page editing. Instead of the current page you can insert TOC for other pages by adding the page names to the ~~QNA~~ syntax:

~~QNA faq:installation faq:sequrity faq:usage~~

When multiple page names are specified the plugin will combine information from all pages into a single TOC.

Styling

All elements rendered by QnA plugin are wrapped into containers with distinct class names. This allows to easily customize their look with a CSS style sheet. The figure below shows different HTML elements generated by the plugin along with their class attributes:

Styling

Version History

2016-02-27

  • Respect ACL during TOC generation
  • Fixed PHP 7 compatibility

2015-02-16

  • Various minor bug fixes

2009-12-13

  • First public release

Bugs and Feature Requests

Please report bugs or feature requests at the bug tracker.

plugin/qna.1480700885.txt.gz · Last modified: 2016-12-02 18:48 by 212.90.38.102

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki