Parent

Namespace

Included Modules

Class/Module Index [+]

Quicksearch

Rouge::Theme

Public Class Methods

find(n) click to toggle source
# File lib/rouge/theme.rb, line 103
def find(n)
  registry[n.to_s]
end
get_own_style(token) click to toggle source
# File lib/rouge/theme.rb, line 84
def get_own_style(token)
  token.token_chain.each do |anc|
    return styles[anc] if styles[anc]
  end

  nil
end
get_style(token) click to toggle source
# File lib/rouge/theme.rb, line 92
def get_style(token)
  get_own_style(token) || styles[Token::Tokens::Text]
end
name(n=nil) click to toggle source
# File lib/rouge/theme.rb, line 96
def name(n=nil)
  return @name if n.nil?

  @name = n.to_s
  Theme.registry[@name] = self
end
palette(arg={}) click to toggle source
# File lib/rouge/theme.rb, line 48
def self.palette(arg={})
  @palette ||= InheritableHash.new(superclass.palette)

  if arg.is_a? Hash
    @palette.merge! arg
    @palette
  else
    case arg
    when /#[0-9a-f]+/
      arg
    else
      @palette[arg] or raise "not in palette: #{arg.inspect}"
    end
  end
end
registry() click to toggle source
# File lib/rouge/theme.rb, line 107
def registry
  @registry ||= {}
end
render(opts={}, &b) click to toggle source
# File lib/rouge/theme.rb, line 69
def self.render(opts={}, &b)
  new(opts).render(&b)
end
style(*tokens) click to toggle source
# File lib/rouge/theme.rb, line 74
def style(*tokens)
  style = tokens.last.is_a?(Hash) ? tokens.pop : {}

  style = Style.new(self, style)

  tokens.each do |tok|
    styles[tok] = style
  end
end
styles() click to toggle source
# File lib/rouge/theme.rb, line 65
def self.styles
  @styles ||= InheritableHash.new(superclass.styles)
end

Public Instance Methods

styles() click to toggle source
# File lib/rouge/theme.rb, line 43
def styles
  @styles ||= self.class.styles.dup
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.