1 # Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved.
2 # This program is free software; you can redistribute it and/or
3 # modify it under the same terms as Perl itself.
5 # This file was generated from the 'txt2tags.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
10 #generated: Sun Feb 3 22:02:06 2008, localtime
12 package Syntax::Highlight::Engine::Kate::Txt2tags;
14 our $VERSION = '0.06';
18 use base('Syntax::Highlight::Engine::Kate::Template');
22 my $class = ref($proto) || $proto;
23 my $self = $class->SUPER::new(@_);
27 'BoldItalic' => 'Operator',
28 'Comment' => 'Comment',
30 'DefList' => 'Reserved',
34 'Monospaced' => 'Others',
36 'NumList' => 'Reserved',
37 'Quote' => 'Function',
40 'Verbatim Area' => 'String',
41 'Verbatim Line' => 'String',
45 callback => \&parseContext,
46 attribute => 'Normal',
49 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
50 $self->basecontext('Context');
51 $self->keywordscase(1);
53 bless ($self, $class);
62 my ($self, $text) = @_;
63 # String => '%%date(\(.*\))?'
65 # context => 'Context'
67 if ($self->testRegExpr($text, '%%date(\\(.*\\))?', 0, 0, 0, undef, 0, 'Context', 'Date')) {
71 # attribute => 'Comment'
72 # context => 'Context'
74 if ($self->testRegExpr($text, '%.*', 0, 0, 0, undef, 0, 'Context', 'Comment')) {
77 # String => '\*\*.*\*\*'
79 # context => 'Context'
81 if ($self->testRegExpr($text, '\\*\\*.*\\*\\*', 0, 0, 0, undef, 0, 'Context', 'Bold')) {
85 # attribute => 'Italic'
86 # context => 'Context'
88 if ($self->testRegExpr($text, '//.*//', 0, 0, 0, undef, 0, 'Context', 'Italic')) {
91 # String => '\*\*//.*//\*\*'
92 # attribute => 'BoldItalic'
93 # context => 'Context'
95 if ($self->testRegExpr($text, '\\*\\*//.*//\\*\\*', 0, 0, 0, undef, 0, 'Context', 'BoldItalic')) {
99 # attribute => 'BoldItalic'
100 # context => 'Context'
102 if ($self->testRegExpr($text, '__.*__', 0, 0, 0, undef, 0, 'Context', 'BoldItalic')) {
106 # attribute => 'Monospaced'
107 # context => 'Context'
109 if ($self->testRegExpr($text, '``.*``', 0, 0, 0, undef, 0, 'Context', 'Monospaced')) {
113 # attribute => 'Verbatim Line'
114 # context => 'Context'
116 if ($self->testRegExpr($text, '``` .*', 0, 0, 0, undef, 0, 'Context', 'Verbatim Line')) {
119 # String => ' *=[^=].*[^=]=\s*$'
120 # attribute => 'Title'
122 # context => 'Context'
124 if ($self->testRegExpr($text, ' *=[^=].*[^=]=\\s*$', 0, 0, 0, 0, 0, 'Context', 'Title')) {
127 # String => ' *==[^=].*[^=]==\s*$'
128 # attribute => 'Title'
130 # context => 'Context'
132 if ($self->testRegExpr($text, ' *==[^=].*[^=]==\\s*$', 0, 0, 0, 0, 0, 'Context', 'Title')) {
135 # String => ' *===[^=].*[^=]===\s*$'
136 # attribute => 'Title'
138 # context => 'Context'
140 if ($self->testRegExpr($text, ' *===[^=].*[^=]===\\s*$', 0, 0, 0, 0, 0, 'Context', 'Title')) {
143 # String => ' *====[^=].*[^=]====\s*$'
144 # attribute => 'Title'
146 # context => 'Context'
148 if ($self->testRegExpr($text, ' *====[^=].*[^=]====\\s*$', 0, 0, 0, 0, 0, 'Context', 'Title')) {
151 # String => ' *=====[^=].*[^=]=====\s*$'
152 # attribute => 'Title'
154 # context => 'Context'
156 if ($self->testRegExpr($text, ' *=====[^=].*[^=]=====\\s*$', 0, 0, 0, 0, 0, 'Context', 'Title')) {
159 # String => ' *\+[^=].*[^=]\+\s*$'
160 # attribute => 'Title'
162 # context => 'Context'
164 if ($self->testRegExpr($text, ' *\\+[^=].*[^=]\\+\\s*$', 0, 0, 0, 0, 0, 'Context', 'Title')) {
167 # String => ' *\+\+[^=].*[^=]\+\+\s*$'
168 # attribute => 'Title'
170 # context => 'Context'
172 if ($self->testRegExpr($text, ' *\\+\\+[^=].*[^=]\\+\\+\\s*$', 0, 0, 0, 0, 0, 'Context', 'Title')) {
175 # String => ' *\+\+\+[^=].*[^=]\+\+\+\s*$'
176 # attribute => 'Title'
178 # context => 'Context'
180 if ($self->testRegExpr($text, ' *\\+\\+\\+[^=].*[^=]\\+\\+\\+\\s*$', 0, 0, 0, 0, 0, 'Context', 'Title')) {
183 # String => ' *\+\+\+\+[^=].*[^=]\+\+\+\+\s*$'
184 # attribute => 'Title'
186 # context => 'Context'
188 if ($self->testRegExpr($text, ' *\\+\\+\\+\\+[^=].*[^=]\\+\\+\\+\\+\\s*$', 0, 0, 0, 0, 0, 'Context', 'Title')) {
191 # String => ' *\+\+\+\+\+[^=].*[^=]\+\+\+\+\+\s*$'
192 # attribute => 'Title'
194 # context => 'Context'
196 if ($self->testRegExpr($text, ' *\\+\\+\\+\\+\\+[^=].*[^=]\\+\\+\\+\\+\\+\\s*$', 0, 0, 0, 0, 0, 'Context', 'Title')) {
199 # attribute => 'Link'
202 # type => 'RangeDetect'
203 if ($self->testRangeDetect($text, '[', ']', 0, 0, undef, 0, '#stay', 'Link')) {
206 # String => ' *\|\| .*'
207 # attribute => 'Tabel'
209 # context => 'Context'
211 if ($self->testRegExpr($text, ' *\\|\\| .*', 0, 0, 0, 0, 0, 'Context', 'Tabel')) {
214 # String => ' *\| .*'
215 # attribute => 'Tabel'
217 # context => 'Context'
219 if ($self->testRegExpr($text, ' *\\| .*', 0, 0, 0, 0, 0, 'Context', 'Tabel')) {
222 # String => ' *\: .*'
223 # attribute => 'DefList'
225 # context => 'Context'
227 if ($self->testRegExpr($text, ' *\\: .*', 0, 0, 0, 0, 0, 'Context', 'DefList')) {
230 # String => ' *\- .*'
231 # attribute => 'List'
233 # context => 'Context'
235 if ($self->testRegExpr($text, ' *\\- .*', 0, 0, 0, 0, 0, 'Context', 'List')) {
238 # String => ' *\+ .*'
239 # attribute => 'NumList'
241 # context => 'Context'
243 if ($self->testRegExpr($text, ' *\\+ .*', 0, 0, 0, 0, 0, 'Context', 'NumList')) {
247 # attribute => 'Quote'
248 # context => 'Context'
250 if ($self->testRegExpr($text, '\\t.*', 0, 0, 0, undef, 0, 'Context', 'Quote')) {
253 # String => '\s*([_=-]{20,})\s*$'
255 # context => 'Context'
257 if ($self->testRegExpr($text, '\\s*([_=-]{20,})\\s*$', 0, 0, 0, undef, 0, 'Context', 'Bar')) {
270 Syntax::Highlight::Engine::Kate::Txt2tags - a Plugin for txt2tags syntax highlighting
274 require Syntax::Highlight::Engine::Kate::Txt2tags;
275 my $sh = new Syntax::Highlight::Engine::Kate::Txt2tags([
280 Syntax::Highlight::Engine::Kate::Txt2tags is a plugin module that provides syntax highlighting
281 for txt2tags to the Syntax::Haghlight::Engine::Kate highlighting engine.
283 This code is generated from the syntax definition files used
285 It works quite fine, but can use refinement and optimization.
287 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
293 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
299 Unknown. If you find any, please contact the author