.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "CodeText::Template 3pm" .TH CodeText::Template 3pm "2023-01-03" "perl v5.36.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Tk::CodeText::Template \- a template for syntax highlighting plugins .SH "SYNOPSIS" .IX Header "SYNOPSIS" .SH "DESCRIPTION" .IX Header "DESCRIPTION" Tk::CodeText::Template is a framework to assist authors of plugin modules. All methods to provide highlighting in a Tk::CodeText widget are there, Just no syntax definitions and callbacks. An instance of Tk::CodeText::Template should never be created, it's meant to be sub classed only. .SH "METHODS" .IX Header "METHODS" .IP "\fBcallbacks\fR({\fI'Tagname'\fR => \fI\e&callback\fR, ...});" 4 .IX Item "callbacks({'Tagname' => &callback, ...});" sets and returns the instance variable 'callbacks' .IP "\fBhighlight\fR(\fI\f(CI$text\fI\fR);" 4 .IX Item "highlight($text);" highlights \fI\f(CI$text\fI\fR. It does so by selecting the proper callback from the \fBcommands\fR hash and invoke it. It will do so untill \&\f(CW$text\fR has been reduced to an empty string. .IP "\fBlistAdd\fR(\fI'listname'\fR, \fI\f(CI$item1\fI\fR, \fI\f(CI$item2\fI\fR ...);" 4 .IX Item "listAdd('listname', $item1, $item2 ...);" Adds a list to the 'lists' hash. .IP "\fBlists\fR(\fI?\e%lists?\fR);" 4 .IX Item "lists(?%lists?);" sets and returns the instance variable 'lists'. .IP "\fBout\fR(\fI?\e@highlightedlist?\fR);" 4 .IX Item "out(?@highlightedlist?);" sets and returns the instance variable 'out'. .IP "\fBparserError\fR(\fI'text'\fR);" 4 .IX Item "parserError('text');" Error trapping method. Tries to escape the current mode. If that is not possible, it will parse the text with the default tag. Furthermore it complains about being called at all. Usefull for debugging when writing a new plugin. .IP "\fBrules\fR(\fI?\e@rules?\fR)" 4 .IX Item "rules(?@rules?)" sets and returns a reference to a list of tagnames and options. By default it is set to []. .IP "\fBsnippetAppend\fR(\fI\f(CI$string\fI\fR)" 4 .IX Item "snippetAppend($string)" appends \fI\f(CI$string\fI\fR to the current snippet. .IP "\fBsnippetParse\fR(\fI?$text?\fR, \fI?$tagname?\fR)" 4 .IX Item "snippetParse(?$text?, ?$tagname?)" parses \f(CW$text\fR to the 'out' list, and assigns \f(CW$tagname\fR to it. If \f(CW$tagname\fR is not specified it will look for the tagname by calling \fBstackTop\fR. If \fI\f(CI$text\fI\fR is also not specified it will look for text by calling \fBsnippet\fR. .IP "\fBstack\fR" 4 .IX Item "stack" sets and returns the instance variable 'stack', a reference to an array. .IP "\fBstackPull\fR" 4 .IX Item "stackPull" retrieves the element that is on top of the stack, decrements stacksize by 1. .IP "\fBstackPush\fR(\fI\f(CI$tagname\fI\fR)" 4 .IX Item "stackPush($tagname)" puts \fI\f(CI$tagname\fI\fR on top of the stack, increments stacksize by 1 .IP "\fBstackTop\fR" 4 .IX Item "stackTop" retrieves the element that is on top of the stack. .IP "\fBstateCompare\fR(\fI\e@state\fR);" 4 .IX Item "stateCompare(@state);" Compares two lists, \e@state and the stack. returns true if they match. .IP "\fBstateGet\fR" 4 .IX Item "stateGet" Returns a list containing the entire stack. .IP "\fBstateSet\fR(\fI\f(CI@list\fI\fR)" 4 .IX Item "stateSet(@list)" Accepts \fI\f(CI@list\fI\fR as the current stack. .IP "\fBtokenParse\fR(\fI'Tagname'\fR);" 4 .IX Item "tokenParse('Tagname');" Parses the currently build snippet and tags it with 'Tagname' .IP "\fBtokenTest\fR(\fI\f(CI$value\fI\fR, \fI'Listname'\fR);" 4 .IX Item "tokenTest($value, 'Listname');" returns true if \f(CW$value\fR is and element of 'Listname' in the 'lists' hash .SH "AUTHOR" .IX Header "AUTHOR" Hans Jeuken (haje@toneel.demon.nl) .SH "BUGS" .IX Header "BUGS" Unknown.