class Jekyll::Tags::RustPlaygroundHighlight

Attributes

gist_id[RW]
raw[RW]

Public Instance Methods

add_code_tag(code) click to toggle source
Calls superclass method
# File lib/rust_playground_highlight.rb, line 6
def add_code_tag(code)
  super.sub(/\n*<\/pre>/,"</pre><a href='#{playground_url}' target='_new' class='playground btn btn-xs btn-primary active' role='button'>Run</a>").strip
end
options_hash() click to toggle source

The @options ivar was renamed to @highlight_options in commit: github.com/jekyll/jekyll/commit/a7730914df272d003de6d3b63669e8e8417e0c61

# File lib/rust_playground_highlight.rb, line 19
def options_hash
  instance_variable_get(:@highlight_options) || instance_variable_get(:@options)
end
playground_url() click to toggle source
# File lib/rust_playground_highlight.rb, line 23
def playground_url
  PlaygroundLink.build(self).url
end
render(context) click to toggle source
Calls superclass method
# File lib/rust_playground_highlight.rb, line 10
def render(context)
  #calls render on Liquid::Block, which returns the content of the block
  self.raw = self.method(:render).super_method.super_method.call(context).to_s.strip
  self.gist_id = options_hash[:gist_id]
  super
end