From 7863986fad84f56ba537ce3714d614c33391fd85 Mon Sep 17 00:00:00 2001 From: murphy Date: Thu, 23 Mar 2006 00:05:58 +0000 Subject: HTML Encoder: inline numerization corrected. New demo: demo/demo_html_list.rb. Some demos adjusted. C Scanner: error messages fixed. Rakefile: test_demos now in debug mode. test/suite.rb is using reusable Scanners now. --- demo/demo_highlight.out | 4 +- demo/demo_html.out | 4 +- demo/demo_html2.out | 26 +++++----- demo/demo_html_list.out | 128 ++++++++++++++++++++++++++++++++++++++++++++++++ demo/demo_html_list.rb | 12 +++++ demo/demo_more.out | 2 +- 6 files changed, 158 insertions(+), 18 deletions(-) create mode 100644 demo/demo_html_list.out create mode 100644 demo/demo_html_list.rb (limited to 'demo') diff --git a/demo/demo_highlight.out b/demo/demo_highlight.out index 621ccc7..f7a686e 100644 --- a/demo/demo_highlight.out +++ b/demo/demo_highlight.out @@ -106,7 +106,7 @@ ol.CodeRay li { white-space: pre; } - +
-
1
 2
 3
@@ -137,7 +137,7 @@ ol.CodeRay li { white-space: pre; }
 </html>
 HTML
 
+ diff --git a/demo/demo_html.out b/demo/demo_html.out index ac1d8d1..c0efc3c 100644 --- a/demo/demo_html.out +++ b/demo/demo_html.out @@ -108,7 +108,7 @@ ol.CodeRay li { white-space: pre; } - +
-
1
 2
 3
@@ -881,7 +881,7 @@ ol.CodeRay li { white-space: pre; }
 
 end
 
+ diff --git a/demo/demo_html2.out b/demo/demo_html2.out index 01e4bdd..7bcf11f 100644 --- a/demo/demo_html2.out +++ b/demo/demo_html2.out @@ -108,7 +108,7 @@ ol.CodeRay li { white-space: pre; } - +
-
1
 2
 3
@@ -133,19 +133,19 @@ ol.CodeRay li { white-space: pre; }
 
 puts out.page
 
+
-
 8  require 'coderay'
- 9  
-10  # scan this file
-11  tokens = CodeRay.scan(File.read($0) * 1, :ruby)
-12  
-13  # output it with two styles of line numbers
-14  out = tokens.div(:line_numbers => :table)
-15  out << '<hr />'
-16  out << tokens.div(:line_numbers => :inline, :line_number_start => 8)
-17  
-18  puts out.page
+	
 8 require 'coderay'
+ 9 
+10 # scan this file
+11 tokens = CodeRay.scan(File.read($0) * 1, :ruby)
+12 
+13 # output it with two styles of line numbers
+14 out = tokens.div(:line_numbers => :table)
+15 out << '<hr />'
+16 out << tokens.div(:line_numbers => :inline, :line_number_start => 8)
+17 
+18 puts out.page
 
diff --git a/demo/demo_html_list.out b/demo/demo_html_list.out new file mode 100644 index 0000000..e9c99b2 --- /dev/null +++ b/demo/demo_html_list.out @@ -0,0 +1,128 @@ + + + + + CodeRay HTML Encoder Example + + + + +
+
-1 $: << '..'
+ 0 require 'coderay'
+ 1 
+ 2 tokens = CodeRay.scan File.read(__FILE__), :ruby
+ 3 html = tokens.html(:tab_width => 2, :line_numbers => :inline, :line_number_start => -1)
+ 4 
+ 5 puts html.page
+ 6 
+ 7 commment = <<_
+ 8 This code must be > 10 lines
+ 9 because I want to test the correct adjustment of the line numbers.
+10 _
+
+
+ + + diff --git a/demo/demo_html_list.rb b/demo/demo_html_list.rb new file mode 100644 index 0000000..97724f2 --- /dev/null +++ b/demo/demo_html_list.rb @@ -0,0 +1,12 @@ +$: << '..' +require 'coderay' + +tokens = CodeRay.scan File.read(__FILE__), :ruby +html = tokens.html(:tab_width => 2, :line_numbers => :inline, :line_number_start => -1) + +puts html.page + +commment = <<_ +This code must be > 10 lines +because I want to test the correct adjustment of the line numbers. +_ diff --git a/demo/demo_more.out b/demo/demo_more.out index 10f4ec6..f945854 100644 --- a/demo/demo_more.out +++ b/demo/demo_more.out @@ -1,2 +1,2 @@ -Input: 4983B, Output: 22388B +Input: 4983B, Output: 22382B Take a look with your browser. -- cgit v1.2.1