class Jekyll::Converters::Graphviz

Attributes

cache[RW]

Public Instance Methods

convert(content) click to toggle source
# File lib/jekyll/converters/graphviz.rb, line 27
def convert(content)
  setup unless @setup
  @cache[content] ||= GraphViz.parse_string(content).output(@format => String)
end
matches(ext) click to toggle source
# File lib/jekyll/converters/graphviz.rb, line 18
def matches(ext)
  ext =~ /^\.dot$/i
end
output_ext(ext) click to toggle source
# File lib/jekyll/converters/graphviz.rb, line 22
def output_ext(ext)
  setup unless @setup
  ".#{@format}"
end
setup() click to toggle source
# File lib/jekyll/converters/graphviz.rb, line 11
def setup
  require 'ruby-graphviz'
  @format = (@config.dig("graphviz", "format") || :svg).to_sym
  @cache = {}
  @setup = true
end