Revision [16698]
This is an old revision of FormatterDevInfo made by TzvU5d on 2007-05-31 10:37:53.
How Formatters work and why it is easy to write your own
See also
- FormatterInfo Explanation for users
- WantedFormatters Wanted Wikka formatters
- SyntaxHighlighter
- GeSHi - WikkaGeshiIntegration
- FormatterInfo Explanation for users
- WantedFormatters Wanted Wikka formatters
- SyntaxHighlighter
- GeSHi - WikkaGeshiIntegration
What php-code is used?
- In the above example the "ini" formatter was selected, so the file formatters/ini.php was included.
- Within this script you have access to a variable $text, a string that contains the code, content of the block.
- Within the formatter process $text (mostly string manipulations) and print the result to stdout.
- note: the ";line-number" is for the moment only used in the GeSHi code.
How do we get there?
- When you display a normal page, the default handlers/page/show.php handler will call at some point $this->Format($this->page["body"], "wakka") which includes the formatters/wakka.php code.
- Within formatters/wakka.php the %%(formatter[;line-number]) code %% is detected and
- In " else if (preg_match("/^