Drupal: simplewiki
Do not use this, but use markdown ## Introduction Simplewiki is a wiki-like editor, nice for creating technical pages with automatic table-of-contents.
Installation
- install and enable the module simplewiki as usual from https://www.drupal.org/project/simplewiki
- To avoid errors with some versions of php5, you need to add a line to sites/all/modules/simplewiki/SimpleWiki.php: Around line 1526: after:
class SimpleWikiDocNode
{
# A node in the document tree.
public $children;
public $parent;
public $kind;
add a line:
public $content;
- It is probably wise to install and enable better formats too.
Configuration
- admin -> configure -> text formats: create a
new text format, for example: "wikiformat", and choose
"SimpleWiki" as filter. Under "filter settings" you can
enabe automatic TOC generation, but in general it is
better to let the author choose if a TOC is desirable.
See below under
<<quicktoc>>
. - admin -> structure -> content types: create a new content type. If you have installed "better formats", tick under "Text Processing" "Filtered text (user selects text format)". Under "TEXT FORMATS", tick "limit allowed text formats" and allow only "wikiformat".
- To show the little manual when editing: admin -> people -> permissions -> better formats -> show format tip
Some css
/* put TOC on the right side, and give it some color */
#quicktoc-platform {
background: #ecffdf;
float: right;
border: 1px solid #ccc;
border-radius: 4px;
}
/* disable header */
#quicktoc-header {
display: none;
}
/* some formatting for preformatted text (source listings etc) */
pre {
background: #f5f5f5;
border: 1px solid #ccc;
border-radius: 4px;
padding: 9.5px;
}
quicktoc
The macro <<quicktoc>>
displays
a table of contents, use it at the start of your
document.
Caveats
For some reason, a $ followed by a digit gives weird results in blocks surrounded with three {'s and three }'s. Solution: escape the $ as in \$2