Text_Wiki
[ class tree: Text_Wiki ] [ index: Text_Wiki ] [ all elements ]

Class: Text_Wiki_Parse_Toc

Source Location: /Text_Wiki_Cowiki-0.0.2/Text/Wiki/Parse/Cowiki/Toc.php

Class Overview

Text_Wiki_Parse
   |
   --Text_Wiki_Parse_Toc

Looks through parsed text and builds a table of contents.


Author(s):

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 36]
Looks through parsed text and builds a table of contents.

This class implements a Text_Wiki_Parse to find all heading tokens and build a table of contents. The [[toc]] tag gets replaced with a list of all the level-2 through level-6 headings.



[ Top ]


Class Variables

$regex =  "/\n<toc( [^>]*?)?>\n/m"

[line 52]

The regular expression used to parse the source text and find matches conforming to this rule. Used by the parse() method.
  • See: parse()
  • Access: public

Type:   string


[ Top ]



Method Detail

process   [line 75]

string process( array &$matches)

Generates a replacement for the matched text.

Token options are:

'type' => ['list_start'|'list_end'|'item_start'|'item_end'|'target']

'level' => The heading level (1-6).

'count' => Which entry number this is in the list.

  • Return: A token indicating the TOC collection point.
  • Access: public

Parameters:

array   &$matches   —  The array of matches from parse().

[ Top ]


Documentation generated on Mon, 11 Mar 2019 14:52:58 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.