[Codestriker-commits] CVS update: codestriker/lib/Codestriker/Repository Subversion.pm
Brought to you by:
sits
|
From: <si...@us...> - 2008-06-18 04:47:15
|
User: sits
Date: 08/06/17 21:47:14
Modified: lib/Codestriker/Http DeltaRenderer.pm HighlightLineFilter.pm
LineBreakLineFilter.pm
html codestriker.css
lib/Codestriker/Repository Subversion.pm
Log:
More highlighting changes.
Index: DeltaRenderer.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/DeltaRenderer.pm,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- DeltaRenderer.pm 17 Jun 2008 11:50:59 -0000 1.9
+++ DeltaRenderer.pm 18 Jun 2008 04:47:13 -0000 1.10
@@ -56,11 +56,12 @@
# code to html.
@{$self->{line_filters}} = ();
if (defined $Codestriker::highlighter && $Codestriker::highlighter ne '') {
- push @{$self->{line_filters}}, Codestriker::Http::HighlightLineFilter->new($Codestriker::highlighter);
+ push @{$self->{line_filters}}, Codestriker::Http::HighlightLineFilter->new($Codestriker::highlighter, $tabwidth);
+ push @{$self->{line_filters}}, Codestriker::Http::LineBreakLineFilter->new($brmode, 1);
} else {
push @{$self->{line_filters}}, Codestriker::Http::HtmlEntityLineFilter->new();
push @{$self->{line_filters}}, Codestriker::Http::TabToNbspLineFilter->new($tabwidth);
- push @{$self->{line_filters}}, Codestriker::Http::LineBreakLineFilter->new($brmode);
+ push @{$self->{line_filters}}, Codestriker::Http::LineBreakLineFilter->new($brmode, 0);
my $lxr_config = defined $repository ?
$Codestriker::lxr_map->{$repository->toString()} : undef;
if (defined $lxr_config) {
@@ -108,7 +109,7 @@
# Determine what comment number this anchor refers to.
$comment_number = $comment_location_map{$anchor};
$text = $query->span({-id=>"c$comment_number"}, "") .
- $query->span({-class=>"com"}, $text);
+ $query->span({-class=>"comment"}, $text);
# Determine what the next comment in line is.
my $index = -1;
Index: HighlightLineFilter.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/HighlightLineFilter.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- HighlightLineFilter.pm 17 Jun 2008 11:09:34 -0000 1.2
+++ HighlightLineFilter.pm 18 Jun 2008 04:47:13 -0000 1.3
@@ -21,10 +21,11 @@
# Take the desired tabwidth as a parameter.
sub new {
- my ($type, $highlight) = @_;
+ my ($type, $highlight, $tabwidth) = @_;
my $self = Codestriker::Http::LineFilter->new();
$self->{highlight} = $highlight;
+ $self->{tabwidth} = $tabwidth;
return bless $self, $type;
}
@@ -39,7 +40,7 @@
close $input_text_fh;
# Execute the highlight command, and store the stdout into $read_data.
- my $read_data;
+ my $read_data = "";
my $read_stdout_fh = new FileHandle;
open($read_stdout_fh, '>', \$read_data);
my @args = ();
@@ -47,6 +48,8 @@
push @args, $input_filename;
push @args, '--xhtml';
push @args, '-f';
+ push @args, '-t';
+ push @args, $self->{tabwidth};
Codestriker::execute_command($read_stdout_fh, undef, $self->{highlight}, @args);
# Delete the temp file.
Index: LineBreakLineFilter.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/LineBreakLineFilter.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- LineBreakLineFilter.pm 16 Jun 2008 11:32:05 -0000 1.2
+++ LineBreakLineFilter.pm 18 Jun 2008 04:47:13 -0000 1.3
@@ -19,10 +19,11 @@
# Take the linebreak mode as a parameter.
sub new {
- my ($type, $brmode) = @_;
+ my ($type, $brmode, $inspan) = @_;
my $self = Codestriker::Http::LineFilter->new();
$self->{brmode} = $brmode;
+ $self->{inspan} = $inspan;
return bless $self, $type;
}
@@ -32,10 +33,22 @@
my ($self, $text) = @_;
if ($self->{brmode} == $Codestriker::LINE_BREAK_ASSIST_MODE) {
- $text =~ s/^(\s+)/my $sp='';for(my $i=0;$i<length($1);$i++){$sp.=' '}$sp;/ge;
+ # TODO: fix this for highlighted version.
+ $text =~ s/^(\s+)/my $sp='';for(my $i=0;$i<length($1);$i++){$sp.=' '}$sp;/ge;
}
else {
- $text =~ s/ / /g;
+ if ($self->{inspan}) {
+ my @lines = split /\n/, $text;
+ my $result = "";
+ foreach my $line (@lines) {
+ $line =~ s/^( [ ]+)/(' ' x length($1))/eo;
+ $line =~ s/(>[^<]*?)( [ ]+)/$1 . (' ' x length($2))/eog;
+ $result .= $line . "\n";
+ }
+ $text = $result;
+ } else {
+ $text =~ s/ / /g;
+ }
}
return $text;
Index: codestriker.css
===================================================================
RCS file: /cvsroot/codestriker/codestriker/html/codestriker.css,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- codestriker.css 17 Jun 2008 11:09:35 -0000 1.18
+++ codestriker.css 18 Jun 2008 04:47:14 -0000 1.19
@@ -64,7 +64,7 @@
TD.mscb {background-color: #eeee77; font-family: monospace; font-size: smaller}
/* Line number with comment */
-SPAN.com {color: #ff0000; font-family: Helvetica, Arial; font-size: smaller}
+SPAN.comment {color: #ff0000; font-family: Helvetica, Arial; font-size: smaller}
/* Line number with no comment */
SPAN.nocom {font-family: Helvetica, Arial; font-size: smaller}
@@ -113,7 +113,6 @@
TR.tl2 {background-color: #eeeeee; font-family: Helvetica, Arial}
/* Colour to use for matching identifier */
-/* A.fid {color: #777777; text-decoration: none} */
A.fid:link { color: inherit; text-decoration: none }
A.fid:visited { color: inherit; text-decoration: none }
A.fid:visited:hover { text-decoration: underline; }
@@ -162,18 +161,17 @@
span.obsolete-header {color: red; font-weight: bold;}
/* Styles for highlight program. */
-pre.hl { color:#000000; background-color:#ffffff; font-size:10pt; font-family:'Courier New';}
-.hl.num { color:#2928ff; }
-.hl.esc { color:#ff00ff; }
-.hl.str { color:#ff0000; }
-.hl.dstr { color:#818100; }
-.hl.slc { color:#838183; font-style:italic; }
-.hl.com { color:#838183; font-style:italic; }
+.hl.num { color:#0000ff; }
+.hl.esc { color:#000080; font-weight:bold; }
+.hl.str { color:#008000; }
+.hl.dstr { color:#008000; }
+.hl.slc { color:#008080; }
+.hl.com { color:#008080; }
.hl.dir { color:#008200; }
.hl.sym { color:#000000; }
.hl.line { color:#555555; }
.hl.mark { background-color:#ffffbb;}
-.hl.kwa { color:#000000; font-weight:bold; }
-.hl.kwb { color:#830000; }
-.hl.kwc { color:#000000; font-weight:bold; }
-.hl.kwd { color:#010181; }
\ No newline at end of file
+.hl.kwa { color:#000080; font-weight:bold; }
+.hl.kwb { color:#000080; font-weight:bold; }
+.hl.kwc { color:#000000; }
+.hl.kwd { color:#000000; }
\ No newline at end of file
Index: Subversion.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Repository/Subversion.pm,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- Subversion.pm 13 Jun 2008 05:55:13 -0000 1.20
+++ Subversion.pm 18 Jun 2008 04:47:14 -0000 1.21
@@ -84,6 +84,8 @@
chop;
$$content_array_ref[$i] = $_;
}
+
+ return $Codestriker::OK;
}
# Retrieve the "root" of this repository.
|