You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: plugins/command-line/index.html
+92-6
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,8 @@ <h1>How to use</h1>
25
25
26
26
<p>Add class <strong>command-line</strong> to your <codeclass="language-markup"><pre></code>. For a server command line, specify the user and host names using the <codeclass="language-markup">data-user</code> and <codeclass="language-markup">data-host</code> attributes. The resulting prompt displays a <strong>#</strong> for the root user and <strong>$</strong> for all other users. For any other command line, such as a Windows prompt, you may specify the entire prompt using the <codeclass="language-markup">data-prompt</code> attribute.</p>
27
27
28
-
<p>Optional: You may specify the lines to be presented as output (no prompt and no highlighting) through the <codeclass="language-markup">data-output</code> attribute on the <codeclass="language-markup"><pre></code> element in the following simple format:</p>
28
+
<h2>Optional: Command output (positional)</h2>
29
+
<p>You may specify the lines to be presented as output (no prompt and no highlighting) through the <codeclass="language-markup">data-output</code> attribute on the <codeclass="language-markup"><pre></code> element in the following simple format:</p>
29
30
<ul>
30
31
<li>A single number refers to the line with that number</li>
31
32
<li>Ranges are denoted by two numbers, separated with a hyphen (-)</li>
@@ -48,26 +49,60 @@ <h1>How to use</h1>
48
49
<dd>Lines 1 through 2, line 5, lines 9 through 20</dd>
49
50
</dl>
50
51
51
-
<p>Optional: To automatically present some lines as output, you can prefix those lines with any string and specify the prefix using the <codeclass="language-markup">data-filter-output</code> attribute on the <codeclass="language-markup"><pre></code> element. For example, <codeclass="language-markup">data-filter-output="(out)"</code> will treat lines beginning with <codeclass="language-markup">(out)</code> as output and remove the prefix.</p>
52
+
<h2>Optional: Command output (prefix)</h2>
53
+
<p>To automatically present some lines as output, you can prefix those lines with any string and specify the prefix using the <codeclass="language-markup">data-filter-output</code> attribute on the <codeclass="language-markup"><pre></code> element. For example, <codeclass="language-markup">data-filter-output="(out)"</code> will treat lines beginning with <codeclass="language-markup">(out)</code> as output and remove the prefix.</p>
52
54
53
-
<p>Output lines are user selectable by default, so if you select the whole content of the code block, it will select the shell commands and any output lines. This may not be desireable if you want to copy/paste just the commands and not the output. If you want to make the output not user selectable then add the following to your CSS:</p>
55
+
<p>A blank line will render as an empty line with a prompt. If you want an empty line without a prompt then you can use a line containing just the output prefix, e.g. <codeclass="language-markup">(out)</code>. See the blank lines in the examples below.</p>
56
+
57
+
<p>Output lines are user selectable by default, so if you select the whole content of the code block, it will select the shell commands and any output lines. This may not be desirable if you want to copy/paste just the commands and not the output. If you want to make the output not user selectable then add the following to your CSS:</p>
<p>Optional: For multi-line commands you can specify the <codeclass="language-markup">data-continuation-str</code> attribute on the <codeclass="language-markup"><pre></code> element. For example, <codeclass="language-markup">data-continuation-str="\"</code> will treat lines ending with <codeclass="language-markup">\</code> as being continued on the following line. Continued lines will have a prompt as set by the attribute <codeclass="language-markup">data-continuation-prompt</code> or a default of <codeclass="language-markup">></code>.</p>
63
+
<h2>Optional: Multi-line commands</h2>
64
+
<p>You can configure the plugin to handle multi-line commands. This can be done in two ways; setting a line continuation string (as in Bash); or explicitly marking continuation lines with a prefix for languages that do not have a continuation string/character, e.g. SQL, Scala, etc..</p>
<dd>This works in a similar way to <codeclass="language-markup">data-filter-output</code>. Prefix all continuation lines with the value of <codeclass="language-markup">data-filter-continuation</code> and they will be displayed with the prompt set in <codeclass="language-markup">data-continuation-prompt</code>. For example, <codeclass="language-markup">data-filter-continuation="(con)"</code> will treat lines beginning with <codeclass="language-markup">(con)</code> as continuation lines and remove the prefix.</dd>
<dd>Set this attribute to define the prompt to be displayed when the command has continued beyond the first line (whether using line continuation or command termination), e.g. for MySQL <codeclass="language-markup">data-continuation-prompt="->"</code>. If this attribute is not set then a default of <codeclass="language-markup">></code> will be used.</dd>
0 commit comments