Package =TWiki::RenderThis module provides most of the actual HTML rendering code in TWiki.On this page:
ClassMethod new ($session)Creates a new renderer with initial state from preference values (NEWTOPICBGCOLOR, NEWTOPICFONTCOLOR NEWTOPICLINKSYMBOL LINKTOOLTIPINFO)ObjectMethod renderParent ($web,$topic,$meta,$params) -> $text | |||||||||
Added: | |||||||||
> > | |||||||||
Render parent meta-data
ObjectMethod renderMoved ($web,$topic,$meta,$params) -> $text | |||||||||
Added: | |||||||||
> > | |||||||||
Render moved meta-data
ObjectMethod *renderFormField ($web,$topic,$meta,$params) -> $text | |||||||||
Added: | |||||||||
> > | |||||||||
Render meta-data for a single formfield
ObjectMethod makeAnchorName ($anchorName,$compatibilityMode) -> $anchorName
ObjectMethod internalLink ($theWeb,$theTopic,$theLinkText,$theAnchor,$doLink,$doKeepWeb) -> $htmlGenerate a link. | |||||||||
Changed: | |||||||||
< < | SMELL: why can topic be spaced out? is this to support auto squishing of Spaced Topic Naming? and lowercase Spaced Topic Naming | ||||||||
> > | Note: Topic names may be spaced out. Spaced out names are converted to WikWords, for example, "spaced topic name" points to "SpacedTopicName". | ||||||||
ObjectMethod renderFORMFIELD (%params,$topic,$web) -> $htmlReturns the fully rendered expansion of a tag.ObjectMethod *getRenderedVersion ($text,$theWeb,$theTopic) -> $htmlThe main rendering function.StaticMethod *verbatimCallBackCallback for use with putBackBlocks that replaces < and > by their HTML entities < and >ObjectMethod TML2PlainText ($text,$web,$topic,$opts) -> $plainTextClean up TWiki text for display as plain text without pushing it through the full rendering pipeline. Intended for generation of topic and change summaries. Adds nop tags to prevent TWiki subsequent rendering; nops get removed at the very end. Defuses TML. $opts:
ObjectMethod *protectPlainText ($text) -> $tmlProtect plain text from expansions that would normally be done duing rendering, such as wikiwords. Topic summaries, for example, have to be protected this way.ObjectMethod *makeTopicSummary ($theText,$theTopic,$theWeb,$theFlags) -> $tmlMakes a plain text summary of the given topic by simply trimming a bit off the top. Truncates to $TMTRUNC chars or, if a number is specified in $theFlags, to that length.ObjectMethod *takeOutProtected (\$text,$re,\%map) -> $text
ObjectMethod *putBackProtected (\$text,\%map,$tag,$newtag,$callBack) -> $textReturn value: $text with blocks added back
ObjectMethod takeOutBlocks (\$text,$tag,\%map) -> $text
![]() ObjectMethod putBackBlocks (\$text,\%map,$tag,$newtag,$callBack) -> $textReturn value: $text with blocks added back
| |||||||||
Deleted: | |||||||||
< < |
| ||||||||
| |||||||||
Added: | |||||||||
> > |
| ||||||||
ObjectMethod *summariseChanges ($user,$web,$topic,$orev,$nrev,$tml) -> $text | |||||||||
Added: | |||||||||
> > | |||||||||
$tml is not set, all HTML will be removed.
In non-tml, lines are truncated to 70 characters. Differences are shown using + and - to indicate added and removed text.
ObjectMethod forEachLine ($text,\&fn,\%options) -> $newTextIterate over each line, calling\&fn on each.
\%options may contain:
in_pre , in_verbatim and in_noautolink are set boolean TRUE if the line is from one (or more) of those block types.
The return result replaces $line in $newText.
StaticMethod *replaceTopicReferences ($text,\%options) -> $text | |||||||||
Added: | |||||||||
> > | |||||||||
Callback designed for use with forEachLine, to replace topic references.
\%options contains:
StaticMethod *replaceWebReferences ($text,\%options) -> $text | |||||||||
Added: | |||||||||
> > | |||||||||
Callback designed for use with forEachLine, to replace web references.
\%options contains:
ObjectMethod *replaceWebInternalReferences (\$text,\%meta,$oldWeb,$oldTopic)Change within-web wikiwords in $$text and $meta to full web.topic syntax. \%options must include topics => list of topics that must have references to them changed to include the web specifier.StaticMethod *renderFormFieldArg ($meta,$args) -> $textParse the arguments to a $formfield specification and extract the relevant formfield from the given meta data.StaticMethod breakName ($text,$args) -> $text | |||||||||
Added: | |||||||||
> > | |||||||||
|
Package =TWiki::RenderThis module provides most of the actual HTML rendering code in TWiki.On this page:
ClassMethod new ($session)Creates a new renderer with initial state from preference values (NEWTOPICBGCOLOR, NEWTOPICFONTCOLOR NEWTOPICLINKSYMBOL LINKTOOLTIPINFO)ObjectMethod renderParent ($web,$topic,$meta,$params) -> $textRender parent meta-dataObjectMethod renderMoved ($web,$topic,$meta,$params) -> $textRender moved meta-dataObjectMethod *renderFormField ($web,$topic,$meta,$params) -> $textRender meta-data for a single formfieldObjectMethod makeAnchorName ($anchorName,$compatibilityMode) -> $anchorName
ObjectMethod internalLink ($theWeb,$theTopic,$theLinkText,$theAnchor,$doLink,$doKeepWeb) -> $htmlGenerate a link. SMELL: why can topic be spaced out? is this to support auto squishing of Spaced Topic Naming? and lowercase Spaced Topic Naming
ObjectMethod renderFORMFIELD (%params,$topic,$web) -> $htmlReturns the fully rendered expansion of a tag.ObjectMethod *getRenderedVersion ($text,$theWeb,$theTopic) -> $htmlThe main rendering function.StaticMethod *verbatimCallBackCallback for use with putBackBlocks that replaces < and > by their HTML entities < and >ObjectMethod TML2PlainText ($text,$web,$topic,$opts) -> $plainTextClean up TWiki text for display as plain text without pushing it through the full rendering pipeline. Intended for generation of topic and change summaries. Adds nop tags to prevent TWiki subsequent rendering; nops get removed at the very end. Defuses TML. $opts:
ObjectMethod *protectPlainText ($text) -> $tmlProtect plain text from expansions that would normally be done duing rendering, such as wikiwords. Topic summaries, for example, have to be protected this way.ObjectMethod *makeTopicSummary ($theText,$theTopic,$theWeb,$theFlags) -> $tmlMakes a plain text summary of the given topic by simply trimming a bit off the top. Truncates to $TMTRUNC chars or, if a number is specified in $theFlags, to that length.ObjectMethod *takeOutProtected (\$text,$re,\%map) -> $text
ObjectMethod *putBackProtected (\$text,\%map,$tag,$newtag,$callBack) -> $textReturn value: $text with blocks added back
ObjectMethod takeOutBlocks (\$text,$tag,\%map) -> $text
![]() ObjectMethod putBackBlocks (\$text,\%map,$tag,$newtag,$callBack) -> $textReturn value: $text with blocks added back
|