Class: PDFEmbed
- Inherits:
-
Liquid::Tag
- Object
- Liquid::Tag
- PDFEmbed
- Defined in:
- lib/jekyll-pdf-embed.rb
Instance Method Summary collapse
-
#initialize(tag_name, text, tokens) ⇒ PDFEmbed
constructor
A new instance of PDFEmbed.
- #render(context) ⇒ Object
Constructor Details
#initialize(tag_name, text, tokens) ⇒ PDFEmbed
Returns a new instance of PDFEmbed.
5 6 7 8 |
# File 'lib/jekyll-pdf-embed.rb', line 5 def initialize(tag_name, text, tokens) super @text = text end |
Instance Method Details
#render(context) ⇒ Object
10 11 12 |
# File 'lib/jekyll-pdf-embed.rb', line 10 def render(context) %Q{<style>.pdf-embed-container { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; margin-bottom: 20px; } .pdf-embed-container iframe, .pdf-embed-container object, .pdf-embed-container embed { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }</style><div class='pdf-embed-container'><iframe title="PDF file" width="640" height="390" src=#{@text} frameborder="0" allowfullscreen></iframe></div>} end |