File 'lib/htmlFormatter.cls' (part of 'AutoDOC')

Description (short)
Strategy class, produces HTML output
Written by
Andreas Kupries
Description
The strategy class for production of HTML formatted output.
Depends on
cgi

Class 'htmlFormatter'

Depends on
cgi
cgi
Superclasses
genericFormatter
Methods
public
RecordPage (pagefile)
ampersand ()
blockClass (script)
caption (args)
chapter (title)
clear ()
closePage ()
definitionList (script)
defterm (term text)
defterm2 (term)
emph (text)
enumerate (script)
getAnchor (name)
getString (script)
hrule ()
htmlFormatter ()
imgDef (code text geometry imgfile)
imgRef (code)
item (text)
itemize (script)
link (text url)
linkDef (code text url)
linkRef (code)
markError (text)
markVisibility (text)
markWithClass (class text)
newPage (file title firstheading)
par (args)
parbreak ()
preformatted (text)
quote (string)
sample (text)
section (title)
setAnchor (name)
strong (text)
table (args)
table_data (args)
table_head (args)
table_row (args)
write (text)
Membervariables
public
pages
footer

Methods

RecordPage (pagefile)

Internal method used by newPage to keep track of all generated files. Trying to write a file twice causes an exception aborting the engine.
Argument: pagefile The name of the to write.

ampersand ()

Overrides genericFormatter:ampersand
Writes an ampersand (&) into the current page.

blockClass (script)

Overrides genericFormatter:blockClass
Encloses a block of output with a marker for an output class.
Argument: script Script to execute to create the output to enclose in the markers.

caption (args)

Overrides genericFormatter:caption
Executes the specified script (last argument) in the calling context, captures the produced formatted text and organizes it into a table caption. The arguments before the script are interpreted as 'name=value'-style parameterization.
Argument: args A list of 'name=value' parameters and a script to evaluate in the calling context (last element).

chapter (title)

Overrides genericFormatter:chapter
Adds a chapter title to the current page.
Argument: title The text of the title.

clear ()

Overrides genericFormatter:clear
Clear internal state, prepare for new scan.

closePage ()

Overrides genericFormatter:closePage
Completes the generation of the current page

definitionList (script)

Overrides genericFormatter:definitionList
Executes the specified script in the calling context and captures any generated output in a string, which is then formatted as definition list.
Argument: script The tcl code to execute in the calling context.

defterm (term text)

Overrides genericFormatter:defterm
Generates an item in a definition list.
Argument: term The name of the thing to explain.
Argument: text The text explaining the term.

defterm2 (term)

Overrides genericFormatter:defterm2
Generates an item in a definition list.
Argument: term The name of the thing to explain. But without explanation.

emph (text)

Overrides genericFormatter:emph
Adds the appropriate formatting to the given text to make it emphasized, then returns the result.
Argument: text The string to mark as sample.
Returns: The emphasized text.

enumerate (script)

Overrides genericFormatter:enumerate
Executes the specified script in the calling context and captures any generated output in a string, which is then formatted as itemized list.
Argument: script The tcl code to execute in the calling context.

getAnchor (name)

Overrides genericFormatter:getAnchor
Generates a named anchor and returns the HTML to the caller.
Argument: name The name of the generated anchor.
Returns: the HTML string defining the named anchor.

getString (script)

Overrides genericFormatter:getString
Executes the specified script in the calling context and captures any generated output in a string, which is then returned as the result of the call.
Argument: script The tcl code to execute in the calling context.
Returns: a string containing all output produced by the script

hrule ()

Overrides genericFormatter:hrule
Writes a horizontal rule into the current page.

htmlFormatter ()

Constructor, initializes the file extension.

imgDef (code text geometry imgfile)

Overrides genericFormatter:imgDef
Stores an hyperlink to an image under code, allowing later retrieval via imgRef.
Argument: code The identifier for storage and retrieval of the image link.
Argument: text Alternative text describing the contents of the picture.
Argument: geometry A list containing the width and height of the image, in this order. Can be empty. Used to insert geometry information into the link, for better display even if the image is not loaded.
Argument: imgfile The location to point at, i.e. the image file.

imgRef (code)

Overrides genericFormatter:imgRef
Argument: code The identifier for storage and retrieval of the image link.
Returns: the image link generated by imgDef and then stored under code.

item (text)

Overrides genericFormatter:item
Generates an item in an itemized list.
Argument: text The paragraph to format as item in the list.

itemize (script)

Overrides genericFormatter:itemize
Executes the specified script in the calling context and captures any generated output in a string, which is then formatted as itemized list.
Argument: script The tcl code to execute in the calling context.

link (text url)

Overrides genericFormatter:link
Combines its arguments into a hyperlink having the text and pointing to the location specified via url
Argument: text The string to use as textual part of the hyperlink.
Argument: url The location to point at.
Returns: the formatted hyperlink.

linkDef (code text url)

Overrides genericFormatter:linkDef
The same as in link, but the result is stored internally instead, using code as reference.
Argument: code The identifier for storage and retrieval of the hyperlink.
Argument: text The string to use as textual part of the hyperlink.
Argument: url The location to point at.

linkRef (code)

Overrides genericFormatter:linkRef
Argument: code The identifier for storage and retrieval of the hyperlink.
Returns: the hyperlink generated by linkDef and then stored under code.

markError (text)

Overrides genericFormatter:markError
Formats the incoming text as error and returns the modified information.
Argument: text The text to reformat.
Returns: a string containing the given text formatted as error.

markVisibility (text)

Overrides genericFormatter:markVisibility
Formats the incoming text for display as visibility/usage add-on to a variable or method description.
Argument: text The text to reformat.
Returns: a string containing the reformatted text.

markWithClass (class text)

Overrides genericFormatter:markWithClass
Uses the specified output class to mark the given text and returns the marked text.
Argument: class The class to use as marker.
Argument: text The text to mark with an output class.
Returns: Returns the marked text.

newPage (file title firstheading)

Overrides genericFormatter:newPage
Start a new page, implicitly completes the current page.
Argument: file name of file to contain the generated page
Argument: title string to be used as title of the page
Argument: firstheading (= {}) string to use in toplevel heading. Defaults to title. Required to allow hyperlinks in toplevel headings without violating HTML syntax in the title.

par (args)

Overrides genericFormatter:par
Writes a paragraph into the current page, uses all arguments as one string.
Argument: args The text to format and write as paragraph. Actually a list of arguments put together into one string

parbreak ()

Overrides genericFormatter:parbreak
Writes a paragraph break into the current page.

preformatted (text)

Overrides genericFormatter:preformatted
Adds the appropriate formatting to the given text to preserve its exact structure, then returns the result.
Argument: text The string to mark as preformatted text.
Returns: The emphasized text.

quote (string)

Overrides genericFormatter:quote
Takes the specified string, add protective signs to all character (sequences) having special meaning for the formatter and returns the so enhanced text.
Argument: string The string to protect against interpretation by the formatter.
Returns: a string containing no unprotected special character (sequences).

sample (text)

Overrides genericFormatter:sample
Adds the appropriate formatting to the given text to emphasize it as sample program output, then returns the result.
Argument: text The string to mark as sample.
Returns: The emphasized text.

section (title)

Overrides genericFormatter:section
Adds a section title to the current page.
Argument: title The text of the title.

setAnchor (name)

Overrides genericFormatter:setAnchor
Generates a named anchor at the current location in the current page.
Dangers: Usable only in conjunction with cgi 0.7, and not cgi 0.4, as for earlier versions of autodoc.
Argument: name The name of the generated anchor.

strong (text)

Overrides genericFormatter:strong
Adds the appropriate formatting to the given text to emphasize it as strong, then returns the result.
Argument: text The string to mark as strong.
Returns: The emphasized text.

table (args)

Overrides genericFormatter:table
Executes the specified script (last argument) in the calling context, captures the produced formatted text and organizes it into a table. The arguments before the scripts are interpreted as 'name=value'-style parameterization.
Argument: args A list of 'name=value' parameters and a script to evaluate in the calling context (last element).

table_data (args)

Overrides genericFormatter:table_data
Executes the specified script (last argument) in the calling context, captures the produced formatted text and organizes it into a table cell. The arguments before the script are interpreted as 'name=value'-style parameterization.
Argument: args A list of 'name=value' parameters and a script to evaluate in the calling context (last element).

table_head (args)

Overrides genericFormatter:table_head
Executes the specified script (last argument) in the calling context, captures the produced formatted text and organizes it into a table cell formatted as heading. The arguments before the script are interpreted as 'name=value'-style parameterization.
Argument: args A list of 'name=value' parameters and a script to evaluate in the calling context (last element).

table_row (args)

Overrides genericFormatter:table_row
Executes the specified script (last argument) in the calling context, captures the produced formatted text and organizes it into a table row. The arguments before the script are interpreted as 'name=value'-style parameterization.
Argument: args A list of 'name=value' parameters and a script to evaluate in the calling context (last element).

write (text)

Overrides genericFormatter:write
Has to write the specified text into the current page.
Argument: text The string to place into the current page.


Membervariables

pages
Array containing the names of all HTML files generated so far.
footer
Contains the HTML commands to generate the footer line.

Generated by AutoDoc 2.4 at 09/28/2001, invoked by Andreas Kupries,,,