[ Index ]

PHP Cross Reference of DokuWiki

title

Body

[close]

/inc/parser/ -> renderer.php (summary)

Renderer output base class

Author: Harry Fuecks
Author: Andreas Gohr
File Size: 906 lines (23 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Doku_Renderer:: (92 methods):
  reset()
  isSingleton()
  nocache()
  notoc()
  plugin()
  nest()
  nest_close()
  document_start()
  document_end()
  render_TOC()
  toc_additem()
  header()
  section_open()
  section_close()
  cdata()
  p_open()
  p_close()
  linebreak()
  hr()
  strong_open()
  strong_close()
  emphasis_open()
  emphasis_close()
  underline_open()
  underline_close()
  monospace_open()
  monospace_close()
  subscript_open()
  subscript_close()
  superscript_open()
  superscript_close()
  deleted_open()
  deleted_close()
  footnote_open()
  footnote_close()
  listu_open()
  listu_close()
  listo_open()
  listo_close()
  listitem_open()
  listitem_close()
  listcontent_open()
  listcontent_close()
  unformatted()
  php()
  phpblock()
  html()
  htmlblock()
  preformatted()
  quote_open()
  quote_close()
  file()
  code()
  acronym()
  smiley()
  entity()
  multiplyentity()
  singlequoteopening()
  singlequoteclosing()
  apostrophe()
  doublequoteopening()
  doublequoteclosing()
  camelcaselink()
  locallink()
  internallink()
  externallink()
  rss()
  interwikilink()
  filelink()
  windowssharelink()
  emaillink()
  internalmedia()
  externalmedia()
  internalmedialink()
  externalmedialink()
  table_open()
  table_close()
  tablethead_open()
  tablethead_close()
  tabletbody_open()
  tabletbody_close()
  tabletfoot_open()
  tabletfoot_close()
  tablerow_open()
  tablerow_close()
  tableheader_open()
  tableheader_close()
  tablecell_open()
  tablecell_close()
  _headerToLink()
  _simpleTitle()
  _resolveInterWiki()


Class: Doku_Renderer  - X-Ref

An empty renderer, produces no output

Inherits from dokuwiki\Plugin\DokuWiki_Plugin for giving additional functions to render plugins

The renderer transforms the syntax instructions created by the parser and handler into the
desired output format. For each instruction a corresponding method defined in this class will
be called. That method needs to produce the desired output for the instruction and add it to the
$doc field. When all instructions are processed, the $doc field contents will be cached by
DokuWiki and sent to the user.
reset()   X-Ref
clean out any per-use values

This is called before each use of the renderer object and should be used to
completely reset the state of the renderer to be reused for a new document

isSingleton()   X-Ref
Allow the plugin to prevent DokuWiki from reusing an instance

Since most renderer plugins fail to implement Doku_Renderer::reset() we default
to reinstantiating the renderer here

return: bool   false if the plugin has to be instantiated

nocache()   X-Ref
Disable caching of this renderer's output


notoc()   X-Ref
Disable TOC generation for this renderer's output

This might not be used for certain sub renderer

plugin($name, $data, $state = '', $match = '')   X-Ref
Handle plugin rendering

Most likely this needs NOT to be overwritten by sub classes

param: string $name  Plugin name
param: mixed  $data  custom data set by handler
param: string $state matched state if any
param: string $match raw matched syntax

nest($instructions)   X-Ref
handle nested render instructions
this method (and nest_close method) should not be overloaded in actual renderer output classes

param: array $instructions

nest_close()   X-Ref
dummy closing instruction issued by Doku_Handler_Nest

normally the syntax mode should override this instruction when instantiating Doku_Handler_Nest -
however plugins will not be able to - as their instructions require data.

document_start()   X-Ref
Initialize the document


document_end()   X-Ref
Finalize the document


render_TOC()   X-Ref
Render the Table of Contents

return: string

toc_additem($id, $text, $level)   X-Ref
Add an item to the TOC

param: string $id       the hash link
param: string $text     the text to display
param: int    $level    the nesting level

header($text, $level, $pos)   X-Ref
Render a heading

param: string $text  the text to display
param: int    $level header level
param: int    $pos   byte position in the original source

section_open($level)   X-Ref
Open a new section

param: int $level section level (as determined by the previous header)

section_close()   X-Ref
Close the current section


cdata($text)   X-Ref
Render plain text data

param: string $text

p_open()   X-Ref
Open a paragraph


p_close()   X-Ref
Close a paragraph


linebreak()   X-Ref
Create a line break


hr()   X-Ref
Create a horizontal line


strong_open()   X-Ref
Start strong (bold) formatting


strong_close()   X-Ref
Stop strong (bold) formatting


emphasis_open()   X-Ref
Start emphasis (italics) formatting


emphasis_close()   X-Ref
Stop emphasis (italics) formatting


underline_open()   X-Ref
Start underline formatting


underline_close()   X-Ref
Stop underline formatting


monospace_open()   X-Ref
Start monospace formatting


monospace_close()   X-Ref
Stop monospace formatting


subscript_open()   X-Ref
Start a subscript


subscript_close()   X-Ref
Stop a subscript


superscript_open()   X-Ref
Start a superscript


superscript_close()   X-Ref
Stop a superscript


deleted_open()   X-Ref
Start deleted (strike-through) formatting


deleted_close()   X-Ref
Stop deleted (strike-through) formatting


footnote_open()   X-Ref
Start a footnote


footnote_close()   X-Ref
Stop a footnote


listu_open()   X-Ref
Open an unordered list


listu_close()   X-Ref
Close an unordered list


listo_open()   X-Ref
Open an ordered list


listo_close()   X-Ref
Close an ordered list


listitem_open($level,$node=false)   X-Ref
Open a list item

param: int $level the nesting level
param: bool $node true when a node; false when a leaf

listitem_close()   X-Ref
Close a list item


listcontent_open()   X-Ref
Start the content of a list item


listcontent_close()   X-Ref
Stop the content of a list item


unformatted($text)   X-Ref
Output unformatted $text

Defaults to $this->cdata()

param: string $text

php($text)   X-Ref
Output inline PHP code

If $conf['phpok'] is true this should evaluate the given code and append the result
to $doc

param: string $text The PHP code

phpblock($text)   X-Ref
Output block level PHP code

If $conf['phpok'] is true this should evaluate the given code and append the result
to $doc

param: string $text The PHP code

html($text)   X-Ref
Output raw inline HTML

If $conf['htmlok'] is true this should add the code as is to $doc

param: string $text The HTML

htmlblock($text)   X-Ref
Output raw block-level HTML

If $conf['htmlok'] is true this should add the code as is to $doc

param: string $text The HTML

preformatted($text)   X-Ref
Output preformatted text

param: string $text

quote_open()   X-Ref
Start a block quote


quote_close()   X-Ref
Stop a block quote


file($text, $lang = null, $file = null)   X-Ref
Display text as file content, optionally syntax highlighted

param: string $text text to show
param: string $lang programming language to use for syntax highlighting
param: string $file file path label

code($text, $lang = null, $file = null)   X-Ref
Display text as code content, optionally syntax highlighted

param: string $text text to show
param: string $lang programming language to use for syntax highlighting
param: string $file file path label

acronym($acronym)   X-Ref
Format an acronym

Uses $this->acronyms

param: string $acronym

smiley($smiley)   X-Ref
Format a smiley

Uses $this->smiley

param: string $smiley

entity($entity)   X-Ref
Format an entity

Entities are basically small text replacements

Uses $this->entities

param: string $entity

multiplyentity($x, $y)   X-Ref
Typographically format a multiply sign

Example: ($x=640, $y=480) should result in "640×480"

param: string|int $x first value
param: string|int $y second value

singlequoteopening()   X-Ref
Render an opening single quote char (language specific)


singlequoteclosing()   X-Ref
Render a closing single quote char (language specific)


apostrophe()   X-Ref
Render an apostrophe char (language specific)


doublequoteopening()   X-Ref
Render an opening double quote char (language specific)


doublequoteclosing()   X-Ref
Render an closinging double quote char (language specific)


camelcaselink($link)   X-Ref
Render a CamelCase link

see: http://en.wikipedia.org/wiki/CamelCase
param: string $link The link name

locallink($hash, $name = null)   X-Ref
Render a page local link

param: string $hash hash link identifier
param: string $name name for the link

internallink($link, $title = null)   X-Ref
Render a wiki internal link

param: string       $link  page ID to link to. eg. 'wiki:syntax'
param: string|array $title name for the link, array for media file

externallink($link, $title = null)   X-Ref
Render an external link

param: string       $link  full URL with scheme
param: string|array $title name for the link, array for media file

rss($url, $params)   X-Ref
Render the output of an RSS feed

param: string $url    URL of the feed
param: array  $params Finetuning of the output

interwikilink($link, $title, $wikiName, $wikiUri)   X-Ref
Render an interwiki link

You may want to use $this->_resolveInterWiki() here

param: string       $link     original link - probably not much use
param: string|array $title    name for the link, array for media file
param: string       $wikiName indentifier (shortcut) for the remote wiki
param: string       $wikiUri  the fragment parsed from the original link

filelink($link, $title = null)   X-Ref
Link to file on users OS

param: string       $link  the link
param: string|array $title name for the link, array for media file

windowssharelink($link, $title = null)   X-Ref
Link to windows share

param: string       $link  the link
param: string|array $title name for the link, array for media file

emaillink($address, $name = null)   X-Ref
Render a linked E-Mail Address

Should honor $conf['mailguard'] setting

param: string $address Email-Address
param: string|array $name name for the link, array for media file

internalmedia($src, $title = null, $align = null, $width = null,$height = null, $cache = null, $linking = null)   X-Ref
Render an internal media file

param: string $src     media ID
param: string $title   descriptive text
param: string $align   left|center|right
param: int    $width   width of media in pixel
param: int    $height  height of media in pixel
param: string $cache   cache|recache|nocache
param: string $linking linkonly|detail|nolink

externalmedia($src, $title = null, $align = null, $width = null,$height = null, $cache = null, $linking = null)   X-Ref
Render an external media file

param: string $src     full media URL
param: string $title   descriptive text
param: string $align   left|center|right
param: int    $width   width of media in pixel
param: int    $height  height of media in pixel
param: string $cache   cache|recache|nocache
param: string $linking linkonly|detail|nolink

internalmedialink($src, $title = null, $align = null,$width = null, $height = null, $cache = null)   X-Ref
Render a link to an internal media file

param: string $src     media ID
param: string $title   descriptive text
param: string $align   left|center|right
param: int    $width   width of media in pixel
param: int    $height  height of media in pixel
param: string $cache   cache|recache|nocache

externalmedialink($src, $title = null, $align = null,$width = null, $height = null, $cache = null)   X-Ref
Render a link to an external media file

param: string $src     media ID
param: string $title   descriptive text
param: string $align   left|center|right
param: int    $width   width of media in pixel
param: int    $height  height of media in pixel
param: string $cache   cache|recache|nocache

table_open($maxcols = null, $numrows = null, $pos = null)   X-Ref
Start a table

param: int $maxcols maximum number of columns
param: int $numrows NOT IMPLEMENTED
param: int $pos     byte position in the original source

table_close($pos = null)   X-Ref
Close a table

param: int $pos byte position in the original source

tablethead_open()   X-Ref
Open a table header


tablethead_close()   X-Ref
Close a table header


tabletbody_open()   X-Ref
Open a table body


tabletbody_close()   X-Ref
Close a table body


tabletfoot_open()   X-Ref
Open a table footer


tabletfoot_close()   X-Ref
Close a table footer


tablerow_open()   X-Ref
Open a table row


tablerow_close()   X-Ref
Close a table row


tableheader_open($colspan = 1, $align = null, $rowspan = 1)   X-Ref
Open a table header cell

param: int    $colspan
param: string $align left|center|right
param: int    $rowspan

tableheader_close()   X-Ref
Close a table header cell


tablecell_open($colspan = 1, $align = null, $rowspan = 1)   X-Ref
Open a table cell

param: int    $colspan
param: string $align left|center|right
param: int    $rowspan

tablecell_close()   X-Ref
Close a table cell


_headerToLink($title, $create = false)   X-Ref
Creates a linkid from a headline

return: string
param: string  $title   The headline title
param: boolean $create  Create a new unique ID?
author: Andreas Gohr <andi@splitbrain.org>

_simpleTitle($name)   X-Ref
Removes any Namespace from the given name but keeps
casing and special chars

return: string
param: string $name
author: Andreas Gohr <andi@splitbrain.org>

_resolveInterWiki(&$shortcut, $reference, &$exists = null)   X-Ref
Resolve an interwikilink

return: string interwikilink
param: string    $shortcut  identifier for the interwiki link
param: string    $reference fragment that refers the content
param: null|bool $exists    reference which returns if an internal page exists