Class: Rouge::CSSTheme
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ CSSTheme
constructor
A new instance of CSSTheme.
- #render {|"#{@scope} table { border-spacing: 0; }"| ... } ⇒ Object
Methods inherited from Theme
find, get_own_style, get_style, name, palette, registry, render, style, #styles, styles
Constructor Details
#initialize(opts = {}) ⇒ CSSTheme
Returns a new instance of CSSTheme.
128 129 130 |
# File 'lib/rouge/theme.rb', line 128 def initialize(opts={}) @scope = opts[:scope] || '.highlight' end |
Instance Method Details
#render {|"#{@scope} table { border-spacing: 0; }"| ... } ⇒ Object
132 133 134 135 136 137 138 139 140 141 142 143 |
# File 'lib/rouge/theme.rb', line 132 def render(&b) return enum_for(:render).to_a.join("\n") unless b # shared styles for tableized line numbers yield "#{@scope} table { border-spacing: 0; }" yield "#{@scope} table td { padding: 5px; }" yield "#{@scope} table .gutter { text-align: right; }" styles.each do |tokname, style| style.render(css_selector(Token[tokname]), &b) end end |