Commits

Toby Inkster committed da1693c

more effort to sync PPI and Kate output

  • Participants
  • Parent commits a73c5dc

Comments (0)

Files changed (1)

lib/TOBYINK/Pod/HTML.pm

 		is      => 'ro',
 		default => sub {
 			return +{
+				symbol        => 'color:#333;background-color:#fcc',
 				pod           => 'color:#060',
 				comment       => 'color:#060;font-style:italic',
 				operator      => 'color:#000;font-weight:bold',
 				keyword       => 'color:#009;font-weight:bold',
 				core          => 'color:#009;font-weight:bold',
 				line_number   => 'color:#666',
+				# for non-Perl code
+				alert         => 'color:#f00;background-color:#ff0',
+				warning       => 'color:#f00;background-color:#ff0;font-style:italic',
+				error         => 'color:#f00;background-color:#ff0;font-style:italic;font-weight:bold',
+				bstring       => '',
+				function      => '',
+				regionmarker  => '',
+				others        => '',
 			}
 		},
 	);
 				"\n" => "<br />\n",
 			},
 			format_table  => {
+				Normal       => ["", ""],
+				Keyword      => [q[<span class="keyword">],  q[</span>]],
+				DataType     => [q[<span class="cast">],     q[</span>]],
+				DecVal       => [q[<span class="number">],   q[</span>]],
+				BaseN        => [q[<span class="number">],   q[</span>]],
+				Float        => [q[<span class="number">],   q[</span>]],
+				Char         => [q[<span class="single">],   q[</span>]],
+				String       => [q[<span class="single">],   q[</span>]],
+				IString      => [q[<span class="double">],   q[</span>]],
+				Comment      => [q[<span class="comment">],  q[</span>]],
+				Others       => [q[<span class="others">],   q[</span>]],
 				Alert        => [q[<span class="alert">],    q[</span>]],
-				BaseN        => [q[<span class="basen">],    q[</span>]],
+				Function     => [q[<span class="function">], q[</span>]],
+				RegionMarker => [q[<span class="regionmarker">], q[</span>]],
+				Error        => [q[<span class="error">],    q[</span>]],
+				Operator     => [q[<span class="operator">], q[</span>]],
+				Reserved     => [q[<span class="core">],     q[</span>]],
+				Variable     => [q[<span class="symbol">],   q[</span>]],
+				Warning      => [q[<span class="warning">],  q[</span>]],
 				BString      => [q[<span class="bstring">],  q[</span>]],
-				Char         => [q[<span class="single">],   q[</span>]],
-				Comment      => [q[<span class="comment">],  q[</span>]],
-				DataType     => [q[<span class="datatype">], q[</span>]],
-				DecVal       => [q[<span class="number">],   q[</span>]],
-				Error        => [q[<span class="error">],    q[</span>]],
-				Float        => [q[<span class="number">],   q[</span>]],
-				Function     => [q[<span class="function">], q[</span>]],
-				IString      => [q[<span class="double">],   q[</span>]],
-				Keyword      => [q[<span class="keyword">],  q[</span>]],
-				Normal       => ["", ""],
-				Operator     => [q[<span class="operator">], q[</span>]],
-				Others       => [q[<span class="others">],   q[</span>]],
-				RegionMarker => [q[<span class="regionmarker">], q[</span>]],
-				Reserved     => [q[<span class="keyword">],  q[</span>]],
-				String       => [q[<span class="single">],   q[</span>]],
-				Variable     => [q[<span class="variable">], q[</span>]],
-				Warning      => [q[<span class="warning">],  q[</span>]],
 			},
 		);
 		return $hl->highlightText($txt);
 A hashref of CSS styles to assign to highlighted code. The defaults are:
 
    +{
+      symbol        => 'color:#333;background-color:#fcc',
       pod           => 'color:#060',
       comment       => 'color:#060;font-style:italic',
       operator      => 'color:#000;font-weight:bold',
       keyword       => 'color:#009;font-weight:bold',
       core          => 'color:#009;font-weight:bold',
       line_number   => 'color:#666',
+      # for non-Perl code
+      alert         => 'color:#f00;background-color:#ff0',
+      warning       => 'color:#f00;background-color:#ff0;font-style:italic',
+      error         => 'color:#f00;background-color:#ff0;font-style:italic;font-weight:bold',
+      bstring       => '',
+      function      => '',
+      regionmarker  => '',
+      others        => '',
    }
 
 Which looks kind of like the Perl highlighting from SciTE.
 
 =head2 Alternative Syntax Highlighting
 
+=for TOBYINK::Pod::HTML language=Text
+
 This module defines an additional Pod command to change the language for
 syntax highlighting. To tell TOBYINK::Pod::HTML to switch to, say, Haskell
 instead of the default (Perl), just use:
 
-	=for TOBYINK::Pod::HTML language=Haskell
+   =for TOBYINK::Pod::HTML language=Haskell
 
 Then all subsequent code samples will be highlighted as Haskell, until
 another such command is seen.
 The following command can be used to switch to plain text syntax highlighting
 (i.e. no highlighting at all):
 
-	=for TOBYINK::Pod::HTML language=Text
+   =for TOBYINK::Pod::HTML language=Text
+
+=for TOBYINK::Pod::HTML language=Perl
 
 =head1 SEE ALSO