內容簡介
WP-ShkShell 提供一個類似終端機的方塊,可在頁面或文章中嵌入終端機命令。
它還支持多行、多種命令和語法高亮。
此代碼是 WP-Terminal (https://wordpress.org/extend/plugins/wp-terminal/) 的修改版。
用法
使用<pre lang="shell" prompt="$">和</pre> 將終端塊包裹起來。
範例 1:預設提示
<pre lang="shell" prompt="$">
ls -a
</pre>
範例 2:自訂提示
<pre lang="shell" prompt="#">
ls -a
</pre>
範例 3:另一個自訂提示
<pre lang="shell" prompt="user@machine$">
ls -a
</pre>
範例 4:註解
<pre lang="shell" prompt="user@machine$">
ls -a
# 還會列出隱藏檔案
</pre>
範例 5:多行命令
<pre lang="shell">
ls
<br>ls -a
</pre>
範例 6:多行命令和多個命令
<pre lang="shell">
ls
file1 file2 file3
<br>ls -A
.file0 file1 file2 file3
</pre>
外掛標籤
開發者團隊
原文外掛簡介
WP-ShkShell provides a terminal-like box for embedding terminal commands within pages or posts.
It also support multi-lines, multi-commands and has syntax hightlight.
The code is a modification of WP-Terminal (https://wordpress.org/extend/plugins/wp-terminal/).
Usage
Wrap terminal blocks with
and
.
Example 1: Default prompt
ls -a
Example 2: Customized prompt
ls -a
Example 3: Another customized prompt
ls -a
Example 4: Comments
ls -a
# will also list hidden files
Example 5: Multiline commands
ls
ls -a
Example 6: Multiline lines, multiple commands
ls
file1 file2 file3
ls -A
.file0 file1 file2 file3
