From a4bd413ca4e835fd3d1fdc24eebce67cd54231ca Mon Sep 17 00:00:00 2001 From: murphy Date: Tue, 30 Sep 2008 16:42:53 +0000 Subject: New: *Simple Diff Scanner* (closes #22). * Highlights unified diffs, especially like the ones svn diff outputs. * Changes to make highlighting of whole lines were necessary. * I added two example files. More changes: * Added token classes :head, :delete, :insert, and :change along with styles. * Added two new special token types: :begin_line and :end_line. They mark token groups that explicitly span whole lines and should be highlighted as such. * The HTML encoder converts these new tokens to DIVs. May need more work. * The Debug Encoder uses square brackets for line tokens. * Some cleanups. --- lib/coderay/styles/cycnus.rb | 10 ++++++++++ lib/coderay/styles/murphy.rb | 10 ++++++++++ 2 files changed, 20 insertions(+) (limited to 'lib/coderay/styles') diff --git a/lib/coderay/styles/cycnus.rb b/lib/coderay/styles/cycnus.rb index b819d52..521c3c9 100644 --- a/lib/coderay/styles/cycnus.rb +++ b/lib/coderay/styles/cycnus.rb @@ -125,6 +125,16 @@ ol.CodeRay li { white-space: pre } .ty { color:#339; font-weight:bold } .v { color:#036 } .xt { color:#444 } + +.ins { background: #afa; } +.del { background: #faa; } +.chg { color: #aaf; background: #007; } +.head { color: #f8f; background: #505 } + +.ins .ins { color: #080; font-weight:bold } +.del .del { color: #800; font-weight:bold } +.chg .chg { color: #66f; } +.head .head { color: #f4f; } TOKENS end diff --git a/lib/coderay/styles/murphy.rb b/lib/coderay/styles/murphy.rb index 15faadb..211ab6b 100644 --- a/lib/coderay/styles/murphy.rb +++ b/lib/coderay/styles/murphy.rb @@ -114,6 +114,16 @@ ol.CodeRay li { white-space: pre; } .ty { color:#339; font-weight:bold; } .v { color:#036; } .xt { color:#444; } + +.ins { background: #afa; } +.del { background: #faa; } +.chg { color: #aaf; background: #007; } +.head { color: #f8f; background: #505 } + +.ins .ins { color: #080; font-weight:bold } +.del .del { color: #800; font-weight:bold } +.chg .chg { color: #66f; } +.head .head { color: #f4f; } TOKENS end -- cgit v1.2.1