-
Notifications
You must be signed in to change notification settings - Fork 26
dokuwiki api paragraphs
This section describes paragraph formatting using paragraph functions.
These are the basic paragraph functions with a predefined style. These are also called for basic DokuWiki rendering and therefore the function declarations need to match the class Doku_Renderer.
The function opens a new paragraph using the style with name $style. If $style is omitted then the standard style 'Text_20_body' will be used, also see file styles.xml. The function only opens a new paragraph if there is no paragraph opened already.
The function closes a paragraph.
The function opens a new paragraph using style Preformatted_20_Text, adds the $text and closes the paragraph immediately. Leading newlines are removed. An empty line at the end of $text is removed to. Linebreaks ("\n") are converted to "<text:line-break/>". Tabs ("\t") are converted to "<text:tab/>". Space are preserved by e.g. replacing 3 spaces with "<text:s text:c="3"/>".
The following code:
$renderer->p_open('Preformatted_20_Text');
$renderer->cdata('This is predefined text.');
$renderer->p_close();
generates a paragraph with the content "This is predefined text" using the style named "Preformatted_20_Text".