File: hl-kate-convert

package info (click to toggle)
libsyntax-highlight-engine-kate-perl 0.09%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 3,828 kB
  • ctags: 2,233
  • sloc: perl: 84,049; ruby: 176; asm: 166; sh: 162; cpp: 144; jsp: 128; haskell: 116; f90: 99; python: 98; ml: 75; xml: 43; yacc: 37; ansic: 32; tcl: 29; lisp: 24; makefile: 14; awk: 13; php: 5
file content (41 lines) | stat: -rwxr-xr-x 1,085 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/perl -w

# Copyright 2012 Jan Pokorny <jpokorny at redhat dot com>.
# This program is free software; you can redistribute it and/or modify it
# under the terms of either: the GNU General Public License as published
# by the Free Software Foundation; or the Artistic License.

use strict;

use Syntax::Highlight::Engine::Kate::Convert::ToolKit;

my $toolkit = new Syntax::Highlight::Engine::Kate::Convert::ToolKit();

# TODO: optionally redefine bare output to respective files?
# $toolkit->outcmd = sub { ... };

for (@ARGV) {
	my $hlfile = $_;
	my $outfile = $toolkit->register($hlfile);
        print "### ${outfile} ### ";  # comment out the "loading" message
	$toolkit->pmGenerate($outfile);
}

__END__

=head1 NAME

hl-kate-convert - generates highlight definitions from Kate's originals

=head1 DESCRIPTION

C<hl-kate-convert> is a script to convert native highlight definitions
of Kate to the ones used by Syntax::Highlight::Engine::Kate.

=head1 SYNOPSIS

hl-kate-convert <kate-xml-hl-def> [...]

Example:

    hl-kate-convert /some/path/some-lang.xml > SomeLang.pm