Skip to content

Instantly share code, notes, and snippets.

@nmenag
Last active August 29, 2015 14:22
Show Gist options
  • Save nmenag/675e5c4fefb02df5cc58 to your computer and use it in GitHub Desktop.
Save nmenag/675e5c4fefb02df5cc58 to your computer and use it in GitHub Desktop.
Module Jekyll for display a linux terminal
module Jekyll
class Terminal < Liquid::Block
def initialize(tag_name, text, tokens)
super
@text = text
end
def render(context)
text = super.gsub("\n", "<br/>")
<<-HTML
<div id="terminal-window">
<div id="terminal-toolbar">
<div class="terminal-top">
<div id="terminal-title">
Terminal
</div>
</div>
</div>
<div id="terminal-body">
#{text}
</div>
HTML
end#end render method
end#End Class Terminal
end#end module Jekyll
Liquid::Template.register_tag('terminal', Jekyll::Terminal)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment