From 074217a57011eec854300d936ee66185bc505eff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Mon, 17 Oct 2022 00:11:21 -0300 Subject: [PATCH] Allow an empty line to indicate the start of output --- docs/_includes/cli_example.html | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/docs/_includes/cli_example.html b/docs/_includes/cli_example.html index 6694924a5f..edf1c5c166 100644 --- a/docs/_includes/cli_example.html +++ b/docs/_includes/cli_example.html @@ -1,19 +1,37 @@ {% assign linux_cmd_blob = '' %} {% assign linux_split_cmds = include.linux | newline_to_br | strip_newlines | split: '
' %} +{% assign raw_output = false %} {% for linux_raw_cmd in linux_split_cmds %} {% assign linux_cmd = linux_raw_cmd | strip | split: ' ' | first %} {% assign linux_tail = linux_raw_cmd | strip | remove_first: linux_cmd %} - {% capture linux_cmd_blob %}{{linux_cmd_blob}}~ $ {{linux_cmd}}{{linux_tail}} + {% if linux_cmd == nil %} + {% assign raw_output = true %} + {% endif %} + {% if raw_output %} + {% capture linux_cmd_blob %}{{linux_cmd_blob}}{{linux_cmd}}{{linux_tail}} {% endcapture %} + {% else %} + {% capture linux_cmd_blob %}{{linux_cmd_blob}}~ $ {{linux_cmd}}{{linux_tail}} +{% endcapture %} + {% endif %} {% endfor %} {% assign windows_cmd_blob = '' %} {% assign windows_split_cmds = include.windows | newline_to_br | strip_newlines | split: '
' %} +{% assign raw_output = false %} {% for windows_raw_cmd in windows_split_cmds %} {% assign windows_cmd = windows_raw_cmd | strip | split: ' ' | first %} {% assign windows_tail = windows_raw_cmd | strip | remove_first: windows_cmd %} - {% capture windows_cmd_blob %}{{windows_cmd_blob}}C:\> {{windows_cmd}}{{windows_tail}} + {% if windows_cmd == nil %} + {% assign raw_output = true %} + {% endif %} + {% if raw_output == true %} + {% capture windows_cmd_blob %}{{windows_cmd_blob}}{{windows_cmd}}{{windows_tail}} {% endcapture %} + {% else %} + {% capture windows_cmd_blob %}{{windows_cmd_blob}}C:\> {{windows_cmd}}{{windows_tail}} +{% endcapture %} + {% endif %} {% endfor %}