Groffmom/Color.pm

filter: Statementstmt 100% 20 / 20 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 2 totaltotal 92.8% 26 / 28 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Groffmom/Entities.pm ↑ Summary
1 package Pod::Parser::Groffmom::Color;
2  
3 =head1 NAME
4  
5 Pod::Parser::Groffmom - Color formatting for groff -mom.
6  
7 =head1 VERSION
8  
9 Version 0.042
10  
11 =cut
12  
13 7 our $VERSION = '0.042';
14 7 $VERSION = eval $VERSION;
15  
16 7 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
17 7 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
18  
19 7 ▶use base 'Exporter';
Subroutine BEGIN: called CC=1 SCAR=0.0
20 7 our @EXPORT = qw(color_definitions get_highlighter);
21 7 our %EXPORT_TAGS = ( all => \@EXPORT );
22  
23 7 ▶use Syntax::Highlight::Engine::Kate;
Subroutine BEGIN: called CC=1 SCAR=0.0
24  
25 7 ▶sub color_definitions {
Subroutine color_definitions: called CC=1 SCAR=0.0
Pod undocumented
26 7 return <<' END';
27 .NEWCOLOR Alert RGB #0000ff
28 .NEWCOLOR BaseN RGB #007f00
29 .NEWCOLOR BString RGB #c9a7ff
30 .NEWCOLOR Char RGB #ff00ff
31 .NEWCOLOR Comment RGB #7f7f7f
32 .NEWCOLOR DataType RGB #0000ff
33 .NEWCOLOR DecVal RGB #00007f
34 .NEWCOLOR Error RGB #ff0000
35 .NEWCOLOR Float RGB #00007f
36 .NEWCOLOR Function RGB #007f00
37 .NEWCOLOR IString RGB #ff0000
38 .NEWCOLOR Operator RGB #ffa500
39 .NEWCOLOR Others RGB #b03060
40 .NEWCOLOR RegionMarker RGB #96b9ff
41 .NEWCOLOR Reserved RGB #9b30ff
42 .NEWCOLOR String RGB #ff0000
43 .NEWCOLOR Variable RGB #0000ff
44 .NEWCOLOR Warning RGB #0000ff
45 END
46 }
47  
48 1 ▶sub get_highlighter {
Subroutine get_highlighter: called CC=1 SCAR=0.0
Pod undocumented
49 1 my ($language) = @_;
50 1 return Syntax::Highlight::Engine::Kate->new(
51 language => $language,
52 substitutions => { "\\" => "\\\\", },
53 format_table => {
54 Alert => [ "\\*[Alert]", "\\*[black]" ],
55 BaseN => [ "\\*[BaseN]", "\\*[black]" ],
56 BString => [ "\\*[BString]", "\\*[black]" ],
57 Char => [ "\\*[Char]", "\\*[black]" ],
58 Comment => [ "\\*[Comment]\\f[I]", "\\f[P]\\*[black]" ],
59 DataType => [ "\\*[DataType]", "\\*[black]" ],
60 DecVal => [ "\\*[DecVal]", "\\*[black]" ],
61 Error => [ "\\*[Error]\\f[BI]", "\\f[P]\\*[black]" ],
62 Float => [ "\\*[Float]", "\\*[black]" ],
63 Function => [ "\\*[Function]", "\\*[black]" ],
64 IString => [ "\\*[IString]", "" ],
65 Keyword => [ "\\f[B]", "\\f[P]" ],
66 Normal => [ "", "" ],
67 Operator => [ "\\*[Operator]", "\\*[black]" ],
68 Others => [ "\\*[Others]", "\\*[black]" ],
69 RegionMarker => [ "\\*[RegionMarker]\\f[I]", "\\[P]\\*[black]" ],
70 Reserved => [ "\\*[Reserved]\\f[B]", "\\f[P]\\*[black]" ],
71 String => [ "\\*[String]", "\\*[black]" ],
72 Variable => [ "\\*[Variable]\\f[B]", "\\f[P]\\*[black]" ],
73 Warning => [ "\\*[Warning]\\f[BI]", "\\f[P]\\*[black]" ],
74 },
75 );
76 }
77  
78 7 1;
79  
80 __END__
« Groffmom/Entities.pm ↑ Summary