tpp - text presentation program
What is tpp?
tpp stands for text presentation program and is an ncurses-based presentation tool. The presentation can be written with your favorite editor in a simple description format and then shown on any text terminal that is supported by ncurses - ranging from an old VT100 to the Linux framebuffer to an xterm.
Installation
Prerequisites:
- Ruby 1.8 http://www.ruby-lang.org/
- a recent version of ncurses
- ncurses-ruby https://github.com/eclubb/ncurses-ruby
Optionally:
- FIGlet (if you want to have huge text printed)
Installing tpp:
Just get root and type make install
Using tpp
Start tpp with the presentation file you would like to display:
$ tpp presentation.tpp
To control tpp, the following keys are available:
space bar, cursor-down, cursor-right ... display next page b, cursor-up, cursor-left .............. display previous page q, Q ................................... quit tpp j, J ................................... jump directly to page l, L ................................... reload current file s, S ................................... jump to the start page e, E ................................... jump to the last page c, C ................................... start command line ?, h ................................... show help screen
On the lower left side of your terminal you will notice the current slide number and the total number of slides. Left of that, a â*â will appear when the end of the current slide has been reached. If no â*â appears, pressing space bar the next time will show the next entry on the page (separated by âââ). You are also able to go to the next/previous page at this point.
When you press âlâ (lower-case L) or âLâ, the file you have currently loaded into tpp will be reloaded from disk. This is very useful when you write presentations with tpp, and constantly need a preview.
Writing tpp presentations
The tpp presentation formats consists of normal text lines and special commands. Special commands are contained in lines that begin with âââ and the command name.
The presentation is divided into 1 or more pages, which are separated by the âânewpageâ. Before the first âânewpageâ is encountered, all non-command text is used as the presentationâs abstract. Here, the title, the author and the date can be set, too. You can also optionally specify a name for a page: append it to the âânewpageâ command, separated by a single blank. If no name is set, a name will be automatically generated.
The following commands are allowed in the abstract page:
âauthor: sets the author of the presentation
âtitle: sets the title of the presentation
âdate: sets the date of the presentation. If the date is âtodayâ, todayâs date is inserted instead. You can set a custom format string if you append it after âtodayâ, separated by a blank. Date formats are like formats for date(1), and documented in this manual page. If no format string is supplied, â%b %d %Yâ is assumed as default.
âbgcolor <color>: the background color is set to <color>.
âfgcolor <color>: the foreground color is set to <color>.
Valid colors are white, yellow, red, green, blue, cyan, magenta, black and default for transparency.
Within a page, so-called âpage-localâ commands can be used. The following page-local commands are available:
âheading <heading>: draw a heading. Headings will be centered and drawn in bold (if supported by the terminal).
âhorline: draws a horizontal line in the current line
âheader: adds text to the first line on the screen
âfooter: adds text to the last line on the screen
âcolor <color>: draw the text with specified color until a new color is set
âcenter <text>: center <text>. The text will be drawn centered.
âright <text>: draw <text> right-oriented. When drawing the text, it will be aligned on the right side of the terminal.
â: stop drawing until space bar has been pressed.
âbeginoutput: marks the beginning of a framed output
âendoutput: marks the end of a framed output
âbeginshelloutput: marks the beginning of a framed shell output. The difference between normal output and shell output is that lines that start with $,%, or # are printed as if they were typed by a person.
âendshelloutput: marks the end of a shell output
âsleep <seconds>: tpp stops for 3 seconds, doing nothing and accepting no input.
âboldon: switches on bold printing âboldoff: switches off bold printing
ârevon: switches on reverse printing (i.e. reverse fg and bg colors) ârevoff: switches off reverse printing
âulon: switches on underlined printing âuloff: switches off underlined printing
âhuge <text>: <text> is drawn in huge letters. FIGlet is used to generate the huge letters.
âsethugefont <font>: If you use âhuge FIGlet will use the specified <font> to generate the huge letters. You will find the names of the available fonts in the figlet manual.
âexec <cmd>: executes <cmd>. Useful for e.g. starting image viewers.
âbeginslideleft: starts the âslide in from leftâ mode âendslideleft: ends the âslide in from leftâ mode
âbeginslideright: starts the âslide in from rightâ mode âendslideright: ends the âslide in from rightâ mode
âbeginslidetop: starts the âslide in from the topâ mode âendslidetop: ends the âslide in from the topâ mode
âwithborder: makes a border around the current page
âbeginslidebottom: starts the âslide in from the bottomâ mode âendslidebottom: ends the âslide in from the bottomâ mode
$$ cmd : append the stdout of executing cmd in the shell $% cmd : append the stdout of executing cmd in the shell with % at the beginning of every line(useful with âbeginshelloutput).
You can comment lines using â##
Examples
For a collection of examples that demonstrate the different features of tpp, please have a look into the examples subdirectory in the tpp source distribution.
Options:
tpp âhelp: displays help in text mode tpp -l output input.tpp: converts tpp file into a LaTeX slide tpp âversion: displays version number
The LaTeX slide output option is currently unsupported and will most likely not work correctly!
Vim syntax file
To use the vim syntax file you have to copy the tpp.vim file into ~/.vim/syntax/. If the directory does not exist you have to create it. In the next step you have to copy the following into ~/.vim/filetype.vim:
if exists("did_load_filetypes") finish endif augroup filetype detect au! BufRead,BufNewFile *.tpp setfiletype tpp augroup END
If your vim editor does not use syntax highlighting in the default setup you have to change to the vim command mode and type: syntax on.
Beside the tpp.vim in the contrib subdirectory, thereâs also another, more sophisticated version, which we unfortunately cannot distribute due to license reason. You can find this file at http://www.trish.de/downloads/tpp.vim
OSX TextWrangler/BBEdit syntax file
To use the TextWrangler syntax file you have to copy the TPP.plist file into ~/Library/Application Support/TextWrangler/Language Modules/.
License
tpp - text presentation program
Copyright (C) 2004-2005, 2007 Andreas Krennmair <[email protected]>, Nico Golde <[email protected]>
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA