module Asciidoctor::SyntaxHighlighter::PygmentsAdapter::Styles

Constants

BASE_SELECTOR
BaseStyleRx
DEFAULT_STYLE
TOKEN_CLASS_PREFIX

Public Instance Methods

read_stylesheet(style) click to toggle source
# File lib/asciidoctor/syntax_highlighter/pygments.rb, line 97
def read_stylesheet style
  library_available? ? @@stylesheet_cache[style || DEFAULT_STYLE] || '/* Failed to load Pygments CSS. */' : '/* Pygments CSS disabled because Pygments is not available. */'
end
stylesheet_basename(style) click to toggle source
# File lib/asciidoctor/syntax_highlighter/pygments.rb, line 101
def stylesheet_basename style
  %(pygments-#{style || DEFAULT_STYLE}.css)
end

Private Instance Methods

base_style(style) click to toggle source
# File lib/asciidoctor/syntax_highlighter/pygments.rb, line 107
def base_style style
  library_available? ? @@base_style_cache[style || DEFAULT_STYLE] : nil
end
style_available?(style) click to toggle source
# File lib/asciidoctor/syntax_highlighter/pygments.rb, line 111
def style_available? style
  (((@@available_styles ||= ::Pygments.styles.to_set).include? style) rescue nil) && style
end