Project

General

Profile

Feature #3382 » syntax_highlighter_patch.diff

Line Number patch - Eric Thomas, 2010-04-14 06:05

View differences:

lib/redmine/syntax_highlighting.rb
46 46
        # Highlights +text+ using +language+ syntax
47 47
        # Should not return outer pre tag
48 48
        def highlight_by_language(text, language)
49
          ::CodeRay.scan(text, language).html(:line_numbers => :inline, :wrap => :span)
49
          ::CodeRay.scan(text, language).html(:line_numbers => :table)
50 50
        end
51 51
      end
52 52
    end
public/stylesheets/scm.css
193 193
.syntaxhl .del .del { color: #800; font-weight:bold }
194 194
.syntaxhl .chg .chg { color: #66f; }
195 195
.syntaxhl .head .head { color: #f4f; }
196

  
197
table.CodeRay { border-collapse: collapse }
198
table.CodeRay td { vertical-align: top }
199

  
200
table.CodeRay td.line_numbers {
201
  background-color: #def;
202
  color: gray;
203
  text-align: right;
204
}
205

  
206
table.CodeRay td.code { width: 100% }
207

  
208
table.CodeRay td.line_numbers pre, table.CodeRay td.code pre {
209
  padding: 0; margin:0;
210
  background-color: transparent;
211
  border: none;
212
}
213

  
214
table.CodeRay .af { color:#00C }
215
table.CodeRay .an { color:#007 }
216
table.CodeRay .at { color:#f08 }
217
table.CodeRay .av { color:#700 }
218
table.CodeRay .aw { color:#C00 }
219
table.CodeRay .bi { color:#509; font-weight:bold }
220
table.CodeRay .c  { color:#888; }
221

  
222
table.CodeRay .ch { color:#04D }
223
table.CodeRay .ch .k { color:#04D }
224
table.CodeRay .ch .dl { color:#039 }
225

  
226
table.CodeRay .cl { color:#B06; font-weight:bold }
227
table.CodeRay .cm { color:#A08; font-weight:bold }
228
table.CodeRay .co { color:#036; font-weight:bold }
229
table.CodeRay .cr { color:#0A0 }
230
table.CodeRay .cv { color:#369 }
231
table.CodeRay .de { color:#B0B; }
232
table.CodeRay .df { color:#099; font-weight:bold }
233
table.CodeRay .di { color:#088; font-weight:bold }
234
table.CodeRay .dl { color:black }
235
table.CodeRay .do { color:#970 }
236
table.CodeRay .dt { color:#34b }
237
table.CodeRay .ds { color:#D42; font-weight:bold }
238
table.CodeRay .e  { color:#666; font-weight:bold }
239
table.CodeRay .en { color:#800; font-weight:bold }
240
table.CodeRay .er { color:#F00; background-color:#FAA }
241
table.CodeRay .ex { color:#C00; font-weight:bold }
242
table.CodeRay .fl { color:#60E; font-weight:bold }
243
table.CodeRay .fu { color:#06B; font-weight:bold }
244
table.CodeRay .gv { color:#d70; font-weight:bold }
245
table.CodeRay .hx { color:#058; font-weight:bold }
246
table.CodeRay .i  { color:#00D; font-weight:bold }
247
table.CodeRay .ic { color:#B44; font-weight:bold }
248

  
249
table.CodeRay .il { background: #ddd; color: black }
250
table.CodeRay .il .il { background: #ccc }
251
table.CodeRay .il .il .il { background: #bbb }
252
table.CodeRay .il .idl { background: #ddd; font-weight: bold; color: #666 }
253
table.CodeRay .idl { background-color: #bbb; font-weight: bold; color: #666; }
254

  
255
table.CodeRay .im { color:#f00; }
256
table.CodeRay .in { color:#B2B; font-weight:bold }
257
table.CodeRay .iv { color:#33B }
258
table.CodeRay .la { color:#970; font-weight:bold }
259
table.CodeRay .lv { color:#963 }
260
table.CodeRay .oc { color:#40E; font-weight:bold }
261
table.CodeRay .of { color:#000; font-weight:bold }
262
table.CodeRay .op { }
263
table.CodeRay .pc { color:#038; font-weight:bold }
264
table.CodeRay .pd { color:#369; font-weight:bold }
265
table.CodeRay .pp { color:#579; }
266
table.CodeRay .ps { color:#00C; font-weight:bold }
267
table.CodeRay .pt { color:#074; font-weight:bold }
268
table.CodeRay .r, .kw  { color:#080; font-weight:bold }
269

  
270
table.CodeRay .ke { color: #808; }
271
table.CodeRay .ke .dl { color: #606; }
272
table.CodeRay .ke .ch { color: #80f; }
273
table.CodeRay .vl { color: #088; }
274

  
275
table.CodeRay .rx { background-color:#fff0ff }
276
table.CodeRay .rx .k { color:#808 }
277
table.CodeRay .rx .dl { color:#404 }
278
table.CodeRay .rx .mod { color:#C2C }
279
table.CodeRay .rx .fu  { color:#404; font-weight: bold }
280

  
281
table.CodeRay .s { background-color:#fff0f0; color: #D20; }
282
table.CodeRay .s .s { background-color:#ffe0e0 }
283
table.CodeRay .s .s  .s { background-color:#ffd0d0 }
284
table.CodeRay .s .k { }
285
table.CodeRay .s .ch { color: #b0b; }
286
table.CodeRay .s .dl { color: #710; }
287

  
288
table.CodeRay .sh { background-color:#f0fff0; color:#2B2 }
289
table.CodeRay .sh .k { }
290
table.CodeRay .sh .dl { color:#161 }
291

  
292
table.CodeRay .sy { color:#A60 }
293
table.CodeRay .sy .k { color:#A60 }
294
table.CodeRay .sy .dl { color:#630 }
295

  
296
table.CodeRay .ta { color:#070 }
297
table.CodeRay .tf { color:#070; font-weight:bold }
298
table.CodeRay .ts { color:#D70; font-weight:bold }
299
table.CodeRay .ty { color:#339; font-weight:bold }
300
table.CodeRay .v  { color:#036 }
301
table.CodeRay .xt { color:#444 }
302

  
303
table.CodeRay .ins { background: #cfc; }
304
table.CodeRay .del { background: #fcc; }
305
table.CodeRay .chg { color: #aaf; background: #007; }
306
table.CodeRay .head { color: #f8f; background: #505 }
307

  
308
table.CodeRay .ins .ins { color: #080; font-weight:bold }
309
table.CodeRay .del .del { color: #800; font-weight:bold }
310
table.CodeRay .chg .chg { color: #66f; }
311
table.CodeRay .head .head { color: #f4f; }
312

  
(3-3/3)