codnar 0.1.67 → 0.1.68

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,3 +1,7 @@
1
+ 2011-09-13 Oren Ben-Kiki <github-oren@ben-kiki.org>
2
+
3
+ * Add support for GraphViz documentation.
4
+
1
5
  2011-08-25 Oren Ben-Kiki <github-oren@ben-kiki.org>
2
6
 
3
7
  * Use OLAG for verifying number of arguments.
data/Rakefile CHANGED
@@ -64,6 +64,7 @@ spec = Gem::Specification.new do |spec|
64
64
  into a narrative that describes the overall system.
65
65
  EOF
66
66
  spec.add_dependency("andand")
67
+ spec.add_dependency("coderay")
67
68
  spec.add_dependency("rdiscount")
68
69
  end
69
70
 
data/codnar.html CHANGED
@@ -352,16 +352,6 @@ table.layout td.html {
352
352
  background-color: Beige;
353
353
  }
354
354
 
355
- /* Colors for GVim classes */
356
-
357
- span.Constant { color: Crimson; }
358
- span.Identifier { color: Teal; }
359
- span.PreProc { color: Indigo; }
360
- span.Special { color: Navy; }
361
- span.Statement { color: Maroon; }
362
- span.Type { color: Green; }
363
- span.Comment { color: Purple; }
364
-
365
355
  /* Fonts */
366
356
 
367
357
  body {
@@ -373,6 +363,14 @@ pre {
373
363
  div.chunk.name {
374
364
  font-weight: bold;
375
365
  }
366
+ /* Colors for GVim classes */
367
+ span.Constant { color: Crimson; }
368
+ span.Identifier { color: Teal; }
369
+ span.PreProc { color: Indigo; }
370
+ span.Special { color: Navy; }
371
+ span.Statement { color: Maroon; }
372
+ span.Type { color: Green; }
373
+ span.Comment { color: Purple; }
376
374
  </style>
377
375
  </head>
378
376
  <body>
@@ -687,7 +685,7 @@ number of Git commits by running <tt>rake version</tt>.
687
685
  </tr>
688
686
  </table>
689
687
  <pre class='ruby code syntax'>
690
- <span class="Type">VERSION</span> = <span class="Special">&quot;</span><span class="Constant">0.1.67</span><span class="Special">&quot;</span>
688
+ <span class="Type">VERSION</span> = <span class="Special">&quot;</span><span class="Constant">0.1.68</span><span class="Special">&quot;</span>
691
689
 
692
690
  end
693
691
  </pre>
@@ -2939,16 +2937,16 @@ Test expanding RDoc text.
2939
2937
  <span class="PreProc">class</span> <span class="Type">TestExpandRDoc</span> &lt; <span class="Type">Test</span>::<span class="Type">Unit</span>::<span class="Type">TestCase</span>
2940
2938
 
2941
2939
  <span class="PreProc">def</span> <span class="Identifier">test_emphasis_text</span>
2942
- <span class="Type">RDoc</span>.to_html(<span class="Special">&quot;</span><span class="Constant">_text_</span><span class="Special">&quot;</span>).should == <span class="Special">&quot;</span><span class="Constant">&lt;p&gt;</span><span class="Special">\n</span><span class="Constant">&lt;em&gt;text&lt;/em&gt;</span><span class="Special">\n</span><span class="Constant">&lt;/p&gt;</span><span class="Special">\n</span><span class="Special">&quot;</span>
2940
+ <span class="Type">Codnar</span>::<span class="Type">RDoc</span>.to_html(<span class="Special">&quot;</span><span class="Constant">_text_</span><span class="Special">&quot;</span>).should == <span class="Special">&quot;</span><span class="Constant">&lt;p&gt;</span><span class="Special">\n</span><span class="Constant">&lt;em&gt;text&lt;/em&gt;</span><span class="Special">\n</span><span class="Constant">&lt;/p&gt;</span><span class="Special">\n</span><span class="Special">&quot;</span>
2943
2941
  <span class="PreProc">end</span>
2944
2942
 
2945
2943
  <span class="PreProc">def</span> <span class="Identifier">test_strong_text</span>
2946
- <span class="Type">RDoc</span>.to_html(<span class="Special">&quot;</span><span class="Constant">*text*</span><span class="Special">&quot;</span>).should == <span class="Special">&quot;</span><span class="Constant">&lt;p&gt;</span><span class="Special">\n</span><span class="Constant">&lt;b&gt;text&lt;/b&gt;</span><span class="Special">\n</span><span class="Constant">&lt;/p&gt;</span><span class="Special">\n</span><span class="Special">&quot;</span>
2944
+ <span class="Type">Codnar</span>::<span class="Type">RDoc</span>.to_html(<span class="Special">&quot;</span><span class="Constant">*text*</span><span class="Special">&quot;</span>).should == <span class="Special">&quot;</span><span class="Constant">&lt;p&gt;</span><span class="Special">\n</span><span class="Constant">&lt;b&gt;text&lt;/b&gt;</span><span class="Special">\n</span><span class="Constant">&lt;/p&gt;</span><span class="Special">\n</span><span class="Special">&quot;</span>
2947
2945
  <span class="PreProc">end</span>
2948
2946
 
2949
2947
  <span class="PreProc">def</span> <span class="Identifier">test_indented_pre</span>
2950
- <span class="Type">RDoc</span>.to_html(<span class="Special">&quot;</span><span class="Constant">base</span><span class="Special">\n</span><span class="Constant"> indented</span><span class="Special">\n</span><span class="Constant"> more</span><span class="Special">\n</span><span class="Constant">back</span><span class="Special">\n</span><span class="Special">&quot;</span>).should \
2951
- == <span class="Special">&quot;</span><span class="Constant">&lt;p&gt;</span><span class="Special">\n</span><span class="Constant">base</span><span class="Special">\n</span><span class="Constant">&lt;/p&gt;</span><span class="Special">\n</span><span class="Constant">&lt;pre&gt;</span><span class="Special">\n</span><span class="Constant">indented</span><span class="Special">\n</span><span class="Constant"> more</span><span class="Special">\n</span><span class="Constant">&lt;/pre&gt;</span><span class="Special">\n</span><span class="Constant">&lt;p&gt;</span><span class="Special">\n</span><span class="Constant">back</span><span class="Special">\n</span><span class="Constant">&lt;/p&gt;</span><span class="Special">\n</span><span class="Special">&quot;</span>
2948
+ <span class="Type">Codnar</span>::<span class="Type">RDoc</span>.to_html(<span class="Special">&quot;</span><span class="Constant">base</span><span class="Special">\n</span><span class="Constant"> indented</span><span class="Special">\n</span><span class="Constant"> more</span><span class="Special">\n</span><span class="Constant">back</span><span class="Special">\n</span><span class="Special">&quot;</span>).should \
2949
+ == <span class="Special">&quot;</span><span class="Constant">&lt;p&gt;</span><span class="Special">\n</span><span class="Constant">base</span><span class="Special">\n</span><span class="Constant">&lt;/p&gt;</span><span class="Special">\n</span><span class="Constant">&lt;pre&gt;</span><span class="Special">\n</span><span class="Constant">indented</span><span class="Special">\n</span><span class="Constant"> more</span><span class="Special">\n</span><span class="Constant">&lt;/pre&gt;</span><span class="Special">\n</span><span class="Constant">&lt;p&gt;</span><span class="Special">\n</span><span class="Constant">back</span><span class="Special">\n</span><span class="Constant">&lt;/p&gt;</span><span class="Special">\n</span><span class="Special">&quot;</span>
2952
2950
  <span class="PreProc">end</span>
2953
2951
 
2954
2952
  <span class="PreProc">end</span>
@@ -2967,28 +2965,32 @@ And here is the implementation:
2967
2965
  </a>
2968
2966
  </div>
2969
2967
  <div class="chunk html">
2970
- <table class='layout'>
2968
+ <pre class='ruby code syntax'>
2969
+ <span class="PreProc">module</span> <span class="Type">Codnar</span>
2970
+
2971
+ </pre>
2972
+ <table class='layout'>
2971
2973
  <tr>
2972
2974
  <td class='indentation'>
2973
- <pre></pre>
2975
+ <pre> </pre>
2974
2976
  </td>
2975
2977
  <td class='html'>
2976
2978
  <div class='rdoc comment markup'>
2977
2979
  <p>
2978
- Extend the RDoc module.
2980
+ Convert RDoc to HTML.
2979
2981
  </p>
2980
2982
  </div>
2981
2983
  </td>
2982
2984
  </tr>
2983
2985
  </table>
2984
2986
  <pre class='ruby code syntax'>
2985
- <span class="PreProc">module</span> <span class="Type">RDoc</span>
2987
+ <span class="PreProc">module</span> <span class="Type">RDoc</span>
2986
2988
 
2987
2989
  </pre>
2988
- <table class='layout'>
2990
+ <table class='layout'>
2989
2991
  <tr>
2990
2992
  <td class='indentation'>
2991
- <pre> </pre>
2993
+ <pre> </pre>
2992
2994
  </td>
2993
2995
  <td class='html'>
2994
2996
  <div class='rdoc comment markup'>
@@ -3000,9 +3002,11 @@ Process a RDoc String and return the resulting HTML.
3000
3002
  </tr>
3001
3003
  </table>
3002
3004
  <pre class='ruby code syntax'>
3003
- <span class="PreProc">def</span> <span class="Constant">self</span>.<span class="Identifier">to_html</span>(rdoc)
3004
- <span class="Statement">return</span> ::<span class="Type">RDoc</span>::<span class="Type">Markup</span>::<span class="Type">ToHtml</span>.new.convert(rdoc).clean_markup_html
3005
- <span class="PreProc">end</span>
3005
+ <span class="PreProc">def</span> <span class="Constant">self</span>.<span class="Identifier">to_html</span>(rdoc)
3006
+ <span class="Statement">return</span> ::<span class="Type">RDoc</span>::<span class="Type">Markup</span>::<span class="Type">ToHtml</span>.new.convert(rdoc).clean_markup_html
3007
+ <span class="PreProc">end</span>
3008
+
3009
+ end
3006
3010
 
3007
3011
  end
3008
3012
  </pre>
@@ -3046,23 +3050,23 @@ Test expanding Markdown text.
3046
3050
  <span class="PreProc">class</span> <span class="Type">TestExpandMarkdown</span> &lt; <span class="Type">Test</span>::<span class="Type">Unit</span>::<span class="Type">TestCase</span>
3047
3051
 
3048
3052
  <span class="PreProc">def</span> <span class="Identifier">test_emphasis_text</span>
3049
- <span class="Type">Markdown</span>.to_html(<span class="Special">&quot;</span><span class="Constant">*text*</span><span class="Special">&quot;</span>).should == <span class="Special">&quot;</span><span class="Constant">&lt;p&gt;</span><span class="Special">\n</span><span class="Constant">&lt;em&gt;text&lt;/em&gt;</span><span class="Special">\n</span><span class="Constant">&lt;/p&gt;</span><span class="Special">\n</span><span class="Special">&quot;</span>
3053
+ <span class="Type">Codnar</span>::<span class="Type">Markdown</span>.to_html(<span class="Special">&quot;</span><span class="Constant">*text*</span><span class="Special">&quot;</span>).should == <span class="Special">&quot;</span><span class="Constant">&lt;p&gt;</span><span class="Special">\n</span><span class="Constant">&lt;em&gt;text&lt;/em&gt;</span><span class="Special">\n</span><span class="Constant">&lt;/p&gt;</span><span class="Special">\n</span><span class="Special">&quot;</span>
3050
3054
  <span class="PreProc">end</span>
3051
3055
 
3052
3056
  <span class="PreProc">def</span> <span class="Identifier">test_strong_text</span>
3053
- <span class="Type">Markdown</span>.to_html(<span class="Special">&quot;</span><span class="Constant">**text**</span><span class="Special">&quot;</span>).should == <span class="Special">&quot;</span><span class="Constant">&lt;p&gt;</span><span class="Special">\n</span><span class="Constant">&lt;strong&gt;text&lt;/strong&gt;</span><span class="Special">\n</span><span class="Constant">&lt;/p&gt;</span><span class="Special">\n</span><span class="Special">&quot;</span>
3057
+ <span class="Type">Codnar</span>::<span class="Type">Markdown</span>.to_html(<span class="Special">&quot;</span><span class="Constant">**text**</span><span class="Special">&quot;</span>).should == <span class="Special">&quot;</span><span class="Constant">&lt;p&gt;</span><span class="Special">\n</span><span class="Constant">&lt;strong&gt;text&lt;/strong&gt;</span><span class="Special">\n</span><span class="Constant">&lt;/p&gt;</span><span class="Special">\n</span><span class="Special">&quot;</span>
3054
3058
  <span class="PreProc">end</span>
3055
3059
 
3056
3060
  <span class="PreProc">def</span> <span class="Identifier">test_embed_chunk</span>
3057
- <span class="Type">Markdown</span>.to_html(<span class="Special">&quot;</span><span class="Constant">[[Chunk|template]]</span><span class="Special">&quot;</span>).should == <span class="Special">&quot;</span><span class="Constant">&lt;p&gt;</span><span class="Special">\n</span><span class="Constant">&lt;embed src='chunk' type='x-codnar/template'/&gt;</span><span class="Special">\n</span><span class="Constant">&lt;/p&gt;</span><span class="Special">\n</span><span class="Special">&quot;</span>
3061
+ <span class="Type">Codnar</span>::<span class="Type">Markdown</span>.to_html(<span class="Special">&quot;</span><span class="Constant">[[Chunk|template]]</span><span class="Special">&quot;</span>).should == <span class="Special">&quot;</span><span class="Constant">&lt;p&gt;</span><span class="Special">\n</span><span class="Constant">&lt;embed src='chunk' type='x-codnar/template'/&gt;</span><span class="Special">\n</span><span class="Constant">&lt;/p&gt;</span><span class="Special">\n</span><span class="Special">&quot;</span>
3058
3062
  <span class="PreProc">end</span>
3059
3063
 
3060
3064
  <span class="PreProc">def</span> <span class="Identifier">test_embed_anchor</span>
3061
- <span class="Type">Markdown</span>.to_html(<span class="Special">&quot;</span><span class="Constant">[[#Name]]</span><span class="Special">&quot;</span>).should == <span class="Special">&quot;</span><span class="Constant">&lt;p&gt;</span><span class="Special">\n</span><span class="Constant">&lt;a id='name'/&gt;</span><span class="Special">\n</span><span class="Constant">&lt;/p&gt;</span><span class="Special">\n</span><span class="Special">&quot;</span>
3065
+ <span class="Type">Codnar</span>::<span class="Type">Markdown</span>.to_html(<span class="Special">&quot;</span><span class="Constant">[[#Name]]</span><span class="Special">&quot;</span>).should == <span class="Special">&quot;</span><span class="Constant">&lt;p&gt;</span><span class="Special">\n</span><span class="Constant">&lt;a id='name'/&gt;</span><span class="Special">\n</span><span class="Constant">&lt;/p&gt;</span><span class="Special">\n</span><span class="Special">&quot;</span>
3062
3066
  <span class="PreProc">end</span>
3063
3067
 
3064
3068
  <span class="PreProc">def</span> <span class="Identifier">test_embed_link</span>
3065
- <span class="Type">Markdown</span>.to_html(<span class="Special">&quot;</span><span class="Constant">[Label](#Name)</span><span class="Special">&quot;</span>).should == <span class="Special">&quot;</span><span class="Constant">&lt;p&gt;</span><span class="Special">\n</span><span class="Constant">&lt;a href=\&quot;#name\&quot;&gt;Label&lt;/a&gt;</span><span class="Special">\n</span><span class="Constant">&lt;/p&gt;</span><span class="Special">\n</span><span class="Special">&quot;</span>
3069
+ <span class="Type">Codnar</span>::<span class="Type">Markdown</span>.to_html(<span class="Special">&quot;</span><span class="Constant">[Label](#Name)</span><span class="Special">&quot;</span>).should == <span class="Special">&quot;</span><span class="Constant">&lt;p&gt;</span><span class="Special">\n</span><span class="Constant">&lt;a href=\&quot;#name\&quot;&gt;Label&lt;/a&gt;</span><span class="Special">\n</span><span class="Constant">&lt;/p&gt;</span><span class="Special">\n</span><span class="Special">&quot;</span>
3066
3070
  <span class="PreProc">end</span>
3067
3071
 
3068
3072
  <span class="PreProc">end</span>
@@ -3081,28 +3085,32 @@ And here is the implementation:
3081
3085
  </a>
3082
3086
  </div>
3083
3087
  <div class="chunk html">
3084
- <table class='layout'>
3088
+ <pre class='ruby code syntax'>
3089
+ <span class="PreProc">module</span> <span class="Type">Codnar</span>
3090
+
3091
+ </pre>
3092
+ <table class='layout'>
3085
3093
  <tr>
3086
3094
  <td class='indentation'>
3087
- <pre></pre>
3095
+ <pre> </pre>
3088
3096
  </td>
3089
3097
  <td class='html'>
3090
3098
  <div class='rdoc comment markup'>
3091
3099
  <p>
3092
- Extend the Markdown class.
3100
+ Convert Markdown to HTML.
3093
3101
  </p>
3094
3102
  </div>
3095
3103
  </td>
3096
3104
  </tr>
3097
3105
  </table>
3098
3106
  <pre class='ruby code syntax'>
3099
- <span class="PreProc">class</span> <span class="Type">Markdown</span>
3107
+ <span class="PreProc">module</span> <span class="Type">Markdown</span>
3100
3108
 
3101
3109
  </pre>
3102
- <table class='layout'>
3110
+ <table class='layout'>
3103
3111
  <tr>
3104
3112
  <td class='indentation'>
3105
- <pre> </pre>
3113
+ <pre> </pre>
3106
3114
  </td>
3107
3115
  <td class='html'>
3108
3116
  <div class='rdoc comment markup'>
@@ -3134,21 +3142,21 @@ above.
3134
3142
  </tr>
3135
3143
  </table>
3136
3144
  <pre class='ruby code syntax'>
3137
- <span class="PreProc">def</span> <span class="Constant">self</span>.<span class="Identifier">to_html</span>(markdown)
3138
- markdown = <span class="Type">Markdown</span>.embed_chunks(markdown)
3139
- markdown = <span class="Type">Markdown</span>.id_anchors(markdown)
3140
- html = <span class="Type">RDiscount</span>.new(markdown).to_html
3141
- html = <span class="Type">Markdown</span>.id_links(html)
3142
- <span class="Statement">return</span> html.clean_markup_html
3143
- <span class="PreProc">end</span>
3145
+ <span class="PreProc">def</span> <span class="Constant">self</span>.<span class="Identifier">to_html</span>(markdown)
3146
+ markdown = embed_chunks(markdown)
3147
+ markdown = id_anchors(markdown)
3148
+ html = <span class="Type">RDiscount</span>.new(markdown).to_html
3149
+ html = id_links(html)
3150
+ <span class="Statement">return</span> html.clean_markup_html
3151
+ <span class="PreProc">end</span>
3144
3152
 
3145
- <span class="Statement">protected</span>
3153
+ <span class="Statement">protected</span>
3146
3154
 
3147
3155
  </pre>
3148
- <table class='layout'>
3156
+ <table class='layout'>
3149
3157
  <tr>
3150
3158
  <td class='indentation'>
3151
- <pre> </pre>
3159
+ <pre> </pre>
3152
3160
  </td>
3153
3161
  <td class='html'>
3154
3162
  <div class='rdoc comment markup'>
@@ -3162,20 +3170,20 @@ magical file template, in which case we must preserve the file path.
3162
3170
  </tr>
3163
3171
  </table>
3164
3172
  <pre class='ruby code syntax'>
3165
- <span class="PreProc">def</span> <span class="Constant">self</span>.<span class="Identifier">embed_chunks</span>(markdown)
3166
- <span class="Statement">return</span> markdown.gsub(<span class="Special">/</span><span class="Special">\[\[</span><span class="Special">(</span><span class="Special">.</span><span class="Special">*?</span><span class="Special">)</span><span class="Special">\|</span><span class="Special">(</span><span class="Special">.</span><span class="Special">*?</span><span class="Special">)</span><span class="Special">\]\]</span><span class="Special">/</span>) <span class="Statement">do</span>
3167
- src = <span class="Identifier">$1</span>
3168
- template = <span class="Identifier">$2</span>
3169
- src = src.to_id <span class="Statement">unless</span> <span class="Type">Codnar</span>::<span class="Type">Weaver</span>::<span class="Type">FILE_TEMPLATE_PROCESSORS</span>.include?(template)
3170
- <span class="Special">&quot;</span><span class="Constant">&lt;embed src='</span><span class="Special">#{</span>src<span class="Special">}</span><span class="Constant">' type='x-codnar/</span><span class="Special">#{</span>template<span class="Special">}</span><span class="Constant">'/&gt;</span><span class="Special">&quot;</span>
3171
- <span class="Statement">end</span>
3172
- <span class="PreProc">end</span>
3173
+ <span class="PreProc">def</span> <span class="Constant">self</span>.<span class="Identifier">embed_chunks</span>(markdown)
3174
+ <span class="Statement">return</span> markdown.gsub(<span class="Special">/</span><span class="Special">\[\[</span><span class="Special">(</span><span class="Special">.</span><span class="Special">*?</span><span class="Special">)</span><span class="Special">\|</span><span class="Special">(</span><span class="Special">.</span><span class="Special">*?</span><span class="Special">)</span><span class="Special">\]\]</span><span class="Special">/</span>) <span class="Statement">do</span>
3175
+ src = <span class="Identifier">$1</span>
3176
+ template = <span class="Identifier">$2</span>
3177
+ src = src.to_id <span class="Statement">unless</span> <span class="Type">Codnar</span>::<span class="Type">Weaver</span>::<span class="Type">FILE_TEMPLATE_PROCESSORS</span>.include?(template)
3178
+ <span class="Special">&quot;</span><span class="Constant">&lt;embed src='</span><span class="Special">#{</span>src<span class="Special">}</span><span class="Constant">' type='x-codnar/</span><span class="Special">#{</span>template<span class="Special">}</span><span class="Constant">'/&gt;</span><span class="Special">&quot;</span>
3179
+ <span class="Statement">end</span>
3180
+ <span class="PreProc">end</span>
3173
3181
 
3174
3182
  </pre>
3175
- <table class='layout'>
3183
+ <table class='layout'>
3176
3184
  <tr>
3177
3185
  <td class='indentation'>
3178
- <pre> </pre>
3186
+ <pre> </pre>
3179
3187
  </td>
3180
3188
  <td class='html'>
3181
3189
  <div class='rdoc comment markup'>
@@ -3188,15 +3196,15 @@ identifier.
3188
3196
  </tr>
3189
3197
  </table>
3190
3198
  <pre class='ruby code syntax'>
3191
- <span class="PreProc">def</span> <span class="Constant">self</span>.<span class="Identifier">id_anchors</span>(markdown)
3192
- <span class="Statement">return</span> markdown.gsub(<span class="Special">/</span><span class="Special">\[\[</span><span class="Constant">#</span><span class="Special">(</span><span class="Special">.</span><span class="Special">*?</span><span class="Special">)</span><span class="Special">\]\]</span><span class="Special">/</span>) { <span class="Special">&quot;</span><span class="Constant">&lt;a id='</span><span class="Special">#{</span><span class="Identifier">$1</span>.to_id<span class="Special">}</span><span class="Constant">'/&gt;</span><span class="Special">&quot;</span> }
3193
- <span class="PreProc">end</span>
3199
+ <span class="PreProc">def</span> <span class="Constant">self</span>.<span class="Identifier">id_anchors</span>(markdown)
3200
+ <span class="Statement">return</span> markdown.gsub(<span class="Special">/</span><span class="Special">\[\[</span><span class="Constant">#</span><span class="Special">(</span><span class="Special">.</span><span class="Special">*?</span><span class="Special">)</span><span class="Special">\]\]</span><span class="Special">/</span>) { <span class="Special">&quot;</span><span class="Constant">&lt;a id='</span><span class="Special">#{</span><span class="Identifier">$1</span>.to_id<span class="Special">}</span><span class="Constant">'/&gt;</span><span class="Special">&quot;</span> }
3201
+ <span class="PreProc">end</span>
3194
3202
 
3195
3203
  </pre>
3196
- <table class='layout'>
3204
+ <table class='layout'>
3197
3205
  <tr>
3198
3206
  <td class='indentation'>
3199
- <pre> </pre>
3207
+ <pre> </pre>
3200
3208
  </td>
3201
3209
  <td class='html'>
3202
3210
  <div class='rdoc comment markup'>
@@ -3209,9 +3217,11 @@ links.
3209
3217
  </tr>
3210
3218
  </table>
3211
3219
  <pre class='ruby code syntax'>
3212
- <span class="PreProc">def</span> <span class="Constant">self</span>.<span class="Identifier">id_links</span>(html)
3213
- <span class="Statement">return</span> html.gsub(<span class="Special">/</span><span class="Constant">href=</span><span class="Special">(</span><span class="Special">[</span><span class="Constant">&quot;'</span><span class="Special">]</span><span class="Special">)</span><span class="Constant">#</span><span class="Special">(</span><span class="Special">.</span><span class="Special">*?</span><span class="Special">)(</span><span class="Special">[</span><span class="Constant">&quot;'</span><span class="Special">]</span><span class="Special">)</span><span class="Special">/</span>) { <span class="Special">&quot;</span><span class="Constant">href=</span><span class="Special">#{</span><span class="Identifier">$1</span><span class="Special">}</span><span class="Constant">#</span><span class="Special">#{</span><span class="Identifier">$2</span>.to_id<span class="Special">}#{</span><span class="Identifier">$3</span><span class="Special">}</span><span class="Special">&quot;</span> }
3214
- <span class="PreProc">end</span>
3220
+ <span class="PreProc">def</span> <span class="Constant">self</span>.<span class="Identifier">id_links</span>(html)
3221
+ <span class="Statement">return</span> html.gsub(<span class="Special">/</span><span class="Constant">href=</span><span class="Special">(</span><span class="Special">[</span><span class="Constant">&quot;'</span><span class="Special">]</span><span class="Special">)</span><span class="Constant">#</span><span class="Special">(</span><span class="Special">.</span><span class="Special">*?</span><span class="Special">)(</span><span class="Special">[</span><span class="Constant">&quot;'</span><span class="Special">]</span><span class="Special">)</span><span class="Special">/</span>) { <span class="Special">&quot;</span><span class="Constant">href=</span><span class="Special">#{</span><span class="Identifier">$1</span><span class="Special">}</span><span class="Constant">#</span><span class="Special">#{</span><span class="Identifier">$2</span>.to_id<span class="Special">}#{</span><span class="Identifier">$3</span><span class="Special">}</span><span class="Special">&quot;</span> }
3222
+ <span class="PreProc">end</span>
3223
+
3224
+ end
3215
3225
 
3216
3226
  end
3217
3227
  </pre>
@@ -3394,8 +3404,6 @@ And here is the implementation:
3394
3404
  </div>
3395
3405
  <div class="chunk html">
3396
3406
  <pre class='ruby code syntax'>
3397
- <span class="PreProc">require</span> <span class="Special">&quot;</span><span class="Constant">open3</span><span class="Special">&quot;</span>
3398
-
3399
3407
  <span class="PreProc">module</span> <span class="Type">Codnar</span>
3400
3408
 
3401
3409
  </pre>
@@ -3517,11 +3525,11 @@ end
3517
3525
  </p>
3518
3526
  <h4>Syntax highlighting using GVIM</h4>
3519
3527
  <p>
3520
- If you have <code>gvim</code> istalled, it is possible to use it to generate syntax
3521
- highlighting. This is a <em>slow</em> operation, as <code>gvim</code> was never meant to be used
3522
- as a command-line tool. However, what it lacks in speed it compensates for in
3523
- scope; almost any language you can think of has a <code>gvim</code> syntax highlighting
3524
- definition. Here is a simple test that demonstrates using <code>gvim</code> for syntax
3528
+ If you have GVim istalled, it is possible to use it to generate syntax
3529
+ highlighting. This is a <em>slow</em> operation, as GVim was never meant to be used as
3530
+ a command-line tool. However, what it lacks in speed it compensates for in
3531
+ scope; almost any language you can think of has a GVim syntax highlighting
3532
+ definition. Here is a simple test that demonstrates using GVim for syntax
3525
3533
  highlighting:
3526
3534
  </p>
3527
3535
  <p>
@@ -4228,6 +4236,135 @@ directory upward until finding a match.
4228
4236
 
4229
4237
  end
4230
4238
 
4239
+ end
4240
+ </pre>
4241
+ </div>
4242
+ </div>
4243
+ </p>
4244
+ <h4>Syntax highlighting using CodeRay</h4>
4245
+ <p>
4246
+ <a href="http://coderay.rubychan.de/">CodeRay</a> is a Ruby gem that knows how to
4247
+ highlight the syntax of many popular languages. It is much faster than using
4248
+ GVim`but doesn't offer the huge range of programming languages offered by GVim
4249
+ (for example, it does not currently offer shell script highlighting). If your
4250
+ languages are covered by it, it may serve as a convenient replacement to the
4251
+ slow GVim approach.
4252
+ </p>
4253
+ <p>
4254
+ Here is a simple test that demonstrates using CodeRay for syntax highlighting:
4255
+ </p>
4256
+ <p>
4257
+ <div class="named_with_containers chunk">
4258
+ <div class="chunk name">
4259
+ <a name="test-coderay-highlight-syntax-rb">
4260
+ <span>test/coderay_highlight_syntax.rb</span>
4261
+ </a>
4262
+ </div>
4263
+ <div class="chunk html">
4264
+ <pre class='ruby code syntax'>
4265
+ <span class="PreProc">require</span> <span class="Special">&quot;</span><span class="Constant">codnar</span><span class="Special">&quot;</span>
4266
+ <span class="PreProc">require</span> <span class="Special">&quot;</span><span class="Constant">test/spec</span><span class="Special">&quot;</span>
4267
+
4268
+ </pre>
4269
+ <table class='layout'>
4270
+ <tr>
4271
+ <td class='indentation'>
4272
+ <pre></pre>
4273
+ </td>
4274
+ <td class='html'>
4275
+ <div class='rdoc comment markup'>
4276
+ <p>
4277
+ Test highlighting syntax using CodeRay.
4278
+ </p>
4279
+ </div>
4280
+ </td>
4281
+ </tr>
4282
+ </table>
4283
+ <pre class='ruby code syntax'>
4284
+ <span class="PreProc">class</span> <span class="Type">TestCodeRayHighlightSyntax</span> &lt; <span class="Type">Test</span>::<span class="Type">Unit</span>::<span class="Type">TestCase</span>
4285
+
4286
+ <span class="PreProc">def</span> <span class="Identifier">test_coderay_lines</span>
4287
+ <span class="Type">Codnar</span>::<span class="Type">CodeRay</span>.lines_to_html([
4288
+ { <span class="Special">&quot;</span><span class="Constant">kind</span><span class="Special">&quot;</span> =&gt; <span class="Special">&quot;</span><span class="Constant">ruby_code</span><span class="Special">&quot;</span>, <span class="Special">&quot;</span><span class="Constant">number</span><span class="Special">&quot;</span> =&gt; <span class="Constant">1</span>, <span class="Special">&quot;</span><span class="Constant">indentation</span><span class="Special">&quot;</span> =&gt; <span class="Special">&quot;&quot;</span>, <span class="Special">&quot;</span><span class="Constant">payload</span><span class="Special">&quot;</span> =&gt; <span class="Special">&quot;</span><span class="Constant">def foo</span><span class="Special">&quot;</span> },
4289
+ { <span class="Special">&quot;</span><span class="Constant">kind</span><span class="Special">&quot;</span> =&gt; <span class="Special">&quot;</span><span class="Constant">ruby_code</span><span class="Special">&quot;</span>, <span class="Special">&quot;</span><span class="Constant">number</span><span class="Special">&quot;</span> =&gt; <span class="Constant">2</span>, <span class="Special">&quot;</span><span class="Constant">indentation</span><span class="Special">&quot;</span> =&gt; <span class="Special">&quot;</span><span class="Constant"> </span><span class="Special">&quot;</span>, <span class="Special">&quot;</span><span class="Constant">payload</span><span class="Special">&quot;</span> =&gt; <span class="Special">&quot;</span><span class="Constant">return 1</span><span class="Special">&quot;</span> },
4290
+ { <span class="Special">&quot;</span><span class="Constant">kind</span><span class="Special">&quot;</span> =&gt; <span class="Special">&quot;</span><span class="Constant">ruby_code</span><span class="Special">&quot;</span>, <span class="Special">&quot;</span><span class="Constant">number</span><span class="Special">&quot;</span> =&gt; <span class="Constant">3</span>, <span class="Special">&quot;</span><span class="Constant">indentation</span><span class="Special">&quot;</span> =&gt; <span class="Special">&quot;&quot;</span>, <span class="Special">&quot;</span><span class="Constant">payload</span><span class="Special">&quot;</span> =&gt; <span class="Special">&quot;</span><span class="Constant">end</span><span class="Special">&quot;</span> },
4291
+ ], <span class="Special">&quot;</span><span class="Constant">ruby</span><span class="Special">&quot;</span>).should == [
4292
+ { <span class="Special">&quot;</span><span class="Constant">kind</span><span class="Special">&quot;</span> =&gt; <span class="Special">&quot;</span><span class="Constant">html</span><span class="Special">&quot;</span>, <span class="Special">&quot;</span><span class="Constant">number</span><span class="Special">&quot;</span> =&gt; <span class="Constant">1</span>,
4293
+ <span class="Special">&quot;</span><span class="Constant">payload</span><span class="Special">&quot;</span> =&gt; &lt;&lt;-<span class="Special">EOF</span>.unindent.chomp
4294
+ <span class="Constant"> &lt;div class=&quot;CodeRay&quot;&gt;</span>
4295
+ <span class="Constant"> &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span style=&quot;color:#080;font-weight:bold&quot;&gt;def&lt;/span&gt; &lt;span style=&quot;color:#06B;font-weight:bold&quot;&gt;foo&lt;/span&gt;</span>
4296
+ <span class="Constant"> &lt;span style=&quot;color:#080;font-weight:bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color:#00D&quot;&gt;1&lt;/span&gt;</span>
4297
+ <span class="Constant"> &lt;span style=&quot;color:#080;font-weight:bold&quot;&gt;end&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;</span>
4298
+ <span class="Constant"> &lt;/div&gt;</span>
4299
+ <span class="Constant"> </span><span class="Special">EOF</span>
4300
+ },
4301
+ ]
4302
+ <span class="PreProc">end</span>
4303
+
4304
+ <span class="PreProc">end</span>
4305
+ </pre>
4306
+ </div>
4307
+ </div>
4308
+ </p>
4309
+ <p>
4310
+ And here is the implementation:
4311
+ </p>
4312
+ <p>
4313
+ <div class="named_with_containers chunk">
4314
+ <div class="chunk name">
4315
+ <a name="lib-codnar-coderay-rb">
4316
+ <span>lib/codnar/coderay.rb</span>
4317
+ </a>
4318
+ </div>
4319
+ <div class="chunk html">
4320
+ <pre class='ruby code syntax'>
4321
+ <span class="PreProc">module</span> <span class="Type">Codnar</span>
4322
+
4323
+ </pre>
4324
+ <table class='layout'>
4325
+ <tr>
4326
+ <td class='indentation'>
4327
+ <pre> </pre>
4328
+ </td>
4329
+ <td class='html'>
4330
+ <div class='rdoc comment markup'>
4331
+ <p>
4332
+ Extend the CodeRay module.
4333
+ </p>
4334
+ </div>
4335
+ </td>
4336
+ </tr>
4337
+ </table>
4338
+ <pre class='ruby code syntax'>
4339
+ <span class="PreProc">module</span> <span class="Type">CodeRay</span>
4340
+
4341
+ </pre>
4342
+ <table class='layout'>
4343
+ <tr>
4344
+ <td class='indentation'>
4345
+ <pre> </pre>
4346
+ </td>
4347
+ <td class='html'>
4348
+ <div class='rdoc comment markup'>
4349
+ <p>
4350
+ Convert a sequence of classified code lines to HTML using CodeRay syntax
4351
+ highlighting. The options control the way CodeRay behaves (e.g.,
4352
+ &lt;tt&gt;:css
4353
+ </p>
4354
+ <h1>&gt; :class&lt;/tt&gt;).</h1>
4355
+ </div>
4356
+ </td>
4357
+ </tr>
4358
+ </table>
4359
+ <pre class='ruby code syntax'>
4360
+ <span class="PreProc">def</span> <span class="Constant">self</span>.<span class="Identifier">lines_to_html</span>(lines, syntax, options = {})
4361
+ <span class="Statement">return</span> <span class="Type">Formatter</span>.merge_lines(lines, <span class="Special">&quot;</span><span class="Constant">html</span><span class="Special">&quot;</span>) <span class="Statement">do</span> |<span class="Identifier">payload</span>|
4362
+ ::<span class="Type">CodeRay</span>.scan(payload, syntax).div(options).chomp
4363
+ <span class="Statement">end</span>
4364
+ <span class="PreProc">end</span>
4365
+
4366
+ end
4367
+
4231
4368
  end
4232
4369
  </pre>
4233
4370
  </div>
@@ -4242,9 +4379,8 @@ the DOM and convert it to highlighted HTML in the browser. This takes virtually
4242
4379
  no time when splitting the code, but requires recomputing highlighting for all
4243
4380
  the code chunks every time the HTML file is loaded. This can be pretty slow,
4244
4381
  especially if using a browser with a slow Javascript engine, like IE. However,
4245
- given how slow GVIM is, this is a reasonable trade-off, at least for small
4246
- projects. Since Sunlight is a new project, it doesn't offer the extensive
4247
- coverage of different programming languages supported by GVIM.
4382
+ this may be a reasonable trade-off, at least for small projects. Since Sunlight
4383
+ is a new project, it supports a limited range of programming languages.
4248
4384
  </p>
4249
4385
  <p>
4250
4386
  Here is a simple test that demonstrates using Sunlight for syntax highlighting:
@@ -4440,7 +4576,7 @@ Test splitting code files.
4440
4576
  <span class="Special">&quot;</span><span class="Constant">code</span><span class="Special">&quot;</span> =&gt; <span class="Special">&quot;</span><span class="Constant">Formatter.cast_lines(lines, 'ruby')</span><span class="Special">&quot;</span>,
4441
4577
  <span class="Special">&quot;</span><span class="Constant">comment</span><span class="Special">&quot;</span> =&gt; <span class="Special">&quot;</span><span class="Constant">Formatter.cast_lines(lines, 'rdoc')</span><span class="Special">&quot;</span>,
4442
4578
  <span class="Special">&quot;</span><span class="Constant">ruby</span><span class="Special">&quot;</span> =&gt; <span class="Special">&quot;</span><span class="Constant">GVim.lines_to_html(lines, 'ruby')</span><span class="Special">&quot;</span>,
4443
- <span class="Special">&quot;</span><span class="Constant">rdoc</span><span class="Special">&quot;</span> =&gt; <span class="Special">&quot;</span><span class="Constant">Formatter.markup_lines_to_html(lines, 'RDoc')</span><span class="Special">&quot;</span>,
4579
+ <span class="Special">&quot;</span><span class="Constant">rdoc</span><span class="Special">&quot;</span> =&gt; <span class="Special">&quot;</span><span class="Constant">Formatter.markup_lines_to_html(lines, Codnar::RDoc, 'rdoc')</span><span class="Special">&quot;</span>,
4444
4580
  <span class="Special">&quot;</span><span class="Constant">begin_chunk</span><span class="Special">&quot;</span> =&gt; <span class="Special">&quot;</span><span class="Constant">[]</span><span class="Special">&quot;</span>,
4445
4581
  <span class="Special">&quot;</span><span class="Constant">end_chunk</span><span class="Special">&quot;</span> =&gt; <span class="Special">&quot;</span><span class="Constant">[]</span><span class="Special">&quot;</span>,
4446
4582
  <span class="Special">&quot;</span><span class="Constant">nested_chunk</span><span class="Special">&quot;</span> =&gt; <span class="Special">&quot;</span><span class="Constant">Formatter.nested_chunk_lines_to_html(lines)</span><span class="Special">&quot;</span>,
@@ -4723,7 +4859,7 @@ Test “splitting” documentation files.
4723
4859
  <span class="Special">&quot;</span><span class="Constant">formatters</span><span class="Special">&quot;</span> =&gt; {
4724
4860
  <span class="Special">&quot;</span><span class="Constant">markdown</span><span class="Special">&quot;</span> =&gt; <span class="Special">&quot;</span><span class="Constant">Formatter.markup_lines_to_html(lines, Markdown, 'markdown')</span><span class="Special">&quot;</span>,
4725
4861
  <span class="Special">&quot;</span><span class="Constant">unindented_html</span><span class="Special">&quot;</span> =&gt; <span class="Special">&quot;</span><span class="Constant">Formatter.unindented_lines_to_html(lines)</span><span class="Special">&quot;</span>,
4726
- <span class="Special">&quot;</span><span class="Constant">rdoc</span><span class="Special">&quot;</span> =&gt; <span class="Special">&quot;</span><span class="Constant">Formatter.markup_lines_to_html(lines, 'RDoc')</span><span class="Special">&quot;</span>,
4862
+ <span class="Special">&quot;</span><span class="Constant">rdoc</span><span class="Special">&quot;</span> =&gt; <span class="Special">&quot;</span><span class="Constant">Formatter.markup_lines_to_html(lines, Codnar::RDoc, 'rdoc')</span><span class="Special">&quot;</span>,
4727
4863
  },
4728
4864
  <span class="Special">&quot;</span><span class="Constant">syntax</span><span class="Special">&quot;</span> =&gt; {
4729
4865
  <span class="Special">&quot;</span><span class="Constant">start_state</span><span class="Special">&quot;</span> =&gt; kind,
@@ -4757,7 +4893,7 @@ box".
4757
4893
  If one is willing to give up altogether on syntax highlighting and comment
4758
4894
  formatting, the system would be applicable as-is to any programming language.
4759
4895
  Properly highlighting almost any known programming language syntax would be a
4760
- simple matter of passing the correct syntax parameter to GVIM.
4896
+ simple matter of passing the correct syntax parameter to GVim.
4761
4897
  </p>
4762
4898
  <p>
4763
4899
  Properly formatting comments in additional mark-up formats would be trickier.
@@ -4845,6 +4981,12 @@ Application.
4845
4981
  </pre>
4846
4982
  <pre class='ruby code syntax'>
4847
4983
 
4984
+ </pre>
4985
+ <pre class='nested chunk'>
4986
+ <a class='nested chunk' href='#coderay-syntax-highlighting-formatting-configurations'>CodeRay syntax highlighting formatting configurations</a>
4987
+ </pre>
4988
+ <pre class='ruby code syntax'>
4989
+
4848
4990
  </pre>
4849
4991
  <pre class='nested chunk'>
4850
4992
  <a class='nested chunk' href='#sunlight-syntax-highlighting-formatting-configurations'>Sunlight syntax highlighting formatting configurations</a>
@@ -5323,7 +5465,7 @@ preserved by escaping it and wrapping it in an HTML pre element.
5323
5465
  <pre class='ruby code syntax'>
5324
5466
  <span class="Type">SPLIT_RDOC_DOCUMENTATION</span> = <span class="Type">SPLIT_HTML_DOCUMENTATION</span>.deep_merge(
5325
5467
  <span class="Special">&quot;</span><span class="Constant">formatters</span><span class="Special">&quot;</span> =&gt; {
5326
- <span class="Special">&quot;</span><span class="Constant">doc</span><span class="Special">&quot;</span> =&gt; <span class="Special">&quot;</span><span class="Constant">Formatter.markup_lines_to_html(lines, RDoc)</span><span class="Special">&quot;</span>,
5468
+ <span class="Special">&quot;</span><span class="Constant">doc</span><span class="Special">&quot;</span> =&gt; <span class="Special">&quot;</span><span class="Constant">Formatter.markup_lines_to_html(lines, Codnar::RDoc, 'rdoc')</span><span class="Special">&quot;</span>,
5327
5469
  <span class="Special">&quot;</span><span class="Constant">unindented_html</span><span class="Special">&quot;</span> =&gt; <span class="Special">&quot;</span><span class="Constant">Formatter.unindented_lines_to_html(lines)</span><span class="Special">&quot;</span>,
5328
5470
  }
5329
5471
  )
@@ -5346,7 +5488,7 @@ preserved by escaping it and wrapping it in an HTML pre element.
5346
5488
  <pre class='ruby code syntax'>
5347
5489
  <span class="Type">SPLIT_MARKDOWN_DOCUMENTATION</span> = <span class="Type">SPLIT_HTML_DOCUMENTATION</span>.deep_merge(
5348
5490
  <span class="Special">&quot;</span><span class="Constant">formatters</span><span class="Special">&quot;</span> =&gt; {
5349
- <span class="Special">&quot;</span><span class="Constant">doc</span><span class="Special">&quot;</span> =&gt; <span class="Special">&quot;</span><span class="Constant">Formatter.markup_lines_to_html(lines, Markdown, 'markdown')</span><span class="Special">&quot;</span>,
5491
+ <span class="Special">&quot;</span><span class="Constant">doc</span><span class="Special">&quot;</span> =&gt; <span class="Special">&quot;</span><span class="Constant">Formatter.markup_lines_to_html(lines, Codnar::Markdown, 'markdown')</span><span class="Special">&quot;</span>,
5350
5492
  <span class="Special">&quot;</span><span class="Constant">unindented_html</span><span class="Special">&quot;</span> =&gt; <span class="Special">&quot;</span><span class="Constant">Formatter.unindented_lines_to_html(lines)</span><span class="Special">&quot;</span>,
5351
5493
  }
5352
5494
  )
@@ -6254,7 +6396,7 @@ configuration that classifies some lines as <tt>comment</tt>.
6254
6396
  <pre class='ruby code syntax'>
6255
6397
  <span class="Type">FORMAT_RDOC_COMMENTS</span> = {
6256
6398
  <span class="Special">&quot;</span><span class="Constant">formatters</span><span class="Special">&quot;</span> =&gt; {
6257
- <span class="Special">&quot;</span><span class="Constant">comment</span><span class="Special">&quot;</span> =&gt; <span class="Special">&quot;</span><span class="Constant">Formatter.markup_lines_to_html(lines, 'RDoc')</span><span class="Special">&quot;</span>,
6399
+ <span class="Special">&quot;</span><span class="Constant">comment</span><span class="Special">&quot;</span> =&gt; <span class="Special">&quot;</span><span class="Constant">Formatter.markup_lines_to_html(lines, Codnar::RDoc, 'rdoc')</span><span class="Special">&quot;</span>,
6258
6400
  <span class="Special">&quot;</span><span class="Constant">unindented_html</span><span class="Special">&quot;</span> =&gt; <span class="Special">&quot;</span><span class="Constant">Formatter.unindented_lines_to_html(lines)</span><span class="Special">&quot;</span>,
6259
6401
  },
6260
6402
  }
@@ -6436,7 +6578,7 @@ is very easy using GVim for syntax highlighting, as demonstrated here:
6436
6578
  <td class='html'>
6437
6579
  <div class='rdoc comment markup'>
6438
6580
  <p>
6439
- Format code using GVim’s Ruby syntax highlighting, using explicit HTML
6581
+ Format code using GVim’s syntax highlighting, using explicit HTML
6440
6582
  constructs. Assumes some previous configuration already classified the code
6441
6583
  lines.
6442
6584
  </p>
@@ -6446,7 +6588,7 @@ lines.
6446
6588
  </table>
6447
6589
  <pre class='ruby code syntax'>
6448
6590
  <span class="Type">FORMAT_CODE_GVIM_HTML</span> = <span class="Statement">lambda</span> <span class="Statement">do</span> |<span class="Identifier">syntax</span>|
6449
- <span class="Statement">return</span> <span class="Type">Configuration</span>.gvim_code_format(syntax)
6591
+ <span class="Statement">return</span> <span class="Type">Configuration</span>.klass_code_format(<span class="Special">'</span><span class="Constant">GVim</span><span class="Special">'</span>, syntax, <span class="Special">&quot;</span><span class="Constant">[]</span><span class="Special">&quot;</span>)
6450
6592
  <span class="Statement">end</span>
6451
6593
 
6452
6594
  </pre>
@@ -6458,9 +6600,9 @@ lines.
6458
6600
  <td class='html'>
6459
6601
  <div class='rdoc comment markup'>
6460
6602
  <p>
6461
- Format code using GVim’s Ruby syntax highlighting, using CSS classes
6462
- instead of explicit font and color styles. Assumes some previous
6463
- configuration already classified the code lines.
6603
+ Format code using GVim’s syntax highlighting, using CSS classes instead
6604
+ of explicit font and color styles. Assumes some previous configuration
6605
+ already classified the code lines.
6464
6606
  </p>
6465
6607
  </div>
6466
6608
  </td>
@@ -6468,7 +6610,7 @@ configuration already classified the code lines.
6468
6610
  </table>
6469
6611
  <pre class='ruby code syntax'>
6470
6612
  <span class="Type">FORMAT_CODE_GVIM_CSS</span> = <span class="Statement">lambda</span> <span class="Statement">do</span> |<span class="Identifier">syntax</span>|
6471
- <span class="Statement">return</span> <span class="Type">Configuration</span>.gvim_code_format(syntax, <span class="Special">&quot;</span><span class="Constant">'+:let html_use_css=1'</span><span class="Special">&quot;</span>)
6613
+ <span class="Statement">return</span> <span class="Type">Configuration</span>.klass_code_format(<span class="Special">'</span><span class="Constant">GVim</span><span class="Special">'</span>, syntax, <span class="Special">&quot;</span><span class="Constant">[ '+:let html_use_css=1' ]</span><span class="Special">&quot;</span>)
6472
6614
  <span class="Statement">end</span>
6473
6615
 
6474
6616
  </pre>
@@ -6487,10 +6629,10 @@ Return a configuration for highlighting a specific syntax using GVim.
6487
6629
  </tr>
6488
6630
  </table>
6489
6631
  <pre class='ruby code syntax'>
6490
- <span class="PreProc">def</span> <span class="Constant">self</span>.<span class="Identifier">gvim_code_format</span>(syntax, extra_commands = <span class="Special">&quot;&quot;</span>)
6632
+ <span class="PreProc">def</span> <span class="Constant">self</span>.<span class="Identifier">klass_code_format</span>(klass, syntax, options)
6491
6633
  <span class="Statement">return</span> {
6492
6634
  <span class="Special">&quot;</span><span class="Constant">formatters</span><span class="Special">&quot;</span> =&gt; {
6493
- <span class="Special">&quot;</span><span class="Special">#{</span>syntax<span class="Special">}</span><span class="Constant">_code</span><span class="Special">&quot;</span> =&gt; <span class="Special">&quot;</span><span class="Constant">GVim.lines_to_html(lines, '</span><span class="Special">#{</span>syntax<span class="Special">}</span><span class="Constant">', [ </span><span class="Special">#{</span>extra_commands<span class="Special">}</span><span class="Constant"> ])</span><span class="Special">&quot;</span>,
6635
+ <span class="Special">&quot;</span><span class="Special">#{</span>syntax<span class="Special">}</span><span class="Constant">_code</span><span class="Special">&quot;</span> =&gt; <span class="Special">&quot;</span><span class="Special">#{</span>klass<span class="Special">}</span><span class="Constant">.lines_to_html(lines, '</span><span class="Special">#{</span>syntax<span class="Special">}</span><span class="Constant">', </span><span class="Special">#{</span>options<span class="Special">}</span><span class="Constant">)</span><span class="Special">&quot;</span>,
6494
6636
  },
6495
6637
  }
6496
6638
  <span class="PreProc">end</span>
@@ -6508,21 +6650,57 @@ Return a configuration for highlighting a specific syntax using GVim.
6508
6650
  </div>
6509
6651
  </p>
6510
6652
  <p>
6511
- Here is a simple test demonstrating highlighting code syntax using <code>gvim</code>:
6653
+ If you choose to use CSS classes instead of directly embedding fonts and colors
6654
+ into the generated HTML, you will need a CSS stylesheet with the relevant
6655
+ classes. Here is the default CSS stylesheet used by GVim:
6512
6656
  </p>
6513
6657
  <p>
6514
6658
  <div class="named_with_containers chunk">
6515
6659
  <div class="chunk name">
6516
- <a name="test-format-code-gvim-configurations-rb">
6517
- <span>test/format_code_gvim_configurations.rb</span>
6660
+ <a name="lib-codnar-data-gvim-css">
6661
+ <span>lib/codnar/data/gvim.css</span>
6662
+ </a>
6663
+ </div>
6664
+ <div class="chunk html">
6665
+ <table class='layout'>
6666
+ <tr>
6667
+ <td class='indentation'>
6668
+ <pre></pre>
6669
+ </td>
6670
+ <td class='html'>
6671
+ <div class='markdown comment markup'>
6672
+ <p>
6673
+ Colors for GVim classes
6674
+ </p>
6675
+ </div>
6676
+ </td>
6677
+ </tr>
6678
+ </table>
6679
+ <pre class='css code syntax'>
6680
+ <span class="Statement">span</span><span class="Identifier">.Constant</span> <span class="Identifier">{</span> <span class="Type">color</span>: Crimson; <span class="Identifier">}</span>
6681
+ <span class="Statement">span</span><span class="Identifier">.Identifier</span> <span class="Identifier">{</span> <span class="Type">color</span>: <span class="Constant">Teal</span>; <span class="Identifier">}</span>
6682
+ <span class="Statement">span</span><span class="Identifier">.PreProc</span> <span class="Identifier">{</span> <span class="Type">color</span>: Indigo; <span class="Identifier">}</span>
6683
+ <span class="Statement">span</span><span class="Identifier">.Special</span> <span class="Identifier">{</span> <span class="Type">color</span>: <span class="Constant">Navy</span>; <span class="Identifier">}</span>
6684
+ <span class="Statement">span</span><span class="Identifier">.Statement</span> <span class="Identifier">{</span> <span class="Type">color</span>: <span class="Constant">Maroon</span>; <span class="Identifier">}</span>
6685
+ <span class="Statement">span</span><span class="Identifier">.Type</span> <span class="Identifier">{</span> <span class="Type">color</span>: <span class="Constant">Green</span>; <span class="Identifier">}</span>
6686
+ <span class="Statement">span</span><span class="Identifier">.Comment</span> <span class="Identifier">{</span> <span class="Type">color</span>: <span class="Constant">Purple</span>; <span class="Identifier">}</span>
6687
+ </pre>
6688
+ </div>
6689
+ </div>
6690
+ </p>
6691
+ <h4>Syntax highlighting using CodeRay</h4>
6692
+ <p>
6693
+ For supported programming languages, you may choose to use CodeRay instead of GVim.
6694
+ </p>
6695
+ <p>
6696
+ <div class="named_with_containers chunk">
6697
+ <div class="chunk name">
6698
+ <a name="coderay-syntax-highlighting-formatting-configurations">
6699
+ <span>CodeRay syntax highlighting formatting configurations</span>
6518
6700
  </a>
6519
6701
  </div>
6520
6702
  <div class="chunk html">
6521
6703
  <pre class='ruby code syntax'>
6522
- <span class="PreProc">require</span> <span class="Special">&quot;</span><span class="Constant">codnar</span><span class="Special">&quot;</span>
6523
- <span class="PreProc">require</span> <span class="Special">&quot;</span><span class="Constant">olag/test</span><span class="Special">&quot;</span>
6524
- <span class="PreProc">require</span> <span class="Special">&quot;</span><span class="Constant">test/spec</span><span class="Special">&quot;</span>
6525
- <span class="PreProc">require</span> <span class="Special">&quot;</span><span class="Constant">test_with_configurations</span><span class="Special">&quot;</span>
6526
6704
 
6527
6705
  </pre>
6528
6706
  <table class='layout'>
@@ -6533,70 +6711,215 @@ Here is a simple test demonstrating highlighting code syntax using <code>gvim</c
6533
6711
  <td class='html'>
6534
6712
  <div class='rdoc comment markup'>
6535
6713
  <p>
6536
- Test built-in split code formatting configurations using GVim.
6714
+ Format code using CodeRay’s syntax highlighting, using explicit HTML
6715
+ constructs. Assumes some previous configuration already classified the code
6716
+ lines.
6537
6717
  </p>
6538
6718
  </div>
6539
6719
  </td>
6540
6720
  </tr>
6541
6721
  </table>
6542
6722
  <pre class='ruby code syntax'>
6543
- <span class="PreProc">class</span> <span class="Type">TestGVimFormatCodeConfigurations</span> &lt; <span class="Type">Test</span>::<span class="Type">Unit</span>::<span class="Type">TestCase</span>
6544
-
6545
- <span class="PreProc">include</span> <span class="Type">Test</span>::<span class="Type">WithConfigurations</span>
6546
- <span class="PreProc">include</span> <span class="Type">Test</span>::<span class="Type">WithErrors</span>
6547
- <span class="PreProc">include</span> <span class="Type">Test</span>::<span class="Type">WithTempfile</span>
6548
-
6549
- <span class="Type">CODE_TEXT</span> = &lt;&lt;-<span class="Special">EOF</span>.unindent
6550
- <span class="Constant"> int x;</span>
6551
- <span class="Constant"> </span><span class="Special">EOF</span>
6552
-
6553
- <span class="Type">GVIM_HTML</span> = &lt;&lt;-<span class="Special">EOF</span>.unindent.chomp
6554
- <span class="Constant"> &lt;div class='c code syntax' bgcolor=\&quot;#ffffff\&quot; text=\&quot;#000000\&quot;&gt;</span>
6555
- <span class="Constant"> &lt;font face=\&quot;monospace\&quot;&gt;</span>
6556
- <span class="Constant"> &lt;font color=\&quot;#00ff00\&quot;&gt;int&lt;/font&gt;&amp;nbsp;x;&lt;br /&gt;</span>
6557
- <span class="Constant"> &lt;/font&gt;</span>
6558
- <span class="Constant"> &lt;/div&gt;</span>
6559
- <span class="Constant"> </span><span class="Special">EOF</span>
6723
+ <span class="Type">FORMAT_CODE_CODERAY_HTML</span> = <span class="Statement">lambda</span> <span class="Statement">do</span> |<span class="Identifier">syntax</span>|
6724
+ <span class="Statement">return</span> <span class="Type">Configuration</span>.klass_code_format(<span class="Special">'</span><span class="Constant">CodeRay</span><span class="Special">'</span>, syntax, <span class="Special">&quot;</span><span class="Constant">{}</span><span class="Special">&quot;</span>)
6725
+ <span class="Statement">end</span>
6560
6726
 
6561
- <span class="PreProc">def</span> <span class="Identifier">test_html_code</span>
6562
- check_any_code(<span class="Type">GVIM_HTML</span>, <span class="Type">Codnar</span>::<span class="Type">Configuration</span>::<span class="Type">FORMAT_CODE_GVIM_HTML</span>.call(<span class="Special">&quot;</span><span class="Constant">c</span><span class="Special">&quot;</span>))
6563
- <span class="PreProc">end</span>
6727
+ </pre>
6728
+ <table class='layout'>
6729
+ <tr>
6730
+ <td class='indentation'>
6731
+ <pre></pre>
6732
+ </td>
6733
+ <td class='html'>
6734
+ <div class='rdoc comment markup'>
6735
+ <p>
6736
+ Format code using CodeRay’s syntax highlighting, using CSS classes
6737
+ instead of explicit font and color styles. Assumes some previous
6738
+ configuration already classified the code lines.
6739
+ </p>
6740
+ </div>
6741
+ </td>
6742
+ </tr>
6743
+ </table>
6744
+ <pre class='ruby code syntax'>
6745
+ <span class="Type">FORMAT_CODE_CODERAY_CSS</span> = <span class="Statement">lambda</span> <span class="Statement">do</span> |<span class="Identifier">syntax</span>|
6746
+ <span class="Statement">return</span> <span class="Type">Configuration</span>.klass_code_format(<span class="Special">'</span><span class="Constant">CodeRay</span><span class="Special">'</span>, syntax, <span class="Special">&quot;</span><span class="Constant">{ :css =&gt; :class }</span><span class="Special">&quot;</span>)
6747
+ <span class="Statement">end</span>
6564
6748
 
6565
- <span class="Type">GVIM_CSS</span> = &lt;&lt;-<span class="Special">EOF</span>.unindent.chomp
6566
- <span class="Constant"> &lt;pre class='c code syntax'&gt;</span>
6567
- <span class="Constant"> &lt;span class=\&quot;Type\&quot;&gt;int&lt;/span&gt; x;</span>
6568
- <span class="Constant"> &lt;/pre&gt;</span>
6569
- <span class="Constant"> </span><span class="Special">EOF</span>
6749
+ </pre>
6750
+ </div>
6751
+ <div class="chunk containers">
6752
+ <span class="chunk containers header">Contained in:</span>
6753
+ <ul class="chunk containers">
6754
+ <li class="chunk container">
6755
+ <a class="chunk container" href="#lib-codnar-split-configurations-rb">lib/codnar/split_configurations.rb</a>
6756
+ </li>
6757
+ </ul>
6758
+ </div>
6759
+ </div>
6760
+ </p>
6761
+ <p>
6762
+ If you choose to use CSS classes instead of directly embedding fonts and colors
6763
+ into the generated HTML, you will need a CSS stylesheet with the relevant
6764
+ classes. Here is the default CSS stylesheet used by CodeRay:
6765
+ </p>
6766
+ <p>
6767
+ <div class="named_with_containers chunk">
6768
+ <div class="chunk name">
6769
+ <a name="lib-codnar-data-coderay-css">
6770
+ <span>lib/codnar/data/coderay.css</span>
6771
+ </a>
6772
+ </div>
6773
+ <div class="chunk html">
6774
+ <table class='layout'>
6775
+ <tr>
6776
+ <td class='indentation'>
6777
+ <pre></pre>
6778
+ </td>
6779
+ <td class='html'>
6780
+ <div class='markdown comment markup'>
6781
+ <p>
6782
+ Extracted from CodeRay output
6783
+ </p>
6784
+ </div>
6785
+ </td>
6786
+ </tr>
6787
+ </table>
6788
+ <pre class='css code syntax'>
6570
6789
 
6571
- <span class="PreProc">def</span> <span class="Identifier">test_css_code</span>
6572
- check_any_code(<span class="Type">GVIM_CSS</span>, <span class="Type">Codnar</span>::<span class="Type">Configuration</span>::<span class="Type">FORMAT_CODE_GVIM_CSS</span>.call(<span class="Special">&quot;</span><span class="Constant">c</span><span class="Special">&quot;</span>))
6573
- <span class="PreProc">end</span>
6790
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.line-numbers</span> <span class="Statement">a</span> <span class="Identifier">{</span>
6791
+ <span class="Type">text-decoration</span>: <span class="Type">inherit</span>;
6792
+ <span class="Type">color</span>: <span class="Type">inherit</span>;
6793
+ <span class="Identifier">}</span>
6794
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">{</span>
6795
+ <span class="Type">background-color</span>: hsl(<span class="Constant">0</span>,<span class="Constant">0%</span>,<span class="Constant">95%</span>);
6796
+ <span class="Type">border</span>: <span class="Constant">1px</span> <span class="Type">solid</span> <span class="Constant">silver</span>;
6797
+ <span class="Type">color</span>: <span class="Constant">black</span>;
6798
+ <span class="Identifier">}</span>
6799
+ <span class="Identifier">.CodeRay</span> <span class="Statement">pre</span> <span class="Identifier">{</span>
6800
+ <span class="Type">margin</span>: <span class="Constant">0px</span>;
6801
+ <span class="Identifier">}</span>
6574
6802
 
6575
- <span class="Statement">protected</span>
6803
+ <span class="Statement">span</span><span class="Identifier">.CodeRay</span> <span class="Identifier">{</span> <span class="Type">white-space</span>: <span class="Type">pre</span>; <span class="Type">border</span>: <span class="Constant">0px</span>; <span class="Type">padding</span>: <span class="Constant">2px</span>; <span class="Identifier">}</span>
6576
6804
 
6577
- <span class="PreProc">def</span> <span class="Identifier">check_any_code</span>(html, configuration)
6578
- check_split_file(<span class="Type">CODE_TEXT</span>,
6579
- <span class="Type">Codnar</span>::<span class="Type">Configuration</span>::<span class="Type">CLASSIFY_SOURCE_CODE</span>.call(<span class="Special">&quot;</span><span class="Constant">c</span><span class="Special">&quot;</span>),
6580
- configuration) <span class="Statement">do</span> |<span class="Identifier">path</span>|
6581
- [ {
6582
- <span class="Special">&quot;</span><span class="Constant">name</span><span class="Special">&quot;</span> =&gt; path,
6583
- <span class="Special">&quot;</span><span class="Constant">locations</span><span class="Special">&quot;</span> =&gt; [ { <span class="Special">&quot;</span><span class="Constant">file</span><span class="Special">&quot;</span> =&gt; path, <span class="Special">&quot;</span><span class="Constant">line</span><span class="Special">&quot;</span> =&gt; <span class="Constant">1</span> } ],
6584
- <span class="Special">&quot;</span><span class="Constant">containers</span><span class="Special">&quot;</span> =&gt; [],
6585
- <span class="Special">&quot;</span><span class="Constant">contained</span><span class="Special">&quot;</span> =&gt; [],
6586
- <span class="Special">&quot;</span><span class="Constant">html</span><span class="Special">&quot;</span> =&gt; html,
6587
- } ]
6588
- <span class="Statement">end</span>
6589
- <span class="PreProc">end</span>
6805
+ <span class="Statement">table</span><span class="Identifier">.CodeRay</span> <span class="Identifier">{</span> <span class="Type">border-collapse</span>: <span class="Type">collapse</span>; <span class="Type">width</span>: <span class="Constant">100%</span>; <span class="Type">padding</span>: <span class="Constant">2px</span>; <span class="Identifier">}</span>
6806
+ <span class="Statement">table</span><span class="Identifier">.CodeRay</span> <span class="Statement">td</span> <span class="Identifier">{</span> <span class="Type">padding</span>: <span class="Constant">2px</span> <span class="Constant">4px</span>; <span class="Type">vertical-align</span>: <span class="Type">top</span>; <span class="Identifier">}</span>
6590
6807
 
6591
- <span class="PreProc">end</span>
6808
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.line-numbers</span> <span class="Identifier">{</span>
6809
+ <span class="Type">background-color</span>: hsl(<span class="Constant">180</span>,<span class="Constant">65%</span>,<span class="Constant">90%</span>);
6810
+ <span class="Type">color</span>: <span class="Constant">gray</span>;
6811
+ <span class="Type">text-align</span>: <span class="Type">right</span>;
6812
+ -webkit-user-select: <span class="Type">none</span>;
6813
+ -moz-user-select: <span class="Type">none</span>;
6814
+ user-select: <span class="Type">none</span>;
6815
+ <span class="Identifier">}</span>
6816
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.line-numbers</span> <span class="Statement">a</span> <span class="Identifier">{</span>
6817
+ <span class="Type">background-color</span>: hsl(<span class="Constant">180</span>,<span class="Constant">65%</span>,<span class="Constant">90%</span>) <span class="Special">!important</span>;
6818
+ <span class="Type">color</span>: <span class="Constant">gray</span> <span class="Special">!important</span>;
6819
+ <span class="Type">text-decoration</span>: <span class="Type">none</span> <span class="Special">!important</span>;
6820
+ <span class="Identifier">}</span>
6821
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.line-numbers</span> <span class="Statement">a</span>:target <span class="Identifier">{</span> <span class="Type">color</span>: <span class="Constant">blue</span> <span class="Special">!important</span>; <span class="Identifier">}</span>
6822
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.line-numbers</span> <span class="Identifier">.highlighted</span> <span class="Identifier">{</span> <span class="Type">color</span>: <span class="Constant">red</span> <span class="Special">!important</span>; <span class="Identifier">}</span>
6823
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.line-numbers</span> <span class="Identifier">.highlighted</span> <span class="Statement">a</span> <span class="Identifier">{</span> <span class="Type">color</span>: <span class="Constant">red</span> <span class="Special">!important</span>; <span class="Identifier">}</span>
6824
+ <span class="Identifier">.CodeRay</span> <span class="Statement">span</span><span class="Identifier">.line-numbers</span> <span class="Identifier">{</span> <span class="Type">padding</span>: <span class="Constant">0px</span> <span class="Constant">4px</span>; <span class="Identifier">}</span>
6825
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.line</span> <span class="Identifier">{</span> <span class="Type">display</span>: <span class="Type">block</span>; <span class="Type">float</span>: <span class="Type">left</span>; <span class="Type">width</span>: <span class="Constant">100%</span>; <span class="Identifier">}</span>
6826
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.code</span> <span class="Identifier">{</span> <span class="Type">width</span>: <span class="Constant">100%</span>; <span class="Identifier">}</span>
6827
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.code</span> <span class="Statement">pre</span> <span class="Identifier">{</span> <span class="Type">overflow</span>: <span class="Type">auto</span>; <span class="Identifier">}</span>
6828
+
6829
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.debug</span> <span class="Identifier">{</span> <span class="Type">color</span>: <span class="Constant">white</span> <span class="Special">!important</span>; <span class="Type">background</span>: <span class="Constant">blue</span> <span class="Special">!important</span>; <span class="Identifier">}</span>
6830
+
6831
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.annotation</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">#007</span> <span class="Identifier">}</span>
6832
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.attribute-name</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">#b48</span> <span class="Identifier">}</span>
6833
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.attribute-value</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">#700</span> <span class="Identifier">}</span>
6834
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.binary</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">#509</span> <span class="Identifier">}</span>
6835
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.char</span> <span class="Identifier">.content</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">#D20</span> <span class="Identifier">}</span>
6836
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.char</span> <span class="Identifier">.delimiter</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">#710</span> <span class="Identifier">}</span>
6837
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.char</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">#D20</span> <span class="Identifier">}</span>
6838
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.class</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">#B06</span>; <span class="Type">font-weight</span>:<span class="Type">bold</span> <span class="Identifier">}</span>
6839
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.class-variable</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">#369</span> <span class="Identifier">}</span>
6840
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.color</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">#0A0</span> <span class="Identifier">}</span>
6841
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.comment</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">#777</span> <span class="Identifier">}</span>
6842
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.comment</span> <span class="Identifier">.char</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">#444</span> <span class="Identifier">}</span>
6843
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.comment</span> <span class="Identifier">.delimiter</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">#444</span> <span class="Identifier">}</span>
6844
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.complex</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">#A08</span> <span class="Identifier">}</span>
6845
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.constant</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">#036</span>; <span class="Type">font-weight</span>:<span class="Type">bold</span> <span class="Identifier">}</span>
6846
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.decorator</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">#B0B</span> <span class="Identifier">}</span>
6847
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.definition</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">#099</span>; <span class="Type">font-weight</span>:<span class="Type">bold</span> <span class="Identifier">}</span>
6848
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.delimiter</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">black</span> <span class="Identifier">}</span>
6849
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.directive</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">#088</span>; <span class="Type">font-weight</span>:<span class="Type">bold</span> <span class="Identifier">}</span>
6850
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.doc</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">#970</span> <span class="Identifier">}</span>
6851
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.doc-string</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">#D42</span>; <span class="Type">font-weight</span>:<span class="Type">bold</span> <span class="Identifier">}</span>
6852
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.doctype</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">#34b</span> <span class="Identifier">}</span>
6853
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.entity</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">#800</span>; <span class="Type">font-weight</span>:<span class="Type">bold</span> <span class="Identifier">}</span>
6854
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.error</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">#F00</span>; <span class="Type">background-color</span>:<span class="Constant">#FAA</span> <span class="Identifier">}</span>
6855
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.escape</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">#666</span> <span class="Identifier">}</span>
6856
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.exception</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">#C00</span>; <span class="Type">font-weight</span>:<span class="Type">bold</span> <span class="Identifier">}</span>
6857
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.float</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">#60E</span> <span class="Identifier">}</span>
6858
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.function</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">#06B</span>; <span class="Type">font-weight</span>:<span class="Type">bold</span> <span class="Identifier">}</span>
6859
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.global-variable</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">#d70</span> <span class="Identifier">}</span>
6860
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.hex</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">#02b</span> <span class="Identifier">}</span>
6861
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.imaginary</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">#f00</span> <span class="Identifier">}</span>
6862
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.include</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">#B44</span>; <span class="Type">font-weight</span>:<span class="Type">bold</span> <span class="Identifier">}</span>
6863
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.inline</span> <span class="Identifier">{</span> <span class="Type">background-color</span>: hsla(<span class="Constant">0</span>,<span class="Constant">0%</span>,<span class="Constant">0%</span>,<span class="Constant">0.07</span>); <span class="Type">color</span>: <span class="Constant">black</span> <span class="Identifier">}</span>
6864
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.inline-delimiter</span> <span class="Identifier">{</span> <span class="Type">font-weight</span>: <span class="Type">bold</span>; <span class="Type">color</span>: <span class="Constant">#666</span> <span class="Identifier">}</span>
6865
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.instance-variable</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">#33B</span> <span class="Identifier">}</span>
6866
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.integer</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">#00D</span> <span class="Identifier">}</span>
6867
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.key</span> <span class="Identifier">.char</span> <span class="Identifier">{</span> <span class="Type">color</span>: <span class="Constant">#60f</span> <span class="Identifier">}</span>
6868
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.key</span> <span class="Identifier">.delimiter</span> <span class="Identifier">{</span> <span class="Type">color</span>: <span class="Constant">#404</span> <span class="Identifier">}</span>
6869
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.key</span> <span class="Identifier">{</span> <span class="Type">color</span>: <span class="Constant">#606</span> <span class="Identifier">}</span>
6870
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.keyword</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">#080</span>; <span class="Type">font-weight</span>:<span class="Type">bold</span> <span class="Identifier">}</span>
6871
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.label</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">#970</span>; <span class="Type">font-weight</span>:<span class="Type">bold</span> <span class="Identifier">}</span>
6872
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.local-variable</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">#963</span> <span class="Identifier">}</span>
6873
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.namespace</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">#707</span>; <span class="Type">font-weight</span>:<span class="Type">bold</span> <span class="Identifier">}</span>
6874
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.octal</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">#40E</span> <span class="Identifier">}</span>
6875
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.operator</span> <span class="Identifier">{</span> <span class="Identifier">}</span>
6876
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.predefined</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">#369</span>; <span class="Type">font-weight</span>:<span class="Type">bold</span> <span class="Identifier">}</span>
6877
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.predefined-constant</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">#069</span> <span class="Identifier">}</span>
6878
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.predefined-type</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">#0a5</span>; <span class="Type">font-weight</span>:<span class="Type">bold</span> <span class="Identifier">}</span>
6879
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.preprocessor</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">#579</span> <span class="Identifier">}</span>
6880
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.pseudo-class</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">#00C</span>; <span class="Type">font-weight</span>:<span class="Type">bold</span> <span class="Identifier">}</span>
6881
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.regexp</span> <span class="Identifier">.content</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">#808</span> <span class="Identifier">}</span>
6882
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.regexp</span> <span class="Identifier">.delimiter</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">#404</span> <span class="Identifier">}</span>
6883
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.regexp</span> <span class="Identifier">.modifier</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">#C2C</span> <span class="Identifier">}</span>
6884
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.regexp</span> <span class="Identifier">{</span> <span class="Type">background-color</span>:hsla(<span class="Constant">300</span>,<span class="Constant">100%</span>,<span class="Constant">50%</span>,<span class="Constant">0.06</span>); <span class="Identifier">}</span>
6885
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.reserved</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">#080</span>; <span class="Type">font-weight</span>:<span class="Type">bold</span> <span class="Identifier">}</span>
6886
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.shell</span> <span class="Identifier">.content</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">#2B2</span> <span class="Identifier">}</span>
6887
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.shell</span> <span class="Identifier">.delimiter</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">#161</span> <span class="Identifier">}</span>
6888
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.shell</span> <span class="Identifier">{</span> <span class="Type">background-color</span>:hsla(<span class="Constant">120</span>,<span class="Constant">100%</span>,<span class="Constant">50%</span>,<span class="Constant">0.06</span>); <span class="Identifier">}</span>
6889
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.string</span> <span class="Identifier">.char</span> <span class="Identifier">{</span> <span class="Type">color</span>: <span class="Constant">#b0b</span> <span class="Identifier">}</span>
6890
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.string</span> <span class="Identifier">.content</span> <span class="Identifier">{</span> <span class="Type">color</span>: <span class="Constant">#D20</span> <span class="Identifier">}</span>
6891
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.string</span> <span class="Identifier">.delimiter</span> <span class="Identifier">{</span> <span class="Type">color</span>: <span class="Constant">#710</span> <span class="Identifier">}</span>
6892
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.string</span> <span class="Identifier">.modifier</span> <span class="Identifier">{</span> <span class="Type">color</span>: <span class="Constant">#E40</span> <span class="Identifier">}</span>
6893
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.string</span> <span class="Identifier">{</span> <span class="Type">background-color</span>:hsla(<span class="Constant">0</span>,<span class="Constant">100%</span>,<span class="Constant">50%</span>,<span class="Constant">0.05</span>); <span class="Identifier">}</span>
6894
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.symbol</span> <span class="Identifier">.content</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">#A60</span> <span class="Identifier">}</span>
6895
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.symbol</span> <span class="Identifier">.delimiter</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">#630</span> <span class="Identifier">}</span>
6896
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.symbol</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">#A60</span> <span class="Identifier">}</span>
6897
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.tag</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">#070</span> <span class="Identifier">}</span>
6898
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.type</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">#339</span>; <span class="Type">font-weight</span>:<span class="Type">bold</span> <span class="Identifier">}</span>
6899
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.value</span> <span class="Identifier">{</span> <span class="Type">color</span>: <span class="Constant">#088</span>; <span class="Identifier">}</span>
6900
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.variable</span> <span class="Identifier">{</span> <span class="Type">color</span>:<span class="Constant">#037</span> <span class="Identifier">}</span>
6901
+
6902
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.insert</span> <span class="Identifier">{</span> <span class="Type">background</span>: hsla(<span class="Constant">120</span>,<span class="Constant">100%</span>,<span class="Constant">50%</span>,<span class="Constant">0.12</span>) <span class="Identifier">}</span>
6903
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.delete</span> <span class="Identifier">{</span> <span class="Type">background</span>: hsla(<span class="Constant">0</span>,<span class="Constant">100%</span>,<span class="Constant">50%</span>,<span class="Constant">0.12</span>) <span class="Identifier">}</span>
6904
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.change</span> <span class="Identifier">{</span> <span class="Type">color</span>: <span class="Constant">#bbf</span>; <span class="Type">background</span>: <span class="Constant">#007</span>; <span class="Identifier">}</span>
6905
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.head</span> <span class="Identifier">{</span> <span class="Type">color</span>: <span class="Constant">#f8f</span>; <span class="Type">background</span>: <span class="Constant">#505</span> <span class="Identifier">}</span>
6906
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.head</span> <span class="Identifier">.filename</span> <span class="Identifier">{</span> <span class="Type">color</span>: <span class="Constant">white</span>; <span class="Identifier">}</span>
6907
+
6908
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.delete</span> <span class="Identifier">.eyecatcher</span> <span class="Identifier">{</span> <span class="Type">background-color</span>: hsla(<span class="Constant">0</span>,<span class="Constant">100%</span>,<span class="Constant">50%</span>,<span class="Constant">0.2</span>); <span class="Type">border</span>: <span class="Constant">1px</span> <span class="Type">solid</span> hsla(<span class="Constant">0</span>,<span class="Constant">100%</span>,<span class="Constant">45%</span>,<span class="Constant">0.5</span>); <span class="Type">margin</span>: <span class="Constant">-1px</span>; <span class="Type">border-bottom</span>: <span class="Type">none</span>; <span class="Type">border-top</span>-<span class="Type">left</span>-radius: <span class="Constant">5px</span>; <span class="Type">border-top</span>-<span class="Type">right</span>-radius: <span class="Constant">5px</span>; <span class="Identifier">}</span>
6909
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.insert</span> <span class="Identifier">.eyecatcher</span> <span class="Identifier">{</span> <span class="Type">background-color</span>: hsla(<span class="Constant">120</span>,<span class="Constant">100%</span>,<span class="Constant">50%</span>,<span class="Constant">0.2</span>); <span class="Type">border</span>: <span class="Constant">1px</span> <span class="Type">solid</span> hsla(<span class="Constant">120</span>,<span class="Constant">100%</span>,<span class="Constant">25%</span>,<span class="Constant">0.5</span>); <span class="Type">margin</span>: <span class="Constant">-1px</span>; <span class="Type">border-top</span>: <span class="Type">none</span>; <span class="Type">border-bottom</span>-<span class="Type">left</span>-radius: <span class="Constant">5px</span>; <span class="Type">border-bottom</span>-<span class="Type">right</span>-radius: <span class="Constant">5px</span>; <span class="Identifier">}</span>
6910
+
6911
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.insert</span> <span class="Identifier">.insert</span> <span class="Identifier">{</span> <span class="Type">color</span>: <span class="Constant">#0c0</span>; <span class="Type">background</span>:<span class="Constant">transparent</span>; <span class="Type">font-weight</span>:<span class="Type">bold</span> <span class="Identifier">}</span>
6912
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.delete</span> <span class="Identifier">.delete</span> <span class="Identifier">{</span> <span class="Type">color</span>: <span class="Constant">#c00</span>; <span class="Type">background</span>:<span class="Constant">transparent</span>; <span class="Type">font-weight</span>:<span class="Type">bold</span> <span class="Identifier">}</span>
6913
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.change</span> <span class="Identifier">.change</span> <span class="Identifier">{</span> <span class="Type">color</span>: <span class="Constant">#88f</span> <span class="Identifier">}</span>
6914
+ <span class="Identifier">.CodeRay</span> <span class="Identifier">.head</span> <span class="Identifier">.head</span> <span class="Identifier">{</span> <span class="Type">color</span>: <span class="Constant">#f4f</span> <span class="Identifier">}</span>
6592
6915
  </pre>
6593
6916
  </div>
6594
6917
  </div>
6595
6918
  </p>
6596
6919
  <h4>Syntax highlighting using Sunlight</h4>
6597
6920
  <p>
6598
- For small projects in languages supported by Sunlight, you may choose to use
6599
- it instead of GVIM
6921
+ For small projects in supported languages, you may choose to use Sunlight
6922
+ instead of GVim.
6600
6923
  </p>
6601
6924
  <p>
6602
6925
  <div class="named_with_containers chunk">
@@ -6668,13 +6991,14 @@ Return a configuration for highlighting a specific syntax using Sunlight.
6668
6991
  </div>
6669
6992
  </p>
6670
6993
  <p>
6671
- Here is a simple test demonstrating highlighting code syntax using Sunlight:
6994
+ Here is a simple test demonstrating highlighting code syntax using the
6995
+ different configurations (GVim, CodeRay, or Sunlight):
6672
6996
  </p>
6673
6997
  <p>
6674
6998
  <div class="named_with_containers chunk">
6675
6999
  <div class="chunk name">
6676
- <a name="test-format-code-sunlight-configurations-rb">
6677
- <span>test/format_code_sunlight_configurations.rb</span>
7000
+ <a name="test-format-code-configurations-rb">
7001
+ <span>test/format_code_configurations.rb</span>
6678
7002
  </a>
6679
7003
  </div>
6680
7004
  <div class="chunk html">
@@ -6693,39 +7017,73 @@ Here is a simple test demonstrating highlighting code syntax using Sunlight:
6693
7017
  <td class='html'>
6694
7018
  <div class='rdoc comment markup'>
6695
7019
  <p>
6696
- Test built-in split code formatting configurations using Sunlight.
7020
+ Test built-in split code formatting configurations.
6697
7021
  </p>
6698
7022
  </div>
6699
7023
  </td>
6700
7024
  </tr>
6701
7025
  </table>
6702
7026
  <pre class='ruby code syntax'>
6703
- <span class="PreProc">class</span> <span class="Type">TestSunlightFormatCodeConfigurations</span> &lt; <span class="Type">Test</span>::<span class="Type">Unit</span>::<span class="Type">TestCase</span>
7027
+ <span class="PreProc">class</span> <span class="Type">TestFormatCodeConfigurations</span> &lt; <span class="Type">Test</span>::<span class="Type">Unit</span>::<span class="Type">TestCase</span>
6704
7028
 
6705
7029
  <span class="PreProc">include</span> <span class="Type">Test</span>::<span class="Type">WithConfigurations</span>
6706
7030
  <span class="PreProc">include</span> <span class="Type">Test</span>::<span class="Type">WithErrors</span>
6707
7031
  <span class="PreProc">include</span> <span class="Type">Test</span>::<span class="Type">WithTempfile</span>
6708
7032
 
6709
- <span class="Type">CODE_TEXT</span> = &lt;&lt;-<span class="Special">EOF</span>.unindent
6710
- <span class="Constant"> local = $global;</span>
6711
- <span class="Constant"> </span><span class="Special">EOF</span>
7033
+ <span class="PreProc">def</span> <span class="Identifier">test_gvim_html_code</span>
7034
+ check_any_code(&lt;&lt;-<span class="Special">EOF</span>.unindent.chomp, <span class="Type">Codnar</span>::<span class="Type">Configuration</span>::<span class="Type">FORMAT_CODE_GVIM_HTML</span>.call(<span class="Special">&quot;</span><span class="Constant">c</span><span class="Special">&quot;</span>))
7035
+ <span class="Constant"> &lt;div class='c code syntax' bgcolor=\&quot;#ffffff\&quot; text=\&quot;#000000\&quot;&gt;</span>
7036
+ <span class="Constant"> &lt;font face=\&quot;monospace\&quot;&gt;</span>
7037
+ <span class="Constant"> &lt;font color=\&quot;#00ff00\&quot;&gt;int&lt;/font&gt;&amp;nbsp;x;&lt;br /&gt;</span>
7038
+ <span class="Constant"> &lt;/font&gt;</span>
7039
+ <span class="Constant"> &lt;/div&gt;</span>
7040
+ <span class="Constant"> </span><span class="Special">EOF</span>
7041
+ <span class="PreProc">end</span>
6712
7042
 
6713
- <span class="Type">SUNLIGHT_HTML</span> = &lt;&lt;-<span class="Special">EOF</span>.unindent.chomp
6714
- <span class="Constant"> &lt;pre class='sunlight-highlight-ruby'&gt;</span>
6715
- <span class="Constant"> local = $global;</span>
6716
- <span class="Constant"> &lt;/pre&gt;</span>
6717
- <span class="Constant"> </span><span class="Special">EOF</span>
7043
+ <span class="PreProc">def</span> <span class="Identifier">test_gvim_css_code</span>
7044
+ check_any_code(&lt;&lt;-<span class="Special">EOF</span>.unindent.chomp, <span class="Type">Codnar</span>::<span class="Type">Configuration</span>::<span class="Type">FORMAT_CODE_GVIM_CSS</span>.call(<span class="Special">&quot;</span><span class="Constant">c</span><span class="Special">&quot;</span>))
7045
+ <span class="Constant"> &lt;pre class='c code syntax'&gt;</span>
7046
+ <span class="Constant"> &lt;span class=\&quot;Type\&quot;&gt;int&lt;/span&gt; x;</span>
7047
+ <span class="Constant"> &lt;/pre&gt;</span>
7048
+ <span class="Constant"> </span><span class="Special">EOF</span>
7049
+ <span class="PreProc">end</span>
7050
+
7051
+ <span class="PreProc">def</span> <span class="Identifier">test_coderay_html_code</span>
7052
+ check_any_code(&lt;&lt;-<span class="Special">EOF</span>.unindent.chomp, <span class="Type">Codnar</span>::<span class="Type">Configuration</span>::<span class="Type">FORMAT_CODE_CODERAY_HTML</span>.call(<span class="Special">&quot;</span><span class="Constant">c</span><span class="Special">&quot;</span>))
7053
+ <span class="Constant"> &lt;div class=&quot;CodeRay&quot;&gt;</span>
7054
+ <span class="Constant"> &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span style=&quot;color:#0a5;font-weight:bold&quot;&gt;int&lt;/span&gt; x;&lt;/pre&gt;&lt;/div&gt;</span>
7055
+ <span class="Constant"> &lt;/div&gt;</span>
7056
+ <span class="Constant"> </span><span class="Special">EOF</span>
7057
+ <span class="PreProc">end</span>
7058
+
7059
+ <span class="PreProc">def</span> <span class="Identifier">test_coderay_css_code</span>
7060
+ check_any_code(&lt;&lt;-<span class="Special">EOF</span>.unindent.chomp, <span class="Type">Codnar</span>::<span class="Type">Configuration</span>::<span class="Type">FORMAT_CODE_CODERAY_CSS</span>.call(<span class="Special">&quot;</span><span class="Constant">c</span><span class="Special">&quot;</span>))
7061
+ <span class="Constant"> &lt;div class=&quot;CodeRay&quot;&gt;</span>
7062
+ <span class="Constant"> &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;predefined-type&quot;&gt;int&lt;/span&gt; x;&lt;/pre&gt;&lt;/div&gt;</span>
7063
+ <span class="Constant"> &lt;/div&gt;</span>
7064
+ <span class="Constant"> </span><span class="Special">EOF</span>
7065
+ <span class="PreProc">end</span>
6718
7066
 
6719
7067
  <span class="PreProc">def</span> <span class="Identifier">test_sunlight_code</span>
6720
- check_split_file(<span class="Type">CODE_TEXT</span>,
6721
- <span class="Type">Codnar</span>::<span class="Type">Configuration</span>::<span class="Type">CLASSIFY_SOURCE_CODE</span>.call(<span class="Special">&quot;</span><span class="Constant">ruby</span><span class="Special">&quot;</span>),
6722
- <span class="Type">Codnar</span>::<span class="Type">Configuration</span>::<span class="Type">FORMAT_CODE_SUNLIGHT</span>.call(<span class="Special">&quot;</span><span class="Constant">ruby</span><span class="Special">&quot;</span>)) <span class="Statement">do</span> |<span class="Identifier">path</span>|
7068
+ check_any_code(&lt;&lt;-<span class="Special">EOF</span>.unindent.chomp, <span class="Type">Codnar</span>::<span class="Type">Configuration</span>::<span class="Type">FORMAT_CODE_SUNLIGHT</span>.call(<span class="Special">&quot;</span><span class="Constant">c</span><span class="Special">&quot;</span>))
7069
+ <span class="Constant"> &lt;pre class='sunlight-highlight-c'&gt;</span>
7070
+ <span class="Constant"> int x;</span>
7071
+ <span class="Constant"> &lt;/pre&gt;</span>
7072
+ <span class="Constant"> </span><span class="Special">EOF</span>
7073
+ <span class="PreProc">end</span>
7074
+
7075
+ <span class="Statement">protected</span>
7076
+
7077
+ <span class="PreProc">def</span> <span class="Identifier">check_any_code</span>(html, configuration)
7078
+ check_split_file(<span class="Special">&quot;</span><span class="Constant">int x;</span><span class="Special">\n</span><span class="Special">&quot;</span>,
7079
+ <span class="Type">Codnar</span>::<span class="Type">Configuration</span>::<span class="Type">CLASSIFY_SOURCE_CODE</span>.call(<span class="Special">&quot;</span><span class="Constant">c</span><span class="Special">&quot;</span>),
7080
+ configuration) <span class="Statement">do</span> |<span class="Identifier">path</span>|
6723
7081
  [ {
6724
7082
  <span class="Special">&quot;</span><span class="Constant">name</span><span class="Special">&quot;</span> =&gt; path,
6725
7083
  <span class="Special">&quot;</span><span class="Constant">locations</span><span class="Special">&quot;</span> =&gt; [ { <span class="Special">&quot;</span><span class="Constant">file</span><span class="Special">&quot;</span> =&gt; path, <span class="Special">&quot;</span><span class="Constant">line</span><span class="Special">&quot;</span> =&gt; <span class="Constant">1</span> } ],
6726
7084
  <span class="Special">&quot;</span><span class="Constant">containers</span><span class="Special">&quot;</span> =&gt; [],
6727
7085
  <span class="Special">&quot;</span><span class="Constant">contained</span><span class="Special">&quot;</span> =&gt; [],
6728
- <span class="Special">&quot;</span><span class="Constant">html</span><span class="Special">&quot;</span> =&gt; <span class="Type">SUNLIGHT_HTML</span>,
7086
+ <span class="Special">&quot;</span><span class="Constant">html</span><span class="Special">&quot;</span> =&gt; html,
6729
7087
  } ]
6730
7088
  <span class="Statement">end</span>
6731
7089
  <span class="PreProc">end</span>
@@ -8735,10 +9093,12 @@ convenient list of all of Codnar's parts and dependencies:
8735
9093
  <span class="PreProc">require</span> <span class="Special">&quot;</span><span class="Constant">andand</span><span class="Special">&quot;</span>
8736
9094
  <span class="PreProc">require</span> <span class="Special">&quot;</span><span class="Constant">base64</span><span class="Special">&quot;</span>
8737
9095
  <span class="PreProc">require</span> <span class="Special">&quot;</span><span class="Constant">cgi</span><span class="Special">&quot;</span>
9096
+ <span class="PreProc">require</span> <span class="Special">&quot;</span><span class="Constant">coderay</span><span class="Special">&quot;</span>
8738
9097
  <span class="PreProc">require</span> <span class="Special">&quot;</span><span class="Constant">digest/sha2</span><span class="Special">&quot;</span>
8739
9098
  <span class="PreProc">require</span> <span class="Special">&quot;</span><span class="Constant">erb</span><span class="Special">&quot;</span>
8740
9099
  <span class="PreProc">require</span> <span class="Special">&quot;</span><span class="Constant">fileutils</span><span class="Special">&quot;</span>
8741
9100
  <span class="PreProc">require</span> <span class="Special">&quot;</span><span class="Constant">irb</span><span class="Special">&quot;</span>
9101
+ <span class="PreProc">require</span> <span class="Special">&quot;</span><span class="Constant">open3</span><span class="Special">&quot;</span>
8742
9102
  <span class="PreProc">require</span> <span class="Special">&quot;</span><span class="Constant">rdiscount</span><span class="Special">&quot;</span>
8743
9103
  <span class="PreProc">require</span> <span class="Special">&quot;</span><span class="Constant">rdoc/markup/to_html</span><span class="Special">&quot;</span>
8744
9104
  <span class="PreProc">require</span> <span class="Special">&quot;</span><span class="Constant">tempfile</span><span class="Special">&quot;</span>
@@ -8752,6 +9112,7 @@ convenient list of all of Codnar's parts and dependencies:
8752
9112
 
8753
9113
  <span class="PreProc">require</span> <span class="Special">&quot;</span><span class="Constant">codnar/version</span><span class="Special">&quot;</span>
8754
9114
 
9115
+ <span class="PreProc">require</span> <span class="Special">&quot;</span><span class="Constant">codnar/coderay</span><span class="Special">&quot;</span>
8755
9116
  <span class="PreProc">require</span> <span class="Special">&quot;</span><span class="Constant">codnar/hash_extensions</span><span class="Special">&quot;</span>
8756
9117
  <span class="PreProc">require</span> <span class="Special">&quot;</span><span class="Constant">codnar/markdown</span><span class="Special">&quot;</span>
8757
9118
  <span class="PreProc">require</span> <span class="Special">&quot;</span><span class="Constant">codnar/rdoc</span><span class="Special">&quot;</span>
@@ -10320,6 +10681,7 @@ spec = <span class="Type">Gem</span>::<span class="Type">Specification</span>.ne
10320
10681
  <span class="Constant"> into a narrative that describes the overall system.</span>
10321
10682
  <span class="Constant"> </span><span class="Special">EOF</span>
10322
10683
  spec.add_dependency(<span class="Special">&quot;</span><span class="Constant">andand</span><span class="Special">&quot;</span>)
10684
+ spec.add_dependency(<span class="Special">&quot;</span><span class="Constant">coderay</span><span class="Special">&quot;</span>)
10323
10685
  spec.add_dependency(<span class="Special">&quot;</span><span class="Constant">rdiscount</span><span class="Special">&quot;</span>)
10324
10686
  <span class="Statement">end</span>
10325
10687
 
@@ -11010,31 +11372,6 @@ Colors
11010
11372
  <span class="Type">background-color</span>: Beige;
11011
11373
  <span class="Identifier">}</span>
11012
11374
 
11013
- </pre>
11014
- <table class='layout'>
11015
- <tr>
11016
- <td class='indentation'>
11017
- <pre></pre>
11018
- </td>
11019
- <td class='html'>
11020
- <div class='markdown comment markup'>
11021
- <p>
11022
- Colors for GVim classes
11023
- </p>
11024
- </div>
11025
- </td>
11026
- </tr>
11027
- </table>
11028
- <pre class='css code syntax'>
11029
-
11030
- <span class="Statement">span</span><span class="Identifier">.Constant</span> <span class="Identifier">{</span> <span class="Type">color</span>: Crimson; <span class="Identifier">}</span>
11031
- <span class="Statement">span</span><span class="Identifier">.Identifier</span> <span class="Identifier">{</span> <span class="Type">color</span>: <span class="Constant">Teal</span>; <span class="Identifier">}</span>
11032
- <span class="Statement">span</span><span class="Identifier">.PreProc</span> <span class="Identifier">{</span> <span class="Type">color</span>: Indigo; <span class="Identifier">}</span>
11033
- <span class="Statement">span</span><span class="Identifier">.Special</span> <span class="Identifier">{</span> <span class="Type">color</span>: <span class="Constant">Navy</span>; <span class="Identifier">}</span>
11034
- <span class="Statement">span</span><span class="Identifier">.Statement</span> <span class="Identifier">{</span> <span class="Type">color</span>: <span class="Constant">Maroon</span>; <span class="Identifier">}</span>
11035
- <span class="Statement">span</span><span class="Identifier">.Type</span> <span class="Identifier">{</span> <span class="Type">color</span>: <span class="Constant">Green</span>; <span class="Identifier">}</span>
11036
- <span class="Statement">span</span><span class="Identifier">.Comment</span> <span class="Identifier">{</span> <span class="Type">color</span>: <span class="Constant">Purple</span>; <span class="Identifier">}</span>
11037
-
11038
11375
  </pre>
11039
11376
  <table class='layout'>
11040
11377
  <tr>