Last active
August 29, 2015 14:22
-
-
Save nmenag/675e5c4fefb02df5cc58 to your computer and use it in GitHub Desktop.
Module Jekyll for display a linux terminal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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