Permalink
Browse files

works -- run the file test/create_syntax.rb and you'll get working html

  • Loading branch information...
1 parent 5575f68 commit 182000c9e857676f70585a53765caad15179de9d @daveheitzman committed Mar 25, 2012
Showing with 74 additions and 9 deletions.
  1. +10 −9 test/create_syntax.rb
  2. +64 −0 test/output.html
View
19 test/create_syntax.rb
@@ -10,15 +10,16 @@ def get_syntaxes
@syntaxes
end
-puts get_syntaxes.inspect
- # puts syn= Textpow::SyntaxNode.new( @syntaxes[@syntaxes.keys.first].to_s)
- # puts Uv::syntaxes.inspect
- # puts Uv::syntaxes_hash.inspect
- puts Uv::syntaxes_hash['ruby'].inspect
- #puts syn=( Uv::syntaxes_hash['ruby'] )
+ get_syntaxes
+ Uv::syntaxes_hash['ruby'].inspect
+ syn=( Uv::syntaxes_hash['ruby'] )
processor = Textpow::DebugProcessor.new
- puts syn.respond_to?( :parse).to_s
- puts syn.parse("def myvar ; return 100; end ", processor)
- puts syn.parse(File.read('create_syntax.rb'), processor)
+ syn.parse(File.read('create_syntax.rb'), processor)
+
+ render_str = Uv::get_render_and_css( Plist::parse_xml('./rmt_handicapped_fisherman.tmTheme') )
+ render_processor = Uv::RenderProcessor.new( render_str.first, line_numbers=true, headers=true )
+
+ syn.parse( File.read('create_syntax.rb') , render_processor )
+ puts render_str.last + render_processor.string
View
64 test/output.html
@@ -0,0 +1,64 @@
+<style type="text/css">pre.handicapped_fisherman .MetaSeparator { color: #F113AF;} pre.handicapped_fisherman .MetaPropertyValue { color: #5D6847; font-style: italic;} pre.handicapped_fisherman .String19 { color: #6CF5A2;} pre.handicapped_fisherman .Source { color: #449514;} pre.handicapped_fisherman .EntityOther { color: #485588;} pre.handicapped_fisherman .String { font-weight: bold; color: #8A7F07;} pre.handicapped_fisherman .Constant { color: #E11CE7;} pre.handicapped_fisherman .line-numbers { background-color: #3D3B82; color: #000000;} pre.handicapped_fisherman .StringRegexpCharacterClass { font-weight: bold; color: #35BF34;} pre.handicapped_fisherman .Variable { font-weight: bold; color: #1D8E4B;} pre.handicapped_fisherman .Support { color: #B75F38;} pre.handicapped_fisherman .MarkupList { color: #3BF6F3;} pre.handicapped_fisherman .MetaPreprocessor { color: #D7505D;} pre.handicapped_fisherman .Storage { color: #D2BC52; font-style: italic;} pre.handicapped_fisherman .KeywordOperator { color: #449514;} pre.handicapped_fisherman .MetaLineError {} pre.handicapped_fisherman .Source16 { color: #4E64E2;} pre.handicapped_fisherman .Punctuation {} pre.handicapped_fisherman .MarkupUnderline { color: #1EF9B5;} pre.handicapped_fisherman .Markup { color: #68FF9E;} pre.handicapped_fisherman .MetaPreprocessorAtRule { color: #86F63C;} pre.handicapped_fisherman .InvalidIllegal { color: #3DD12F;} pre.handicapped_fisherman .KeywordControl { color: #B68FCE;} pre.handicapped_fisherman { background-color: #070707; color: #98C83B;} pre.handicapped_fisherman .Markup23 { color: #CB2253;} pre.handicapped_fisherman .MarkupHeading { color: #1BBF5A;} pre.handicapped_fisherman .MetaPropertyGroup { color: #8F50D3;} pre.handicapped_fisherman .SupportConstant { color: #73E8EB;} pre.handicapped_fisherman .StringRegexpGroup { color: #F70478;} pre.handicapped_fisherman .ConstantNumeric { color: #77E6C1;} pre.handicapped_fisherman .MarkupQuote { color: #3BF6F3;} pre.handicapped_fisherman .MetaDiff { color: #68FF9E;} pre.handicapped_fisherman .StorageModifier { color: #B68FCE;} pre.handicapped_fisherman .EntityName { color: #B75F38;} pre.handicapped_fisherman .MarkupInserted { color: #68FF9E;} pre.handicapped_fisherman .SupportType { color: #449514;} pre.handicapped_fisherman .MetaSelectorCss21 { color: #01DC07; font-style: italic;} pre.handicapped_fisherman .Source20 { color: #B68FCE;} pre.handicapped_fisherman .MetaTag { color: #B68FCE;} pre.handicapped_fisherman .SupportFunction { color: #F4928F;} pre.handicapped_fisherman .Text {} pre.handicapped_fisherman .Keyword { color: #B68FCE;} pre.handicapped_fisherman .MetaSelectorCss22 { font-weight: bold; color: #136E9A;} pre.handicapped_fisherman .MetaSelectorCss { color: #9C4AEF;} pre.handicapped_fisherman .EntityOtherAttributeName { color: #1FA0FE;} pre.handicapped_fisherman .MetaSgml { color: #1AF16D;} pre.handicapped_fisherman .StringRegexp18 { font-weight: bold; color: #4CE253;} pre.handicapped_fisherman .StringRegexp { color: #55F3AB; font-style: italic;} pre.handicapped_fisherman .MetaLine {} pre.handicapped_fisherman .MarkupRaw { color: #5AF595; font-style: italic;} pre.handicapped_fisherman .MarkupBold { color: #55F3AB; font-style: italic;} pre.handicapped_fisherman .MetaConstructor { color: #9C4AEF;} pre.handicapped_fisherman .MetaSelector { color: #B68FCE;} pre.handicapped_fisherman .MetaCast { font-weight: bold; color: #99BAE8;} pre.handicapped_fisherman .String17 { color: #4E64E2;} pre.handicapped_fisherman .Invalid { color: #3DD12F;} pre.handicapped_fisherman .MarkupItalic { color: #55F3AB; font-style: italic;} pre.handicapped_fisherman .MarkupChanged { color: #68FF9E;} pre.handicapped_fisherman .EntityNameTag { color: #1EF9B5;} pre.handicapped_fisherman .Meta { color: #BD7919;} pre.handicapped_fisherman .Entity { color: #73E8EB;} pre.handicapped_fisherman .Comment { color: #1274D0;} </style>
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+ <html xmlns="http://www.w3.org/1999/xhtml" lang="en">
+
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
+ <meta http-equiv="cache-control" content="no-cache" />
+ <meta http-equiv="expires" content="3600" />
+ <meta name="revisit-after" content="2 days" />
+ <meta name="robots" content="index,follow" />
+ <meta name="publisher" content="Dichodaemon" />
+ <meta name="copyright" content="Dichodaemon" />
+
+ <meta name="author" content="Dichodaemon" />
+ <meta name="distribution" content="global" />
+ <meta name="description" content="Ocatarinetabellachithchix" />
+ <meta name="keywords" content="arzaversperia flexilimosos toves" />
+ <link rel="stylesheet" type="text/css" media="screen,projection,print" href="css/handicapped_fisherman.css" />
+ <title>handicapped_fisherman</title>
+
+ </head>
+
+ <body>
+ <pre class="handicapped_fisherman"><span class="line-numbers"> 1 </span> <span class="Keyword">require</span> <span class="String"><span class="Punctuation">'</span>rubygems<span class="Punctuation">'</span></span>
+<span class="line-numbers"> 2 </span> <span class="Keyword">require</span> <span class="String"><span class="Punctuation">'</span>textpow<span class="Punctuation">'</span></span>
+<span class="line-numbers"> 3 </span> <span class="Keyword">require</span> <span class="String"><span class="Punctuation">'</span>uv<span class="Punctuation">'</span></span>
+<span class="line-numbers"> 4 </span>
+<span class="line-numbers"> 5 </span> <span class="KeywordControl">def</span> <span class="Entity">get_syntaxes</span>
+<span class="line-numbers"> 6 </span> <span class="Variable"><span class="Punctuation">@</span>syntaxes</span> <span class="KeywordOperator">=</span> <span class="Punctuation">{</span><span class="Punctuation">}</span>
+<span class="line-numbers"> 7 </span> <span class="Support">Dir</span><span class="Punctuation">.</span><span class="Entity">glob</span><span class="Punctuation">(</span> <span class="Support">File</span><span class="Punctuation">.</span><span class="Entity">join</span><span class="Punctuation">(</span><span class="Support">File</span><span class="Punctuation">.</span><span class="Entity">dirname</span><span class="Punctuation">(</span><span class="Variable">__FILE__</span><span class="Punctuation">)</span> <span class="Punctuation">,</span> <span class="String"><span class="Punctuation">'</span>*.plist<span class="Punctuation">'</span></span><span class="Punctuation">)</span> <span class="Punctuation">)</span><span class="Punctuation">.</span><span class="Entity">each</span> <span class="KeywordControl">do </span><span class="Punctuation">|</span><span class="Variable">f</span><span class="Punctuation">|</span>
+<span class="line-numbers"> 8 </span> <span class="Variable"><span class="Punctuation">@</span>syntaxes</span><span class="Punctuation">[</span><span class="Support">File</span><span class="Punctuation">.</span><span class="Entity">basename</span><span class="Punctuation">(</span>f<span class="Punctuation">)</span><span class="Punctuation">]</span> <span class="KeywordOperator">=</span> <span class="Support">Textpow</span><span class="Punctuation">::</span><span class="Entity">SyntaxNode</span><span class="Punctuation">.</span><span class="Entity">load</span><span class="Punctuation">(</span> f <span class="Punctuation">)</span>
+<span class="line-numbers"> 9 </span> <span class="KeywordControl">end</span>
+<span class="line-numbers"> 10 </span> <span class="Variable"><span class="Punctuation">@</span>syntaxes</span>
+<span class="line-numbers"> 11 </span> <span class="KeywordControl">end</span>
+<span class="line-numbers"> 12 </span>
+<span class="line-numbers"> 13 </span> get_syntaxes
+<span class="line-numbers"> 14 </span> <span class="Support">Uv</span><span class="Punctuation">::</span><span class="Entity">syntaxes_hash</span><span class="Punctuation">[</span><span class="String"><span class="Punctuation">'</span>ruby<span class="Punctuation">'</span></span><span class="Punctuation">]</span><span class="Punctuation">.</span><span class="Entity">inspect</span>
+<span class="line-numbers"> 15 </span> syn<span class="KeywordOperator">=</span><span class="Punctuation">(</span> <span class="Support">Uv</span><span class="Punctuation">::</span><span class="Entity">syntaxes_hash</span><span class="Punctuation">[</span><span class="String"><span class="Punctuation">'</span>ruby<span class="Punctuation">'</span></span><span class="Punctuation">]</span> <span class="Punctuation">)</span>
+<span class="line-numbers"> 16 </span> processor <span class="KeywordOperator">=</span> <span class="Support">Textpow</span><span class="Punctuation">::</span><span class="Entity">DebugProcessor</span><span class="Punctuation">.</span><span class="Entity">new</span>
+<span class="line-numbers"> 17 </span>
+<span class="line-numbers"> 18 </span> syn<span class="Punctuation">.</span><span class="Entity">parse</span><span class="Punctuation">(</span><span class="Support">File</span><span class="Punctuation">.</span><span class="Entity">read</span><span class="Punctuation">(</span><span class="String"><span class="Punctuation">'</span>create_syntax.rb<span class="Punctuation">'</span></span><span class="Punctuation">)</span><span class="Punctuation">,</span> processor<span class="Punctuation">)</span>
+<span class="line-numbers"> 19 </span>
+<span class="line-numbers"> 20 </span> render_str <span class="KeywordOperator">=</span> <span class="Support">Uv</span><span class="Punctuation">::</span><span class="Entity">get_render_and_css</span><span class="Punctuation">(</span> <span class="Support">Plist</span><span class="Punctuation">::</span><span class="Entity">parse_xml</span><span class="Punctuation">(</span><span class="String"><span class="Punctuation">'</span>./rmt_handicapped_fisherman.tmTheme<span class="Punctuation">'</span></span><span class="Punctuation">)</span> <span class="Punctuation">)</span>
+<span class="line-numbers"> 21 </span> render_processor <span class="KeywordOperator">=</span> <span class="Support">Uv</span><span class="Punctuation">::</span><span class="Entity">RenderProcessor</span><span class="Punctuation">.</span><span class="Entity">new</span><span class="Punctuation">(</span> render_str<span class="Punctuation">.</span><span class="Entity">first</span><span class="Punctuation">,</span> line_numbers<span class="KeywordOperator">=</span><span class="Constant">true</span><span class="Punctuation">,</span> headers<span class="KeywordOperator">=</span><span class="Constant">true</span> <span class="Punctuation">)</span>
+<span class="line-numbers"> 22 </span>
+<span class="line-numbers"> 23 </span> syn<span class="Punctuation">.</span><span class="Entity">parse</span><span class="Punctuation">(</span> <span class="Support">File</span><span class="Punctuation">.</span><span class="Entity">read</span><span class="Punctuation">(</span><span class="String"><span class="Punctuation">'</span>create_syntax.rb<span class="Punctuation">'</span></span><span class="Punctuation">)</span> <span class="Punctuation">,</span> render_processor <span class="Punctuation">)</span>
+<span class="line-numbers"> 24 </span> puts render_str<span class="Punctuation">.</span><span class="Entity">last</span> <span class="KeywordOperator">+</span> render_processor<span class="Punctuation">.</span><span class="Entity">string</span>
+<span class="line-numbers"> 25 </span>
+</pre>
+ <p>
+ <a href="http://validator.w3.org/check?uri=referer">
+ <img style="border:0"
+ src="http://www.w3.org/Icons/valid-xhtml10"
+ alt="Valid XHTML 1.0 Strict" height="31" width="88" />
+ </a>
+ <a href="http://jigsaw.w3.org/css-validator/check?uri=referer">
+ <img style="border:0;width:88px;height:31px"
+ src="http://jigsaw.w3.org/css-validator/images/vcss"
+ alt="Valid CSS!" />
+ </a>
+ </p>
+ </body>
+ </html>
+

0 comments on commit 182000c

Please sign in to comment.