aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/_includes/jekyll-theme/shell.html
blob: 7fa083817d5c149b9d545d4820a51e2d9ece7b1d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<div class="shell">
{% assign cmd = include.cmd | newline_to_br | strip_newlines %}
{% assign br = '<br />' %}
{% assign br_len = br | size %}
{% assign prefix = cmd | slice: 0,br_len %}
{% if prefix == br %}
  {% assign cmd = cmd | remove_first: br %}
{% endif %}
{% assign cmd = cmd | split: br %}
{% assign new_cmd = '' | split: '' %}
{% for line in cmd %}
  {% capture new_line %}{{ line }}
{% endcapture %}
  {% assign new_cmd = new_cmd | push: new_line %}
{% endfor %}
{% assign cmd = new_cmd %}
{% assign cmd = cmd | join: '' %}
<div class='pretty-scrollbar'>
  <pre class="shell-mark">$</pre><pre class="shell-cmd">{{ cmd }}</pre>
</div>
{% if include.out %}
  <pre class="shell-out">{{ include.out }}</pre>
{% endif %}
</div>