1 .\" Automatically generated by Pod::Man 2.22 (Pod::Simple 3.10)
4 .\" ========================================================================
5 .de Sp \" Vertical space (when we can't use .PP)
9 .de Vb \" Begin verbatim text
14 .de Ve \" End verbatim text
18 .\" Set up some character translations and predefined strings. \*(-- will
19 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
20 .\" double quote, and \*(R" will give a right double quote. \*(C+ will
21 .\" give a nicer C++. Capital omega is used to do unbreakable dashes and
22 .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
23 .\" nothing in troff, for use with C<>.
25 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
29 . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
30 . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
43 .\" Escape single quotes in literal strings from groff's Unicode transform.
47 .\" If the F register is turned on, we'll generate index entries on stderr for
48 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
49 .\" entries marked with X<> in POD. Of course, you'll have to process the
50 .\" output yourself in some meaningful fashion.
53 . tm Index:\\$1\t\\n%\t"\\$2"
63 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
64 .\" Fear. Run. Save yourself. No user-serviceable parts.
65 . \" fudge factors for nroff and troff
74 . ds #H ((1u-(\\\\n(.fu%2u))*.13m)
80 . \" simple accents for nroff and troff
90 . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
91 . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
92 . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
93 . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
94 . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
95 . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
97 . \" troff and (daisy-wheel) nroff accents
98 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
99 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
100 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
101 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
102 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
103 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
104 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
105 .ds ae a\h'-(\w'a'u*4/10)'e
106 .ds Ae A\h'-(\w'A'u*4/10)'E
107 . \" corrections for vroff
108 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
109 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
110 . \" for low resolution devices (crt and lpr)
111 .if \n(.H>23 .if \n(.V>19 \
124 .\" ========================================================================
126 .IX Title "Syntax::Highlight::Engine::Kate 3"
127 .TH Syntax::Highlight::Engine::Kate 3 "2009-07-23" "perl v5.8.7" "User Contributed Perl Documentation"
128 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
129 .\" way too many mistakes in technical documents.
133 Syntax::Highlight::Engine::Kate \- a port to Perl of the syntax highlight engine of the Kate texteditor.
135 .IX Header "SYNOPSIS"
137 \& #if you want to create a compiled executable, you may want to do this:
138 \& use Syntax::Highlight::Engine::Kate::All;
140 \& use Syntax::Highlight::Engine::Kate;
141 \& my $hl = new Syntax::Highlight::Engine::Kate(
142 \& language => \*(AqPerl\*(Aq,
143 \& substitutions => {
148 \& "\et" => " ",
149 \& "\en" => "<BR>\en",
152 \& Alert => ["<font color=\e"#0000ff\e">", "</font>"],
153 \& BaseN => ["<font color=\e"#007f00\e">", "</font>"],
154 \& BString => ["<font color=\e"#c9a7ff\e">", "</font>"],
155 \& Char => ["<font color=\e"#ff00ff\e">", "</font>"],
156 \& Comment => ["<font color=\e"#7f7f7f\e"><i>", "</i></font>"],
157 \& DataType => ["<font color=\e"#0000ff\e">", "</font>"],
158 \& DecVal => ["<font color=\e"#00007f\e">", "</font>"],
159 \& Error => ["<font color=\e"#ff0000\e"><b><i>", "</i></b></font>"],
160 \& Float => ["<font color=\e"#00007f\e">", "</font>"],
161 \& Function => ["<font color=\e"#007f00\e">", "</font>"],
162 \& IString => ["<font color=\e"#ff0000\e">", ""],
163 \& Keyword => ["<b>", "</b>"],
164 \& Normal => ["", ""],
165 \& Operator => ["<font color=\e"#ffa500\e">", "</font>"],
166 \& Others => ["<font color=\e"#b03060\e">", "</font>"],
167 \& RegionMarker => ["<font color=\e"#96b9ff\e"><i>", "</i></font>"],
168 \& Reserved => ["<font color=\e"#9b30ff\e"><b>", "</b></font>"],
169 \& String => ["<font color=\e"#ff0000\e">", "</font>"],
170 \& Variable => ["<font color=\e"#0000ff\e"><b>", "</b></font>"],
171 \& Warning => ["<font color=\e"#0000ff\e"><b><i>", "</b></i></font>"],
177 \& my $hl = new Syntax::Highlight::Engine::Kate::Perl(
178 \& substitutions => {
183 \& "\et" => " ",
184 \& "\en" => "<BR>\en",
187 \& Alert => ["<font color=\e"#0000ff\e">", "</font>"],
188 \& BaseN => ["<font color=\e"#007f00\e">", "</font>"],
189 \& BString => ["<font color=\e"#c9a7ff\e">", "</font>"],
190 \& Char => ["<font color=\e"#ff00ff\e">", "</font>"],
191 \& Comment => ["<font color=\e"#7f7f7f\e"><i>", "</i></font>"],
192 \& DataType => ["<font color=\e"#0000ff\e">", "</font>"],
193 \& DecVal => ["<font color=\e"#00007f\e">", "</font>"],
194 \& Error => ["<font color=\e"#ff0000\e"><b><i>", "</i></b></font>"],
195 \& Float => ["<font color=\e"#00007f\e">", "</font>"],
196 \& Function => ["<font color=\e"#007f00\e">", "</font>"],
197 \& IString => ["<font color=\e"#ff0000\e">", ""],
198 \& Keyword => ["<b>", "</b>"],
199 \& Normal => ["", ""],
200 \& Operator => ["<font color=\e"#ffa500\e">", "</font>"],
201 \& Others => ["<font color=\e"#b03060\e">", "</font>"],
202 \& RegionMarker => ["<font color=\e"#96b9ff\e"><i>", "</i></font>"],
203 \& Reserved => ["<font color=\e"#9b30ff\e"><b>", "</b></font>"],
204 \& String => ["<font color=\e"#ff0000\e">", "</font>"],
205 \& Variable => ["<font color=\e"#0000ff\e"><b>", "</b></font>"],
206 \& Warning => ["<font color=\e"#0000ff\e"><b><i>", "</b></i></font>"],
211 \& print "<html>\en<head>\en</head>\en<body>\en";
212 \& while (my $in = <>) {
213 \& print $hl\->highlightText($in);
215 \& print "</body>\en</html>\en";
218 .IX Header "DESCRIPTION"
219 Syntax::Highlight::Engine::Kate is a port to perl of the syntax highlight engine of the
222 The language xml files of kate have been rewritten to perl modules using a script. These modules
223 function as plugins to this module.
225 Syntax::Highlight::Engine::Kate inherits Syntax::Highlight::Engine::Kate::Template.
228 .IP "\fBlanguage\fR" 4
230 Specify the language you want highlighted.
231 look in the \fB\s-1PLUGINS\s0\fR section for supported languages.
232 .IP "\fBplugins\fR" 4
234 If you created your own language plugins you may specify a list of them with this option.
238 \& ["MyModuleName", "MyLanguageName", "*,ext1;*.ext2", "Section"],
242 .IP "\fBformat_table\fR" 4
243 .IX Item "format_table"
244 This option must be specified if the \fBhighlightText\fR method needs to do anything usefull for you.
245 All mentioned keys in the synopsis must be specified.
246 .IP "\fBsubstitutions\fR" 4
247 .IX Item "substitutions"
248 With this option you can specify additional formatting options.
251 .IP "\fBextensions\fR" 4
252 .IX Item "extensions"
253 returns a reference to the extensions hash,
254 .IP "\fBlanguage\fR(\fI?$language?\fR)" 4
255 .IX Item "language(?$language?)"
256 Sets and returns the current language that is highlighted. when setting the language a reset is also done.
257 .ie n .IP "\fBlanguageAutoSet\fR(\fI\fI$filename\fI\fR);" 4
258 .el .IP "\fBlanguageAutoSet\fR(\fI\f(CI$filename\fI\fR);" 4
259 .IX Item "languageAutoSet($filename);"
260 Suggests language name for the fiven file \fB\f(CB$filename\fB\fR
261 .IP "\fBlanguageList\fR" 4
262 .IX Item "languageList"
263 returns a list of languages for which plugins have been defined.
264 .ie n .IP "\fBlanguagePlug\fR(\fI\fI$language\fI\fR);" 4
265 .el .IP "\fBlanguagePlug\fR(\fI\f(CI$language\fI\fR);" 4
266 .IX Item "languagePlug($language);"
267 returns the module name of the plugin for \fB\f(CB$language\fB\fR
268 .ie n .IP "\fBlanguagePropose\fR(\fI\fI$filename\fI\fR);" 4
269 .el .IP "\fBlanguagePropose\fR(\fI\f(CI$filename\fI\fR);" 4
270 .IX Item "languagePropose($filename);"
271 Suggests language name for the fiven file \fB\f(CB$filename\fB\fR
272 .IP "\fBsections\fR" 4
274 Returns a reference to the sections hash.
276 .IX Header "ATTRIBUTES"
277 In the kate \s-1XML\s0 syntax files you find under the section \fB<itemDatas\fR> entries like
278 <itemData name=\*(L"Unknown Property\*(R" defStyleNum=\*(L"dsError\*(R" italic=\*(L"1\*(R"/>. Kate is an editor
279 so it is ok to have definitions for forground and background colors and so on. However,
280 since this Module is supposed to be a more universal highlight engine, the attributes need
281 to be fully abstract. In which case, Kate does not have enough default attributes defined
282 to fullfill all needs. Kate defines the following standard attributes: \fBdsNormal\fR, \fBdsKeyword\fR,
283 \&\fBdsDataType\fR, \fBdsDecVal\fR, \fBdsBaseN\fR, \fBdsFloat\fR, \fBdsChar\fR, \fBdsString\fR, \fBdsComment\fR, \fBdsOthers\fR,
284 \&\fBdsAlert\fR, \fBdsFunction\fR, \fBdsRegionMarker\fR, \fBdsError\fR. This module leaves out the \*(L"ds\*(R" part and uses
285 following additional attributes: \fBBString\fR, \fBIString\fR, \fBOperator\fR, \fBReserved\fR, \fBVariable\fR. I have
286 modified the \s-1XML\s0 files so that each highlight mode would get it's own attribute. In quite a few cases
287 still not enough attributes were defined. So in some languages different modes have the same attribute.
290 Below an overview of existing plugins. All have been tested on use and can be created. The ones for which no samplefile
291 is available are marked. Those marked \s-1OK\s0 have highlighted the testfile without appearant mistakes. This does
292 not mean that all bugs are shaken out.
295 \& LANGUAGE MODULE COMMENT
296 \& ******** ****** ******
297 \& .desktop Desktop OK
298 \& 4GL FourGL No sample file
299 \& 4GL\-PER FourGLminusPER No sample file
302 \& ANSI C89 ANSI_C89 No sample file
304 \& AVR Assembler AVR_Assembler OK
306 \& Ada Ada No sample file
307 \& Alerts OK hidden module
308 \& Ansys Ansys No sample file
309 \& Apache Configuration Apache_Configuration No sample file
310 \& Asm6502 Asm6502 No sample file
313 \& C C No sample file
314 \& C# Cdash No sample file
316 \& CGiS CGiS No sample file
319 \& CUE Sheet CUE_Sheet No sample file
320 \& Cg Cg No sample file
321 \& ChangeLog ChangeLog No sample file
322 \& Cisco Cisco No sample file
323 \& Clipper Clipper OK
324 \& ColdFusion ColdFusion No sample file
325 \& Common Lisp Common_Lisp OK
326 \& Component\-Pascal ComponentminusPascal No sample file
327 \& D D No sample file
328 \& Debian Changelog Debian_Changelog No sample file
329 \& Debian Control Debian_Control No sample file
330 \& Diff Diff No sample file
331 \& Doxygen Doxygen OK
332 \& E Language E_Language OK
333 \& Eiffel Eiffel No sample file
335 \& Euphoria Euphoria OK
336 \& Fortran Fortran OK
337 \& FreeBASIC FreeBASIC No sample file
338 \& GDL GDL No sample file
340 \& GNU Assembler GNU_Assembler No sample file
341 \& GNU Gettext GNU_Gettext No sample file
343 \& Haskell Haskell OK
344 \& IDL IDL No sample file
345 \& ILERPG ILERPG No sample file
346 \& INI Files INI_Files No sample file
347 \& Inform Inform No sample file
348 \& Intel x86 (NASM) Intel_X86_NASM seems to have issues
351 \& JavaScript JavaScript OK
352 \& Javadoc Javadoc No sample file
353 \& KBasic KBasic No sample file
354 \& Kate File Template Kate_File_Template No sample file
355 \& LDIF LDIF No sample file
356 \& LPC LPC No sample file
358 \& Lex/Flex Lex_Flex OK
359 \& LilyPond LilyPond OK
360 \& Literate Haskell Literate_Haskell OK
361 \& Lua Lua No sample file
363 \& MAB\-DB MABminusDB No sample file
364 \& MIPS Assembler MIPS_Assembler No sample file
365 \& Makefile Makefile No sample file
366 \& Mason Mason No sample file
367 \& Matlab Matlab has issues
368 \& Modula\-2 Modulaminus2 No sample file
369 \& Music Publisher Music_Publisher No sample file
371 \& PHP (HTML) PHP_HTML OK
372 \& PHP_PHP OK hidden module
373 \& POV\-Ray POV_Ray OK
374 \& Pascal Pascal No sample file
378 \& PostScript PostScript OK
379 \& Prolog Prolog No sample file
380 \& PureBasic PureBasic OK
382 \& Quake Script Quake_Script No sample file
383 \& R Script R_Script No sample file
384 \& REXX REXX No sample file
385 \& RPM Spec RPM_Spec No sample file
386 \& RSI IDL RSI_IDL No sample file
387 \& RenderMan RIB RenderMan_RIB OK
389 \& SGML SGML No sample file
390 \& SML SML No sample file
391 \& SQL SQL No sample file
392 \& SQL (MySQL) SQL_MySQL No sample file
393 \& SQL (PostgreSQL) SQL_PostgreSQL No sample file
394 \& Sather Sather No sample file
396 \& Sieve Sieve No sample file
399 \& TI Basic TI_Basic No sample file
400 \& TaskJuggler TaskJuggler No sample file
402 \& UnrealScript UnrealScript OK
403 \& VHDL VHDL No sample file
405 \& Velocity Velocity No sample file
406 \& Verilog Verilog No sample file
407 \& WINE Config WINE_Config No sample file
408 \& Wikimedia Wikimedia No sample file
410 \& XML (Debug) XML_Debug No sample file
411 \& Yacc/Bison Yacc_Bison OK
412 \& de_DE De_DE No sample file
413 \& en_EN En_EN No sample file
414 \& ferite Ferite No sample file
415 \& nl Nl No sample file
416 \& progress Progress No sample file
417 \& scilab Scilab No sample file
418 \& txt2tags Txt2tags No sample file
419 \& x.org Configuration X_org_Configuration OK
420 \& xHarbour XHarbour OK
421 \& xslt Xslt No sample file
422 \& yacas Yacas No sample file
426 Float is detected differently than in the Kate editor.
428 The regular expression engine of the Kate editor, qregexp, appears to be more tolerant to mistakes
429 in regular expressions than perl. This might lead to error messages and differences in behaviour.
430 Most of the problems were sorted out while developing, because error messages appeared. For as far
431 as differences in behaviour is concerned, testing is the only way to find out, so i hope the users
432 out there will be able to tell me more.
434 This module is mimicking the behaviour of the syntax highlight engine of the Kate editor. If you find
435 a bug/mistake in the highlighting, please check if Kate behaves in the same way. If yes, the cause is
436 likely to be found there.
439 Rebuild the scripts i am using to generate the modules from xml files so they are more pro-actively tracking
440 flaws in the build of the xml files like missing lists. Also regular expressions in the xml can be tested better
441 before used in plugins.
443 Refine the testmethods in Syntax::Highlight::Engine::Kate::Template, so that choices for casesensitivity,
444 dynamic behaviour and lookahead can be determined at generate time of the plugin, might increase throughput.
446 Implement codefolding.
447 .SH "ACKNOWLEDGEMENTS"
448 .IX Header "ACKNOWLEDGEMENTS"
449 All the people who wrote Kate and the syntax highlight xml files.
450 .SH "AUTHOR AND COPYRIGHT"
451 .IX Header "AUTHOR AND COPYRIGHT"
452 This module is written and maintained by:
454 Hans Jeuken < haje at toneel dot demon dot nl >
456 Copyright (c) 2006 by Hans Jeuken, all rights reserved.
458 You may freely distribute and/or modify this module under the same terms
461 .IX Header "SEE ALSO"
462 Synax::Highlight::Engine::Kate::Template http:://www.kate\-editor.org