summary refs log tree commit diff stats
path: root/po/cs.po
AgeCommit message (Expand)Author
2013-09-11Update TranslationsTingPing
2013-03-29Update translationsBerke Viktor
2012-11-11Update translationsBerke Viktor
2012-11-10Update translationsBerke Viktor
2012-11-10Update translationsBerke Viktor
2012-11-04Update translationsBerke Viktor
2012-11-04Update translationsBerke Viktor
2012-11-03Update translationsBerke Viktor
2012-11-03Update translationsBerke Viktor
2012-11-03Update translationsBerke Viktor
2012-10-31Update translationsBerke Viktor
2012-10-30Update translation filesBerke Viktor
2012-10-30Update translationsBerke Viktor
2012-10-28Update translationsBerke Viktor
2012-10-25Update translationsBerke Viktor
2012-10-22Update translationsBerke Viktor
2012-10-22Update translationsBerke Viktor
2012-10-20Update translationsBerke Viktor
2012-10-20Finally, update translation files from TransifexBerke Viktor
2012-10-19Regenerate L10n once moar (last time I hope)Berke Viktor
2012-10-19Remove L10n test string from translations tooBerke Viktor
2012-10-19Replace email addressBerke Viktor
2012-10-19Update test strings in repoBerke Viktor
2012-10-19Add Transifex config and update translations from the online resourceBerke Viktor
2012-10-19Update translationsBerke Viktor
2012-10-19Update translationsBerke Viktor
2012-10-19Update translationsBerke Viktor
2012-10-15Huge commit is huge - update translationsBerke Viktor
2012-07-18Replace hardcoded "XChat:" strings in translationsBerke Viktor
2011-02-24add xchat r1489berkeviktor@aol.com
/* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
#!/usr/bin/env perl
use 5.010;
use strict;
use warnings;
use Text::VimColor;
use HTML::TokeParser::Simple;
use HTML::Entities qw(decode_entities);
use Path::Class;

my $html_file = shift;
my $reader = file( $html_file )->openr;
unlink $html_file;
my $writer = file( $html_file )->openw;

my $parser = HTML::TokeParser::Simple->new( $reader );

while( my $token = $parser->get_token ) {

	my $class_name = $token->get_attr( "class" );

	if( $token->is_start_tag( "div" )
		&& ( $class_name && $class_name =~ qr/\bexample\b/ )
	) {
		my $start_tag = $token;
		$start_tag->set_attr( class => $class_name . " synNormal" );
		my @content;
		my $end_tag;
		
		EXAMPLE:
		while( $token = $parser->get_token ) {
			if( $token->is_end_tag( "div" ) ) {
				$end_tag = $token;
				last EXAMPLE;
			}

			if( $token->is_text ) {
				push @content, decode_entities( $token->as_is );
			}
		}

		my $code = join "", @content;
#		say $code;
		my $vim = Text::VimColor->new(
			string => $code,
			filetype => "perl",
			vim_options => [qw( -RXZ -i NONE -u NONE -N -n)],
		);
		my $html = $vim->html;
		$html =~ s/^\s+//;
		$html =~ s/\s+$//;

		print $writer $start_tag->as_is;

		my $lines = $html =~ tr/\n/\n/;

		say $writer "<div class='line_number'>";
		for my $line ( 0 .. $lines ) {
			say $writer "<div>",1 + $line,"</div>";
		}
		say $writer "</div>";

		print $writer "<div class='content'><pre>";
		say $writer $html;
		say $writer "</pre></div>";
		print $writer $end_tag->as_is;
	} else {
		print $writer $token->as_is;
	}
}