This jekyll plugin implements a new tag "terminal", to place shell command line blocks in you posts.
Download
https://github.com/xinpascal/jekyll-plugins
Usage
Place the files in the _plugins and css directories into your jekyll directory.
Insert this line to your _layouts html head.
I insert it to my _layouts/default.html, so all posts could use this tag.
1 <link rel="stylesheet" href="/css/terminal.css">
- Place the following tag anywhere in one of your pages.
1 {% terminal Title %}
2
3 Command line
4 Command line
5
6 {% endterminal %}
Example
We can place the following code in one of our pages:
1 {% terminal shell examples %}
2
3 ~$ cd /opt
4 /opt$ pwd
5 /opt
6 ~$ sudo -i
7 [sudo] password for xouyang:
8 ~# exit
9
10 {% endterminal %}
And would get something like this on the page:
shell examples
~$ cd /opt
/opt$ pwd
/opt
~$ sudo -i
[sudo] password for xouyang:
~# exit