\Text_Wiki_Render_Docbook_Heading

This class renders headings in DocBook.

Summary

Methods
Properties
Constants
__construct()
getConf()
formatConf()
urlEncode()
textEncode()
token()
$conf
$format
$rule
$wiki
$_level
$_stack
$_id
$_section
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$conf

$conf : array

Configuration keys for this rule 'sections' => array of strings, ordered list of sectioning tags, the first (mandatory) one will apply to the whole doc empty string '' means no section for this level 'section_after' => string, the section optionnaly used for next, non terminal levels 'section_end' => string, the section optionnaly used for the terminal level

Type

array — 'config-key' => mixed config-value

$format

$format : string

The name of this rule's format.

Type

string

$rule

$rule : string

The name of this rule's token array elements.

Type

string

$wiki

$wiki : object

A reference to the calling Text_Wiki object.

This is needed so that each rule has access to the same source text, token set, URLs, interwiki maps, page names, etc.

Type

object

$_level

$_level : integer

Current level

Type

integer — current section level

$_stack

$_stack : array

Parsed heading levels stack

Type

array — of int parsed heading levels stack

$_id

$_id : array

Parsed heading ids stack

Type

array — of int parsed heading ids stack

$_section

$_section : array

Final sectioning to apply

Type

array — of string section tags

Methods

__construct()

__construct(  $obj) : \The

Constructor.

We override the constructor to pre-process the heading tokens

  • to correct levels as sequential
  • mark the terminal ones
  • prepare the actual sections to be used

Parameters

$obj

Returns

\The —

render object

getConf()

getConf(string  $key, mixed  $default = null) : mixed

Simple method to safely get configuration key values.

Parameters

string $key

The configuration key.

mixed $default

If the key does not exist, return this value instead.

Returns

mixed —

The configuration key value (if it exists) or the default value (if not).

formatConf()

formatConf(string  $format, string  $key) : mixed

Simple method to wrap a configuration in an sprintf() format.

Parameters

string $format

The sprintf() format string.

string $key

The configuration key.

Returns

mixed —

The formatted configuration key value (if it exists) or null (if it does not).

urlEncode()

urlEncode(string  $urlChunk) : \rendered

Default method to render url

Parameters

string $urlChunk

a part of an url to render

Returns

\rendered —

url

textEncode()

textEncode(string  $text) : \rendered

Default method to render text (htmlspecialchars)

Parameters

string $text

the text to render

Returns

\rendered —

text

token()

token(  $options) : string

Replace start heading tokens with closure of preceding sections and opening corresponding section if not blank or the last level -1 one

Parameters

$options

Returns

string —

the replacement text