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

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:

If you want to be added to this page, just leave a comment and provide your URL

Compartí:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Netvibes
  • StumbleUpon
  • Technorati
  • Twitter

22 comments

  1. macksam says:

    Hola!, he visto por ahi que hablas español, espero que asi sea :-P , el plugin esta excelentisimo!!, gracias por ese gran aporte!

  2. Lethe says:

    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 :D

    Thanks, Lethe.

  3. 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.

    • Mariano says:

      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 ;)

  4. 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.

  5. rudson says:

    Add change prompt from user root:

    if ($user == ‘root’) {
    $prompt = $user.”@”.$computer.”:# “;
    } else {
    $prompt = $user.”@”.$computer.”:$ “;
    }

  6. rudson says:

    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

     block. This allows you to create code as:
    
    ls-la
    total 788
    drwxr-xr-x 3 rudson users 4096 2009-07-26 14:55. /
    drwxr-xr-x 4 rudson users 48 2009-07-24 14:35 .. /
    -rw-r - r - 1 rudson users 207679 2009-07-24 11:56 category-icons.2.1.zip
    

    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).

  7. tash says:

    @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

  8. Ecarrion says:

    I have started to use it on my blog to, Nice Work.

  9. tw says:

    nice plugin! good for Linuxers.

  10. Serge says:

    Thanks for this post, I was looking for information like this.

  11. tommat says:

    Thanks for a plugin ! :)

  12. Saviour says:

    I really enjoyed it, I was look to fond this king of plugin. Even though there is no config page, I find it very usefull :)

  13. Hai bro, i just tested your plugin with the newest wordpress version. It works. :) just give a rating in wordpress.org. And now, i will use your plugin in my blog. Thanks a lot :)

  14. seqizz says:

    Hi, i’m using with one wish. How can I not show the prompt, the user@computer part? I want to use that for also the </code tag

  15. Jochem says:

    Really cool, thanks!

    Since I’m lazy, I’ve taken the css code and changed a few bits to my theme. Now I can use the ‘quote’ button in the wysiwyg editor and get the same effect, without having to think about the variables.

    With basic knowledge of css it should be quite easy to change the blockquote style used by your theme. Mine looks like this now:

    .entry blockquote {
    color:#FFF;
    background-color:#444;
    background-image:url(‘images/terminal.png’);
    border-top:1px solid #AAA;
    border-bottom:1px solid #AAA;
    font-family: ‘Courier New’, Courier, Fixed;
    background-position:15px 10px;
    background-repeat:no-repeat;
    margin-bottom:10px;
    margin-left:0;
    margin-top:10px;
    text-align:left;
    padding:5px 10px 0px 40px
    }

    .entry blockquote p { font-style: normal }

    .entry blockquote p:before { content: ‘user:$ ‘; font-style: italic; }

    The “p:before” puts some text before each line (in my case “user:$”).

Trackbacks /
Pingbacks

  1. Terminal Syntax highligher plugin

Leave a Reply