WP-Terminal
WP-Terminal is a Wordpress Plugin that provides a terminal-like box for embedding terminal commands within pages or posts.
Here, you can see a live demo of the plugin:
mariano@computer:$ ls -a
user@vera:$ ls -a
mariano@vera:$ ls -a
user@computer:$ ls -a
user@computer:$ ls
. ..
ls -a
. .. .hiden_file
. ..
ls -a
. .. .hiden_file
Take a look to the Wordpress page of the plugin to see the basic syntax and download links
This plugin is just a customization of Ryan McGeary’s WP-Syntax, and the css is an idea taken from a nice blog: Casidiablo
Blogs using WP-Terminal:
- 0Pointer (of course!)
- LePingouin (starting here)
- iGhost (starting here: Love UNIX)
- Empulse Group
- eXPe
- Mostly Harmless (starting here: Terminal Syntax highligher plugin)
- Experiences and adventures in the Cisco and Linux world…(starting here)
- Superubuntu
- The Sh17
- El blog de Ernesto Carrión
If you want to be added to this page, just leave a comment and provide your URL
Hola!, he visto por ahi que hablas español, espero que asi sea
, el plugin esta excelentisimo!!, gracias por ese gran aporte!
Hi I’ve been looking for something like this nice plugin for some time being a *nix geek it’s wonderful to have the terminal icon displayed for commands/code snippets so if you want feel free to add my blot to the list of sites using your plugin
Thanks, Lethe.
Excellent plug in! Thank you very much for making it!
I have a feature request. Could you make the default username and computer globally configurable in a settings section on the WordPress configuration, so that I don’t have to put them everywhere except where I want a different one and still have a nice username and computer on my web site.
Hi Pablo! Glad you liked it.
Even it’s in my plans to add a config page, I don’t know when I’ll be able to do it. In the meanwhile, you can edit wp-terminal.php and modify the defaults in lines 85 and 87 as a workaround
The documentation says that we should add an id=”terminal” to each pre, but ids should be unique so you either end up with only one terminal per post, or with broken HTML. It should be class, not id, for the argument.
@J. Pablo Fernández
Nevermind, disregard that comment.
Add change prompt from user root:
if ($user == ‘root’) {
$prompt = $user.”@”.$computer.”:# “;
} else {
$prompt = $user.”@”.$computer.”:$ “;
}
Hello again,
I made some more changes to its plugin and packaged it in http://rra.etc.br/linux/wp/wp-terminal.0.3.zip
The changes were:
- Added the option “color” to color the prompt (like gentoo-linux prompt). The possible values are “true/false”, with the default “false”;
- Now the plugin replaces the occurrence of the key [prompt] for the $prompt;
- Put the $prompt string in bold to highlight.
- Remove blank lines from the beginning and end of
but not put blank lines at the beginning or end of the block of commands.
These changes were made by my friend Almir Mendes (m3nd3s@gmail.com) and other minor changes by me (rudsonalves@rra.etc.br).
@rudson
I’ve been using wp-terminal for a while, but I just replaced the wp-terminal.php from rudson’s modifications and the [prompt] replacement was one of the things I really wanted in the plugin
the ‘color’ option needs some work though. I might add some updates of my own to this plugin soon
I have started to use it on my blog to, Nice Work.
nice plugin! good for Linuxers.