Skip to content
LarsGit223 edited this page Jun 17, 2016 · 19 revisions

This section describes text formatting using span functions.

Simple span functions

These are the basic span 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.

strong_open()

The function opens a span for bold text. Also see DokuWiki basic text formatting.

strong_close()

The function closes a bold text span.


emphasis_open()

The function opens a span for italic text. Also see DokuWiki basic text formatting.

emphasis_close()

The function closes a italic text span.


underline_open()

The function opens a span for underlined text. Also see DokuWiki basic text formatting.

underline_close()

The function closes a underlined text span.


monospace_open()

The function opens a span for monospace text. Also see DokuWiki basic text formatting.

monospace_close()

The function closes a monospace text span.


subscript_open()

The function opens a span for subscript text. Also see DokuWiki basic text formatting.

subscript_close()

The function closes a subscript text span.


superscript_open()

The function opens a span for superscript text. Also see DokuWiki basic text formatting.

superscript_close()

The function closes a superscript text span.


deleted_open()

The function opens a span for deleted/strike-through text. Also see DokuWiki basic text formatting.

deleted_close()

The function closes a deleted/strike-through text span.

Code examples

Generating strong text

The following code:

    $renderer->cdata('This is ');
    $renderer->strong_open();
    $renderer->cdata('bold');
    $renderer->strong_close();
    $renderer->cdata('text.');

generates "This is bold text."

Combining styles

Nested function calls can be used to generate a combination of text styles. The following code:

    $renderer->cdata('This is ');
    $renderer->strong_open();
    $renderer->emphasis_open();
    $renderer->cdata('bold and italic');
    $renderer->emphasis_close();
    $renderer->strong_close();
    $renderer->cdata('text.');

generates "This is bold and italic text."

Clone this wiki locally