這個外掛並未在最新的 3 個 WordPress 主要版本上進行測試。開發者可能不再對這個外掛進行維護或提供技術支援,並可能會與更新版本的 WordPress 產生使用上的相容性問題。

Blog Terminal

描述

Blog Terminal generates a terminal-like box that you can use to demonstrate terminal output or show the entry of terminal/console commands in a manner that is more demonstrative of actually using a Linux/Unix terminal or Windows cmd shell.

The code is a fork of Post Terminal, which is a fork of WP-Terminal which in turn is a modification of WP-Syntax, a source code highlighter plugin for WordPress.

Unlike Post terminal, it uses [terminal] shorthand for the terminal box. It also shows prompt only on lines explitly set to do that.

Basic Usage

The most basic usage is to wrap your terminal blocks with [terminal][/terminal] tags. If no further options are defined within the tag a generic prompt is generated using ‘user@computer’ with no working directory shown. This is similar to exporting PS1=”\u@\h:$ ” in sh(1), setting prompt=”%n@%m:$ ” in csh(1), etc.
Other options available within the tag are user=”user”, computer=”computer”, and cwd=”/path/to/directory”. These allow you to override the generic user@computer settings as well as provide a ‘current working directory’.
The prompt is only shown on the lines starting with ‘$ ‘. So you can mix commands with simulated terminal output.

Usage

Wrap terminal blocks with [terminal user="username" computer="computername" cwd="/path/to/directory"] and [\terminal]. They are all optional. “user” and “computer” will be shown if you don’t provide them, cwd is purely optional.

Example 1: No customized command

[terminal]
$ ls -a
[/terminal]

Example 2: User and computer customizations

[terminal user="tux" computer="linux"]
$ ls -a
[/terminal]

Example 3: Customizing just the user

[terminal user="dak"]
$ ls -a
[/terminal]

Example 4: Customizing user, computer and displaying a working directory

[terminal user="root" computer="linuxserver" cwd="/usr/src/linux"]
$ make mrproper
 ...
 ... 
[/terminal]

螢幕截圖

  • Basic display with no configuration.
  • Basic display with user and computer configuration.
  • Basic display with user and computer and cwdconfiguration.
  • A more thorough example showing demonstrative purposes

安裝

  1. Unzip the plugin .zip file and upload the directory to your /wp-content/plugins/.
  2. Activate the plugin through the ‘Plugins’ menu in WordPress.
  3. Create a post/page that contains a code snippet following the proper usage syntax.

常見問題

What is the best way to ask questions or submit patches?

The best way to reach me is always via email: mail@radeksprta.eu

評價

There are no reviews for this plugin.

貢獻者及開發者

“Blog Terminal” 是一個開源的軟體。以下的人對這個外掛作出了貢獻。

貢獻者

將 Blog Terminal 外掛本地化為台灣繁體中文版。

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄

修改日誌

0.2.1

  • Add missing style file

0.2.0

  • Make compatible with PHP 7

0.1.2

  • Preserve terminal indentation

0.1.1

  • Wrap long lines
  • Wrap terminal in code tags
  • Adhere to the latest WordPress coding standards

0.1.0

  • Initial release