From ce059fee0df97efcfb30b173ee6d8aa7a8d43ecd Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Mon, 21 Mar 2022 22:17:07 +0300 Subject: add an include for shell commands & output --- _includes/shell.html | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 _includes/shell.html (limited to '_includes') diff --git a/_includes/shell.html b/_includes/shell.html new file mode 100644 index 0000000..40ed1c8 --- /dev/null +++ b/_includes/shell.html @@ -0,0 +1,22 @@ +
+{% assign cmd = include.cmd | newline_to_br | strip_newlines %} +{% assign 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: '' %} +
+
$
{{ cmd }}
+
+
{{ include.out }}
+
-- cgit v1.2.3