Class: Jekyll::CodeSandbox

Inherits:
Liquid::Tag
  • Object
show all
Defined in:
lib/jekyll/code_sandbox.rb

Instance Method Summary collapse

Constructor Details

#initialize(tag_name, link, tokens) ⇒ CodeSandbox

Returns a new instance of CodeSandbox.



3
4
5
6
# File 'lib/jekyll/code_sandbox.rb', line 3

def initialize(tag_name, link, tokens)
  super
  @link = link.strip
end

Instance Method Details

#render(context) ⇒ Object



8
9
10
11
12
13
# File 'lib/jekyll/code_sandbox.rb', line 8

def render(context)
  "<iframe src=\"#{@link}?fontsize=14&hidenavigation=1&theme=dark\"
  style=\"width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;\"
  title=\"#{@link}\">
  </iframe>"
end