Arbit - project tracking

Arbit - project tracking

API documentation :: Docs For Class HTMLArbitConverter

PhpDoc::Converter::HTMLArbitConverter

Class HTMLArbitConverter

HTML output converter.

HTML output converter. This Converter takes output from the Parser and converts it to HTML-ready output for use with Smarty.

Converter
   |
   --HTMLArbitConverter
Author(s):
Version:   $Revision: 1.15 $

Member Variables

public string $base_dir
target directory passed on the command-line.

target directory passed on the command-line. $targetDir is malleable, always adding package/ and package/subpackage/ subdirectories onto it.

public string $class_dir
output directory for the current class being processed

output directory for the current class being processed

public array $current
contains all of the template procedural page element loop data needed for the current template

contains all of the template procedural page element loop data needed for the current template

public array $currentclass
contains all of the template class element loop data needed for the current template

contains all of the template class element loop data needed for the current template

public boolean $juststarted = false
controls formatting of parser informative output

controls formatting of parser informative output Converter prints: "Converting /path/to/file.php... Procedural Page Elements... Classes..." Since HTMLdefaultConverter outputs files while converting, it needs to send a \n to start a new line. However, if there is more than one class, output is messy, with multiple \n's just between class file output. This variable prevents that and is purely cosmetic

public array $leftindex = array('classes' => true, 'pages' => true, 'functions' => true, 'defines' => false, 'globals' => false)
indexes of elements by package that need to be generated

indexes of elements by package that need to be generated

public string $name = 'Arbit'
public string $outputformat = 'HTML'
public array $package_pages = array()
array of converted package page names.

array of converted package page names. Used to link to the package page in the left index

public string $page_dir
output directory for the current procedural page being processed

output directory for the current procedural page being processed

public boolean $processSpecialRoots = true
This converter knows about the new root tree processing

This converter knows about the new root tree processing In order to fix PEAR Bug #6389

public mixed $ric_set = array()
public boolean $sort_page_contents_by_type = true
Smarty Converter wants elements sorted by type as well as alphabetically

Smarty Converter wants elements sorted by type as well as alphabetically

public mixed $wrote = false

Method Summary

public HTMLArbitConverter HTMLArbitConverter( &$allp , &$packp , &$classes , &$procpages , $po , $pp , $qm , $targetDir , $templateDir , $title )
public void convertClass( &$element )
Converts class for template output
public void convertConst( &$element )
Converts class variables for template output
public void convertDefine( &$element )
Converts defines for template output
public void ConvertErrorLog( )
Create errors. This method takes all parsing errors and warnings and spits them out ordered by file and line number.
public void convertFunction( &$element )
Converts function for template output
public void convertGlobal( &$element )
Converts global variables for template output
public void convertInclude( &$element )
Converts include elements for template output
public void convertMethod( &$element )
Converts class methods for template output
public void convertPackagepage( &$element )
Converts package page and sets its package as used in $package_pages
public void convertPage( &$element )
converts procedural pages for template output
public void ConvertTodoList( )
public void convertTutorial( &$element )
public void convertVar( &$element )
Converts class variables for template output
public void Convert_RIC( $name , $contents )
Convert README/INSTALL/CHANGELOG file contents to output format
public void copyMediaRecursively( $media , $targetdir , [ $subdir = ''] )
public void endClass( )
Writes out the template file of $class_data and unsets the template to save memory
public void endPage( )
Writes out the template file of $page_data and unsets the template to save memory
public void formatIndex( )
HTMLdefaultConverter uses this function to format template index. This function generates the package list from $all_packages, eliminating any packages that don't have any entries in their package index (no files at all, due to @ignore or other factors).
public void formatLeftIndex( )
Generate indexes for li_package. This function generates the li_package. iterating through each of the $page_elements, $class_elements and $function_elements arrays to retrieve the pre-sorted abstractLink descendants needed for index generation. text is done by returnSee().
public void formatPkgIndex( )
HTMLdefaultConverter chooses to format both package indexes and the complete index here
public string formatTutorialTOC( $toc )
Use the template tutorial_toc.
public void generateElementIndex( )
Generate alphabetical index of all elements
public array generateFormattedClassTree( $class )
returns an array containing the class inheritance tree from the root object to the class
public void generateFormattedClassTrees( $package )
returns a template-enabled array of class trees
public void generateFormattedInterfaceTrees( $package )
returns a template-enabled array of interface inheritance trees
public void generatePkgElementIndex( $package )
Generate alphabetical index of all elements by package and subpackage
public void generatePkgElementIndexes( )
public void getCData( $value )
public void getClassContents( )
public void getClassLeft( )
public mixed getClassLink( $expr , $package , [ $file = false] , [ $text = false] , [ $with_a = true] )
public mixed getConstLink( $expr , $class , $package , [ $file = false] , [ $text = false] , 5 )
public void getCurrentPageLink( )
public mixed getDefineLink( $expr , $package , [ $file = false] , [ $text = false] , 4 )
public void getExampleLink( $path , $title )
public mixed getFunctionLink( $expr , $package , [ $file = false] , [ $text = false] , 4 )
public mixed getGlobalLink( $expr , $package , [ $file = false] , [ $text = false] , 4 )
public void getId( $element , [ $fullpath = true] )
public array getIndexInformation( $elt )
Generate indexing information for given element
public mixed getMethodLink( $expr , $class , $package , [ $file = false] , [ $text = false] , 5 )
public void getPageContents( )
public void getPageLeft( )
public mixed getPageLink( $expr , $package , [ $path = false] , [ $text = false] , 4 )
public void getPageName( &$element )
public string getRootTree( $tree , $package , [ $noparent = false] , [ $root = '#root'] , $nounknownparent )
return formatted class tree for the Class Trees page
public string getSourceAnchor( $sourcefile , $anchor , [ $text = ''] , [ $link = false] )
Retrieve a Converter-specific anchor to a segment of a source code file parsed via a tags.
public void getSourceLink( $path )
public void getTutorialId( $package , $subpackage , $tutorial , $id )
public void getTutorialList( )
public void getTutorialTree( $tutorial , [ $k = false] )
public mixed getVarLink( $expr , $class , $package , [ $file = false] , [ $text = false] , 5 )
public void makeLeft( )
public void Output( )
This function is not used by HTMLdefaultConverter, but is required by Converter
public void postProcess( $text )
Uses htmlspecialchars() on the input
public string ProgramExample( $example , [ $tutorial = false] , [ $inlinesourceparse = null] , [ $class = null] , [ $linenum = null] , [ $filesourcepath = null] )
Used to convert the <code> tag in a docblock
public int rcNatCmp( $a , $b )
does a nat case sort on the specified second level value of the array
public int rcNatCmp1( $a , $b )
does a nat case sort on the specified second level value of the array.
public string returnLink( $link , $text )
public void returnSee( &$element , [ $eltext = false] , [ $with_a = true] , 3 )
This function takes an abstractLink descendant and returns an html link
public void setTargetDir( $dir )
calls the converter setTargetDir, and then copies any template images and the stylesheet if they haven't been copied
public void setTemplateDir( $dir )
public void &SmartyInit( &$templ )
public string sourceLine( $linenumber , $line , [ $path = false] )
Return a line of highlighted source code with formatted line number
public void TutorialExample( $example )
public void unmangle( $sourcecode )
public void writeExample( $title , $path , $source )
public void writeNewPPage( $key )
public void writeRIC( )
public void writeSource( $path , $value )

Methods

HTMLArbitConverter

HTMLArbitConverter HTMLArbitConverter( &$allp , &$packp , &$classes , &$procpages , $po , $pp , $qm , $targetDir , $templateDir , $title )
Parameters:
Name Type Description
&$allp
&$packp
&$classes
&$procpages
$po
$pp
$qm
$targetDir
$templateDir
$title

convertClass

void convertClass( parserClass &$element )

Converts class for template output

Converts class for template output

Parameters:
Name Type Description
&$element parserClass

convertConst

void convertConst( parserDefine &$element )

Converts class variables for template output

Converts class variables for template output

Parameters:
Name Type Description
&$element parserDefine

convertDefine

void convertDefine( parserDefine &$element )

Converts defines for template output

Converts defines for template output

Parameters:
Name Type Description
&$element parserDefine

ConvertErrorLog

void ConvertErrorLog( )

Create errors. This method takes all parsing errors and warnings and spits them out ordered by file and line number.

Create errors.html template file output This method takes all parsing errors and warnings and spits them out ordered by file and line number.

convertFunction

void convertFunction( parserFunction &$element )

Converts function for template output

Converts function for template output

Parameters:
Name Type Description
&$element parserFunction

convertGlobal

void convertGlobal( parserGlobal &$element )

Converts global variables for template output

Converts global variables for template output

Parameters:
Name Type Description
&$element parserGlobal

convertInclude

void convertInclude( parserInclude &$element )

Converts include elements for template output

Converts include elements for template output

Parameters:
Name Type Description
&$element parserInclude

convertMethod

void convertMethod( parserDefine &$element )

Converts class methods for template output

Converts class methods for template output

Parameters:
Name Type Description
&$element parserDefine

convertPackagepage

void convertPackagepage( parserPackagePage &$element )

Converts package page and sets its package as used in $package_pages

Converts package page and sets its package as used in $package_pages

Parameters:
Name Type Description
&$element parserPackagePage

convertPage

void convertPage( parserData &$element )

converts procedural pages for template output

converts procedural pages for template output

Parameters:
Name Type Description
&$element parserData

ConvertTodoList

void ConvertTodoList( )

convertTutorial

void convertTutorial( parserTutorial &$element )
Parameters:
Name Type Description
&$element parserTutorial

convertVar

void convertVar( parserDefine &$element )

Converts class variables for template output

Converts class variables for template output

Parameters:
Name Type Description
&$element parserDefine

Convert_RIC

void Convert_RIC( README|INSTALL|CHANGELOG $name , string $contents )

Convert README/INSTALL/CHANGELOG file contents to output format

Convert README/INSTALL/CHANGELOG file contents to output format

Parameters:
Name Type Description
$name README|INSTALL|CHANGELOG
$contents string contents of the file

copyMediaRecursively

void copyMediaRecursively( $media , $targetdir , [ $subdir = ''] )
Parameters:
Name Type Description
$media
$targetdir
$subdir

endClass

void endClass( )

Writes out the template file of $class_data and unsets the template to save memory

Writes out the template file of $class_data and unsets the template to save memory

endPage

void endPage( )

Writes out the template file of $page_data and unsets the template to save memory

Writes out the template file of $page_data and unsets the template to save memory

formatIndex

void formatIndex( )

HTMLdefaultConverter uses this function to format template index. This function generates the package list from $all_packages, eliminating any packages that don't have any entries in their package index (no files at all, due to @ignore or other factors).

HTMLdefaultConverter uses this function to format template index.html and packages.html This function generates the package list from $all_packages, eliminating any packages that don't have any entries in their package index (no files at all, due to @ignore or other factors). Then it uses the default package name as the first package index to display. It sets the right pane to be either a blank file with instructions on making package-level docs, or the package-level docs for the default package.

formatLeftIndex

void formatLeftIndex( )

Generate indexes for li_package. This function generates the li_package. iterating through each of the $page_elements, $class_elements and $function_elements arrays to retrieve the pre-sorted abstractLink descendants needed for index generation. text is done by returnSee().

Generate indexes for li_package.html and classtree output files This function generates the li_package.html files from the template file left.html. It does this by iterating through each of the $page_elements, $class_elements and $function_elements arrays to retrieve the pre-sorted abstractLink descendants needed for index generation. Conversion of these links to text is done by returnSee(). Then it uses generateFormattedClassTrees() to create class trees from the template file classtrees.html. Output filename is classtrees_packagename.html. This function also unsets $elements and $pkg_elements to free up the considerable memory these two class vars use

formatPkgIndex

void formatPkgIndex( )

HTMLdefaultConverter chooses to format both package indexes and the complete index here

HTMLdefaultConverter chooses to format both package indexes and the complete index here This function formats output for the elementindex.html and pkgelementindex.html template files. It then writes them to the target directory

formatTutorialTOC

string formatTutorialTOC( array $toc )

Use the template tutorial_toc.

Use the template tutorial_toc.tpl to generate a table of contents for HTML

Parameters:
Name Type Description
$toc array format: array(array('tagname' => section, 'link' => returnsee link, 'id' => anchor name, 'title' => from title tag),...)

generateElementIndex

void generateElementIndex( )

Generate alphabetical index of all elements

Generate alphabetical index of all elements

generateFormattedClassTree

array generateFormattedClassTree( parserClass $class )

returns an array containing the class inheritance tree from the root object to the class

returns an array containing the class inheritance tree from the root object to the class

Parameters:
Name Type Description
$class parserClass class variable

generateFormattedClassTrees

void generateFormattedClassTrees( string $package )

returns a template-enabled array of class trees

returns a template-enabled array of class trees

Parameters:
Name Type Description
$package string package to generate a class tree for

generateFormattedInterfaceTrees

void generateFormattedInterfaceTrees( string $package )

returns a template-enabled array of interface inheritance trees

returns a template-enabled array of interface inheritance trees

Parameters:
Name Type Description
$package string package to generate a class tree for

generatePkgElementIndex

void generatePkgElementIndex( string $package )

Generate alphabetical index of all elements by package and subpackage

Generate alphabetical index of all elements by package and subpackage

Parameters:
Name Type Description
$package string name of a package

generatePkgElementIndexes

void generatePkgElementIndexes( )

getCData

void getCData( $value )
Parameters:
Name Type Description
$value

getClassContents

void getClassContents( )

getClassLeft

void getClassLeft( )

getClassLink

mixed getClassLink( string $expr , string $package , [string $file = false] , [boolean $text = false] , [boolean $with_a = true] )
Parameters:
Name Type Description
$expr string name of class
$package string package name
$file string full path to look in (used in index generation)
$text boolean deprecated
$with_a boolean return just the URL, or enclose it in an html a tag

getConstLink

mixed getConstLink( string $expr , string $class , string $package , [string $file = false] , [boolean $text = false] , boolean 5 )
Parameters:
Name Type Description
5 boolean return just the URL, or enclose it in an html a tag
$expr string name of class constant
$class string class containing class constant
$package string package name
$file string full path to look in (used in index generation)
$text boolean deprecated

getCurrentPageLink

void getCurrentPageLink( )

getDefineLink

mixed getDefineLink( string $expr , string $package , [string $file = false] , [boolean $text = false] , boolean 4 )
Parameters:
Name Type Description
4 boolean return just the URL, or enclose it in an html a tag
$expr string name of define
$package string package name
$file string full path to look in (used in index generation)
$text boolean deprecated

getExampleLink

void getExampleLink( $path , $title )
Parameters:
Name Type Description
$path
$title

getFunctionLink

mixed getFunctionLink( string $expr , string $package , [string $file = false] , [boolean $text = false] , boolean 4 )
Parameters:
Name Type Description
4 boolean return just the URL, or enclose it in an html a tag
$expr string name of function
$package string package name
$file string full path to look in (used in index generation)
$text boolean deprecated

getGlobalLink

mixed getGlobalLink( string $expr , string $package , [string $file = false] , [boolean $text = false] , boolean 4 )
Parameters:
Name Type Description
4 boolean return just the URL, or enclose it in an html a tag
$expr string name of global variable
$package string package name
$file string full path to look in (used in index generation)
$text boolean deprecated

getId

void getId( $element , [ $fullpath = true] )
Parameters:
Name Type Description
$element
$fullpath

getIndexInformation

array getIndexInformation( parserElement $elt )

Generate indexing information for given element

Generate indexing information for given element

Parameters:
Name Type Description
$elt parserElement descendant of parserElement

getMethodLink

mixed getMethodLink( string $expr , string $class , string $package , [string $file = false] , [boolean $text = false] , boolean 5 )
Parameters:
Name Type Description
5 boolean return just the URL, or enclose it in an html a tag
$expr string name of method
$class string class containing method
$package string package name
$file string full path to look in (used in index generation)
$text boolean deprecated

getPageContents

void getPageContents( )

getPageLeft

void getPageLeft( )

getPageLink

mixed getPageLink( string $expr , string $package , [string $path = false] , [boolean $text = false] , boolean 4 )
Parameters:
Name Type Description
4 boolean return just the URL, or enclose it in an html a tag
$expr string name of procedural page
$package string package name
$path string full path to look in (used in index generation)
$text boolean deprecated

getPageName

void getPageName( &$element )
Parameters:
Name Type Description
&$element

getRootTree

string getRootTree( array $tree , string $package , [ $noparent = false] , [ $root = '#root'] , boolean $nounknownparent )

return formatted class tree for the Class Trees page

return formatted class tree for the Class Trees page

Parameters:
Name Type Description
$tree array output from getSortedClassTreeFromClass()
$package string package
$nounknownparent boolean if true, an object's parent will not be checked
$noparent
$root

getSourceAnchor

string getSourceAnchor( string $sourcefile , string $anchor , [string $text = ''] , [boolean $link = false] )

Retrieve a Converter-specific anchor to a segment of a source code file parsed via a tags.

Retrieve a Converter-specific anchor to a segment of a source code file parsed via a tags.filesource.pkg tag.

Parameters:
Name Type Description
$sourcefile string full path to source file
$anchor string name of anchor
$text string link text, if this is a link
$link boolean returns either a link or a destination based on this parameter

getSourceLink

void getSourceLink( $path )
Parameters:
Name Type Description
$path

getTutorialId

void getTutorialId( $package , $subpackage , $tutorial , $id )
Parameters:
Name Type Description
$package
$subpackage
$tutorial
$id

getTutorialList

void getTutorialList( )

getTutorialTree

void getTutorialTree( $tutorial , [ $k = false] )
Parameters:
Name Type Description
$tutorial
$k

getVarLink

mixed getVarLink( string $expr , string $class , string $package , [string $file = false] , [boolean $text = false] , boolean 5 )
Parameters:
Name Type Description
5 boolean return just the URL, or enclose it in an html a tag
$expr string name of var
$class string class containing var
$package string package name
$file string full path to look in (used in index generation)
$text boolean deprecated

makeLeft

void makeLeft( )

Output

void Output( )

This function is not used by HTMLdefaultConverter, but is required by Converter

This function is not used by HTMLdefaultConverter, but is required by Converter

postProcess

void postProcess( $text )

Uses htmlspecialchars() on the input

Uses htmlspecialchars() on the input

Parameters:
Name Type Description
$text

ProgramExample

string ProgramExample( string $example , [boolean $tutorial = false] , [ $inlinesourceparse = null] , [ $class = null] , [ $linenum = null] , [ $filesourcepath = null] )

Used to convert the <code> tag in a docblock

Used to convert the <code> tag in a docblock

Parameters:
Name Type Description
$example string
$tutorial boolean
$inlinesourceparse
$class
$linenum
$filesourcepath

rcNatCmp

int rcNatCmp( mixed $a , mixed $b )

does a nat case sort on the specified second level value of the array

does a nat case sort on the specified second level value of the array

Parameters:
Name Type Description
$a mixed
$b mixed

rcNatCmp1

int rcNatCmp1( mixed $a , mixed $b )

does a nat case sort on the specified second level value of the array.

does a nat case sort on the specified second level value of the array. this one puts constructors first

Parameters:
Name Type Description
$a mixed
$b mixed

returnLink

string returnLink( string $link , string $text )
Parameters:
Name Type Description
$link string
$text string

returnSee

void returnSee( abstractLink &$element , [string $eltext = false] , [boolean $with_a = true] , boolean 3 )

This function takes an abstractLink descendant and returns an html link

This function takes an abstractLink descendant and returns an html link

Parameters:
Name Type Description
3 boolean determines whether the returned text is enclosed in an &lt;a> tag
&$element abstractLink a descendant of abstractlink should be passed, and never text
$eltext string text to display in the link
$with_a boolean this parameter is not used, and is deprecated

setTargetDir

void setTargetDir( $dir )

calls the converter setTargetDir, and then copies any template images and the stylesheet if they haven't been copied

calls the converter setTargetDir, and then copies any template images and the stylesheet if they haven't been copied

Parameters:
Name Type Description
$dir

setTemplateDir

void setTemplateDir( $dir )
Parameters:
Name Type Description
$dir

SmartyInit

void &SmartyInit( &$templ )
Parameters:
Name Type Description
&$templ

sourceLine

string sourceLine( integer $linenumber , string $line , [false|string $path = false] )

Return a line of highlighted source code with formatted line number

Return a line of highlighted source code with formatted line number If the $path is a full path, then an anchor to the line number will be added as well

Parameters:
Name Type Description
$linenumber integer line number
$line string highlighted source code line
$path false|string full path to @filesource file this line is a part of, if this is a single line from a complete file.

TutorialExample

void TutorialExample( string $example )
Parameters:
Name Type Description
$example string

unmangle

void unmangle( $sourcecode )
Parameters:
Name Type Description
$sourcecode

writeExample

void writeExample( $title , $path , $source )
Parameters:
Name Type Description
$title
$path
$source

writeNewPPage

void writeNewPPage( $key )
Parameters:
Name Type Description
$key

writeRIC

void writeRIC( )

writeSource

void writeSource( $path , $value )
Parameters:
Name Type Description
$path
$value
Documentation generated on Mon, 05 Apr 2010 14:01:58 +0200 by phpDocumentor 1.4.3