GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Theme

This view

  • Original page
  • New address

GeezerVison is showing rouge-ruby.github.io — Class: Rouge::CSSTheme — Documentation by YARD 0.9.37

Index (C) » Rouge » CSSTheme

Class: Rouge::CSSTheme

Inherits:
Theme
  • Object
  • Theme
  • Rouge::CSSTheme
show all
Defined in:
lib/rouge/theme.rb

Direct Known Subclasses

Themes::Base16, Themes::BlackWhiteTheme, Themes::Colorful, Themes::Github, Themes::Gruvbox, Themes::IgorPro, Themes::Magritte, Themes::Molokai, Themes::Monokai, Themes::MonokaiSublime, Themes::Pastie, Themes::ThankfulEyes, Themes::Tulip

Constant Summary

Constants included from Token::Tokens

Token::Tokens::Num, Token::Tokens::Str

Instance Method Summary collapse

  • #initialize(opts = {}) ⇒ CSSTheme constructor

    A new instance of CSSTheme.

  • #render {|"#{@scope} table td { padding: 5px; }"| ... } ⇒ Object
  • #render_base(selector, &b) ⇒ Object
  • #style_for(tok) ⇒ Object

Methods inherited from Theme

base_style, find, get_own_style, #get_own_style, #get_style, get_style, name, #name, #palette, palette, register, registry, render, style, #styles, styles

Methods included from Token::Tokens

token

Constructor Details

#initialize(opts = {}) ⇒ CSSTheme

Returns a new instance of CSSTheme.


164
165
166
# File 'lib/rouge/theme.rb', line 164

def initialize(opts={})
  @scope = opts[:scope] || '.highlight'
end

Instance Method Details

#render {|"#{@scope} table td { padding: 5px; }"| ... } ⇒ Object

Yields:

  • ("#{@scope} table td { padding: 5px; }")

168
169
170
171
172
173
174
175
176
177
178
# File 'lib/rouge/theme.rb', line 168

def render(&b)
  return enum_for(:render).to_a.join("\n") unless b

  # shared styles for tableized line numbers
  yield "#{@scope} table td { padding: 5px; }"
  yield "#{@scope} table pre { margin: 0; }"

  styles.each do |tok, style|
    Style.new(self, style).render(css_selector(tok), &b)
  end
end

#render_base(selector, &b) ⇒ Object


180
181
182
# File 'lib/rouge/theme.rb', line 180

def render_base(selector, &b)
  self.class.base_style.render(selector, &b)
end

#style_for(tok) ⇒ Object


184
185
186
# File 'lib/rouge/theme.rb', line 184

def style_for(tok)
  self.class.get_style(tok)
end
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.