Chris@0: module CodeRay Chris@0: module Styles Chris@0: Chris@0: class Cycnus < Style Chris@0: Chris@0: register_for :cycnus Chris@0: Chris@0: code_background = '#f8f8f8' Chris@0: numbers_background = '#def' Chris@0: border_color = 'silver' Chris@0: normal_color = '#000' Chris@0: Chris@0: CSS_MAIN_STYLES = <<-MAIN Chris@0: .CodeRay { Chris@0: background-color: #{code_background}; Chris@0: border: 1px solid #{border_color}; Chris@0: font-family: 'Courier New', 'Terminal', monospace; Chris@0: color: #{normal_color}; Chris@0: } Chris@0: .CodeRay pre { margin: 0px } Chris@0: Chris@0: div.CodeRay { } Chris@0: Chris@0: span.CodeRay { white-space: pre; border: 0px; padding: 2px } Chris@0: Chris@0: table.CodeRay { border-collapse: collapse; width: 100%; padding: 2px } Chris@0: table.CodeRay td { padding: 2px 4px; vertical-align: top } Chris@0: Chris@0: .CodeRay .line_numbers, .CodeRay .no { Chris@0: background-color: #{numbers_background}; Chris@0: color: gray; Chris@0: text-align: right; Chris@0: } Chris@0: .CodeRay .line_numbers tt { font-weight: bold } Chris@0: .CodeRay .line_numbers .highlighted { color: red } Chris@0: .CodeRay .no { padding: 0px 4px } Chris@0: .CodeRay .code { width: 100% } Chris@0: Chris@0: ol.CodeRay { font-size: 10pt } Chris@0: ol.CodeRay li { white-space: pre } Chris@0: Chris@0: .CodeRay .code pre { overflow: auto } Chris@0: MAIN Chris@0: Chris@0: TOKEN_COLORS = <<-'TOKENS' Chris@0: .debug { color:white ! important; background:blue ! important; } Chris@0: Chris@0: .af { color:#00C } Chris@0: .an { color:#007 } Chris@0: .at { color:#f08 } Chris@0: .av { color:#700 } Chris@0: .aw { color:#C00 } Chris@0: .bi { color:#509; font-weight:bold } Chris@0: .c { color:#888; } Chris@0: Chris@0: .ch { color:#04D } Chris@0: .ch .k { color:#04D } Chris@0: .ch .dl { color:#039 } Chris@0: Chris@0: .cl { color:#B06; font-weight:bold } Chris@0: .cm { color:#A08; font-weight:bold } Chris@0: .co { color:#036; font-weight:bold } Chris@0: .cr { color:#0A0 } Chris@0: .cv { color:#369 } Chris@0: .de { color:#B0B; } Chris@0: .df { color:#099; font-weight:bold } Chris@0: .di { color:#088; font-weight:bold } Chris@0: .dl { color:black } Chris@0: .do { color:#970 } Chris@0: .dt { color:#34b } Chris@0: .ds { color:#D42; font-weight:bold } Chris@0: .e { color:#666; font-weight:bold } Chris@0: .en { color:#800; font-weight:bold } Chris@0: .er { color:#F00; background-color:#FAA } Chris@0: .ex { color:#C00; font-weight:bold } Chris@0: .fl { color:#60E; font-weight:bold } Chris@0: .fu { color:#06B; font-weight:bold } Chris@0: .gv { color:#d70; font-weight:bold } Chris@0: .hx { color:#058; font-weight:bold } Chris@0: .i { color:#00D; font-weight:bold } Chris@0: .ic { color:#B44; font-weight:bold } Chris@0: Chris@0: .il { background: #ddd; color: black } Chris@0: .il .il { background: #ccc } Chris@0: .il .il .il { background: #bbb } Chris@0: .il .idl { background: #ddd; font-weight: bold; color: #666 } Chris@0: .idl { background-color: #bbb; font-weight: bold; color: #666; } Chris@0: Chris@0: .im { color:#f00; } Chris@0: .in { color:#B2B; font-weight:bold } Chris@0: .iv { color:#33B } Chris@0: .la { color:#970; font-weight:bold } Chris@0: .lv { color:#963 } Chris@0: .oc { color:#40E; font-weight:bold } Chris@0: .of { color:#000; font-weight:bold } Chris@0: .op { } Chris@0: .pc { color:#038; font-weight:bold } Chris@0: .pd { color:#369; font-weight:bold } Chris@0: .pp { color:#579; } Chris@0: .ps { color:#00C; font-weight:bold } Chris@0: .pt { color:#074; font-weight:bold } Chris@0: .r, .kw { color:#080; font-weight:bold } Chris@0: Chris@0: .ke { color: #808; } Chris@0: .ke .dl { color: #606; } Chris@0: .ke .ch { color: #80f; } Chris@0: .vl { color: #088; } Chris@0: Chris@0: .rx { background-color:#fff0ff } Chris@0: .rx .k { color:#808 } Chris@0: .rx .dl { color:#404 } Chris@0: .rx .mod { color:#C2C } Chris@0: .rx .fu { color:#404; font-weight: bold } Chris@0: Chris@0: .s { background-color:#fff0f0; color: #D20; } Chris@0: .s .s { background-color:#ffe0e0 } Chris@0: .s .s .s { background-color:#ffd0d0 } Chris@0: .s .k { } Chris@0: .s .ch { color: #b0b; } Chris@0: .s .dl { color: #710; } Chris@0: Chris@0: .sh { background-color:#f0fff0; color:#2B2 } Chris@0: .sh .k { } Chris@0: .sh .dl { color:#161 } Chris@0: Chris@0: .sy { color:#A60 } Chris@0: .sy .k { color:#A60 } Chris@0: .sy .dl { color:#630 } Chris@0: Chris@0: .ta { color:#070 } Chris@0: .tf { color:#070; font-weight:bold } Chris@0: .ts { color:#D70; font-weight:bold } Chris@0: .ty { color:#339; font-weight:bold } Chris@0: .v { color:#036 } Chris@0: .xt { color:#444 } Chris@0: Chris@0: .ins { background: #afa; } Chris@0: .del { background: #faa; } Chris@0: .chg { color: #aaf; background: #007; } Chris@0: .head { color: #f8f; background: #505 } Chris@0: Chris@0: .ins .ins { color: #080; font-weight:bold } Chris@0: .del .del { color: #800; font-weight:bold } Chris@0: .chg .chg { color: #66f; } Chris@0: .head .head { color: #f4f; } Chris@0: TOKENS Chris@0: Chris@0: end Chris@0: Chris@0: end Chris@0: end