tpp-1.3.1/0000755000175000017500000000000010613074755011337 5ustar akak00000000000000tpp-1.3.1/contrib/0000755000175000017500000000000010613074754012776 5ustar akak00000000000000tpp-1.3.1/contrib/tpp-mode.el0000644000175000017500000001407610210651377015050 0ustar akak00000000000000;; tpp-mode.el - An Major mode for Emacs to editing TextPraesentionProgramm (tpp) - Files ;; Filename: tpp-mode.el ;; Author: Christian Dietrich ;; Version: 0.1 ;; License: GNU General Public License ;; Installation: ;; ;; 1) Optionally, byte-compile this file ;; 2) Put this file in a directory Emacs can find ;; 3) Tell Emacs when to load this file ;; 4) Customize some variables for your system ;; ;; ad 1) ;; Byte-compilation speeds up the load time for this mode ;; and is therefore recommended. Just load this file into ;; Emacs and select "Byte-compile This File" from the ;; "Emacs-Lisp" main menu. This will create the compiled ;; file with the extension "elc". ;; ;; ad 2) ;; The directories that Emacs searches are given by the ;; load-path variable, which you can query within Emacs with ;; ESC-x describe-variable RET load-path Ret ;; To add a directory (eg. ~/.emacs) to load-path, add ;; the following code to your $HOME/.emacs file: ;; (add-to-list 'load-path "~/elisp") ;; ;; ad 3) ;; Add the following lines to your $HOME/.emacs file: ;; (autoload 'tpp-mode "tpp-mode" "TPP mode." t) ;; (add-to-list 'auto-mode-alist '("\\.tpp$" . tpp-mode)) ;; The first line tells Emacs to load tpp-mode.elc or ;; tpp-mode.el when the command 'tpp-mode' is called. ;; The second line tells emacs to invoke the command 'tpp-mode' ;; when a file with a name ending on ".tpp" is opened. ;; ;; ad 4) ;; Some variables might need adjustment to your local system ;; environment. You can do it in your $HOME/.emacs file with ;; commands like ;; (setq tpp-command "xterm -e tpp") ;; (setq tpp-helpcommand "cat /usr/local/share/doc/tpp/README | xless") ;; You can also set these variables interactively from the ;; entry "Options" in the "TPP" main menu that is created ;; when tpp-mode is entered. ;; ;; History: ;; 28.02.2005 Initial Release for Emacs ;; Thanks to: ;; ;; Christoph Dalitz: ;; He wrte the mgp-mode-cd.el, on which this script is based, Thanks (defcustom tpp-mode-hook '() "*Hook for customising `tpp-mode'." :type 'hook :group 'Tpp) ;; custom variables (defcustom tpp-command "xterm -e tpp" "tpp command line. Must be adjusted according to the compilation options, eg." :group 'Tpp) (defcustom tpp-helpcommand "cat /usr/local/share/doc/tpp/README | xless" "Command for display of TPP syntax documentation." :group 'Tpp) ;; shortcut key bindings (defvar tpp-mode-map (let ((map (make-sparse-keymap))) (define-key map (kbd "C-c C-b") 'tpp-preview-file) (define-key map (kbd "C-c C-c") 'tpp-comment-region) (define-key map (kbd "C-c C-u") 'tpp-uncomment-region) map) "Mode map used for `tpp-mode'.") ;; main menu entry (easy-menu-define tpp-mode-menu tpp-mode-map "Menu for `tpp-mode'." '("TPP" ["Preview Buffer" tpp-preview-file ] ["Comment Region" tpp-comment-region ] ["Uncomment Region" tpp-uncomment-region ] ["Syntax Help" (shell-command tpp-helpcommand) ] ["Options" (customize-group "Tpp") ] )) ;; Syntax Higlighting (defvar tpp-mode-font-lock-keywords nil "Tpp keywords used by font-lock.") (if tpp-mode-font-lock-keywords () (let () (setq tpp-mode-font-lock-keywords (list ;; comments (cons "^--##.*" 'font-lock-comment-face) ;;Abstract - Options (cons "^--author.*" 'font-lock-keyword-face) (cons "^--title.*" 'font-lock-keyword-face) (cons "^--date.*" 'font-lock-keyword-face) ;; Local - Option (cons "^--heading.*" 'font-lock-constant-face) (cons "^--center.*" 'font-lock-constant-face) (cons "^--right.*" 'font-lock-constant-face) (cons "^--sleep.*" 'font-lock-constant-face) (cons "^--exec.*" 'font-lock-constant-face) (cons "^--huge.*" 'font-lock-constant-face) (cons "^--newpage.*" 'font-lock-constant-face) (cons "^--huge.*" 'font-lock-constant-face) ;; other format parameters (cons "^--.*" 'font-lock-builtin-face) )) )) ;; Functions (defun tpp-preview-file () "Previews current file with tpp" (interactive) (save-buffer) (shell-command (format "%s %s" tpp-command (shell-quote-argument buffer-file-name)))) (defun tpp-comment-region (start end) "Comments out the current region with '--## '." (interactive "r") (goto-char end) (beginning-of-line) (setq end (point)) (goto-char start) (beginning-of-line) (setq start (point)) (let () (save-excursion (save-restriction (narrow-to-region start end) (while (not (eobp)) (insert "--## ") (forward-line 1))))) ) (defun tpp-uncomment-region (start end) "Remove '--## ' comments from current region." (interactive "r") (goto-char end) (beginning-of-line) (setq end (point)) (goto-char start) (beginning-of-line) (setq start (point)) (let ((prefix-len '5)) (save-excursion (save-restriction (narrow-to-region start end) (while (not (eobp)) (if (string= "--## " (buffer-substring (point) (+ (point) prefix-len))) (delete-char prefix-len)) (forward-line 1))))) ) ;; The Modi Function (defun tpp-mode () "Major mode for editing tpp source. Comments etc. are highlighted with font-lock. There are also a number of commands that make editing and working with TPP files more convenient. These commands are available from the main menu `TPP' or via the following shortcuts: \\[tpp-preview-file] - Run tpp on the current file. \\[tpp-comment-region] - Comments out the current region. \\[tpp-uncomment-region] - Uncomments the current region. " (interactive) (kill-all-local-variables) (setq major-mode 'tpp-mode) (setq mode-name "tpp") (use-local-map tpp-mode-map) (make-local-variable 'font-lock-defaults) (easy-menu-add tpp-mode-menu tpp-mode-map) (if (string-match "XEmacs\\|Lucid" emacs-version) (progn (make-face 'font-lock-builtin-face) (copy-face 'font-lock-preprocessor-face 'font-lock-builtin-face))) (setq font-lock-defaults '(tpp-mode-font-lock-keywords t t ((?_ . "w") (?. . "w")))) ;; let ispell skip '--'-directives (make-local-variable 'ispell-skip-region-alists) (add-to-list 'ispell-skip-region-alist (list "^--.*$")) ;; Hook ablaufen lassen (run-hooks 'tpp-mode-hook) ) ;; End of tpp-mode.eltpp-1.3.1/contrib/tpp.vim0000644000175000017500000000654110207367147014324 0ustar akak00000000000000" Vim syntax file " Language: tpp - Text Presentation Program " Maintainer: Gerfried Fuchs " Filenames: *.tpp " Last Change: 24. February 2005 " URL: http://alfie.ist.org/projects/vim/syntax/tpp.vim " License: BSD " " Comments are very welcome - but please make sure that you are commenting on " the latest version of this file. " SPAM is _NOT_ welcome - be ready to be reported! " For version 5.x: Clear all syntax items " For version 6.x: Quit when a syntax file was already loaded if version < 600 syntax clear elseif exists("b:current_syntax") finish endif if !exists("main_syntax") let main_syntax = 'tpp' endif "" list of the legal switches/options syn match tppAbstractOptionKey contained "^--\%(author\|title\|date\|footer\) *" nextgroup=tppString syn match tppPageLocalOptionKey contained "^--\%(heading\|center\|right\|huge\|sethugefont\|exec\) *" nextgroup=tppString syn match tppPageLocalSwitchKey contained "^--\%(horline\|-\|\%(begin\|end\)\%(\%(shell\)\?output\|slide\%(left\|right\|top\|bottom\)\)\|\%(bold\|rev\|ul\)\%(on\|off\)\|withborder\)" syn match tppNewPageOptionKey contained "^--newpage *" nextgroup=tppString syn match tppColorOptionKey contained "^--\%(\%(bg\|fg\)\?color\) *" syn match tppTimeOptionKey contained "^--sleep *" syn match tppString contained ".*" syn match tppColor contained "\%(white\|yellow\|red\|green\|blue\|cyan\|magenta\|black\|default\)" syn match tppTime contained "\d\+" syn region tppPageLocalSwitch start="^--" end="$" contains=tppPageLocalSwitchKey oneline syn region tppColorOption start="^--\%(\%(bg\|fg\)\?color\)" end="$" contains=tppColorOptionKey,tppColor oneline syn region tppTimeOption start="^--sleep" end="$" contains=tppTimeOptionKey,tppTime oneline syn region tppNewPageOption start="^--newpage" end="$" contains=tppNewPageOptionKey oneline syn region tppPageLocalOption start="^--\%(heading\|center\|right\|huge\|sethugefont\|exec\)" end="$" contains=tppPageLocalOptionKey oneline syn region tppAbstractOption start="^--\%(author\|title\|date\|footer\)" end="$" contains=tppAbstractOptionKey oneline if main_syntax != 'sh' " shell command if version < 600 syn include @tppShExec :p:h/sh.vim else syn include @tppShExec syntax/sh.vim endif unlet b:current_syntax syn region shExec matchgroup=tppPageLocalOptionKey start='^--exec *' keepend end='$' contains=@tppShExec endif syn match tppComment "^--##.*$" " Define the default highlighting. " For version 5.7 and earlier: only when not done already " For version 5.8 and later: only when an item doesn't have highlighting yet if version >= 508 || !exists("did_tpp_syn_inits") if version < 508 let did_tpp_syn_inits = 1 command -nargs=+ HiLink hi link else command -nargs=+ HiLink hi def link endif HiLink tppAbstractOptionKey Special HiLink tppPageLocalOptionKey Keyword HiLink tppPageLocalSwitchKey Keyword HiLink tppColorOptionKey Keyword HiLink tppTimeOptionKey Comment HiLink tppNewPageOptionKey PreProc HiLink tppString String HiLink tppColor String HiLink tppTime Number HiLink tppComment Comment HiLink tppAbstractOption Error HiLink tppPageLocalOption Error HiLink tppPageLocalSwitch Error HiLink tppColorOption Error HiLink tppNewPageOption Error HiLink tppTimeOption Error delcommand HiLink endif let b:current_syntax = "tpp" " vim: ts=8 sw=2 tpp-1.3.1/doc/0000755000175000017500000000000010613074754012103 5ustar akak00000000000000tpp-1.3.1/doc/tpp.10000644000175000017500000000321210613074165012762 0ustar akak00000000000000.TH TPP "1" "April 2007" "tpp 1.3.1" "User Commands" .SH NAME TPP - Text Presentation Program .SH SYNOPSIS .B tpp <\fIOPTIONS\fR> <\fIFILE\fR> .SH DESCRIPTION .PP 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. It supports color, various output modes, sliding in text, command prompt, LaTeX conversion and more. .SH OPTIONS .TP -h/--help display help .TP -l output.tex input.tpp converts tpp slides into tex .TP -v/--version display version number .SH KEYS .TP space display next entry within page .TP space, cursor-down, cursor-right display next page .TP b, cursor-up, cursor-left display previous page .TP q, Q quit tpp .TP j, J jump directly to page .TP s, S jump to the start page .TP e, E jump to the last page .TP c, C start command line .PP .SH WRITING 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. See /usr/share/doc/tpp/README for complete list of command names, and /usr/share/doc/tpp/examples for TPP presentation examples, including presentation slides that have been in real-life presentations. .SH VIM SYNTAX FILE In /usr/share/doc/tpp/contrib you'll find a syntax file for the vim editor. See /usr/share/doc/tpp/README for installation instructions. .SH AUTHOR CONTACT Tpp was written by Nico Golde and Andreas Krennmair tpp-1.3.1/README.de0000644000175000017500000002224410613074165012605 0ustar akak00000000000000tpp - Text - Präsentations - Programm ===================================== Was ist tpp? ------------ Tpp steht für Text Präsentations Programm und ist ein ncurses-basierendes Präsentationswerkzeug. Die Präsentation kann man mit seinem Lieblingseditor in einem einfachen Beschreibungsformat erstellen und danach in einem xterm seiner Wahl - welches von ncurses unterstützt wird - vorführen. Das reicht von einem alten VT 100, einem Linux Framebuffer Terminal bis zum xterm. Installation ------------ Voraussetzungen: * Ruby 1.8 * Eine aktuelle Version der ncurses-Biliothek * ncurses-ruby Zusätzlich: * FIGlet (für die Darstellung größerer Buchstaben im Textmodus) Installation von tpp: 1. Debianpaket (ttp.deb) installieren oder 2. Mit root-Rechten make install eingeben. Anwendung von tpp ----------------- Starten von tpp mit der Präsentationdatei, die man anzeigen möchte: $ tpp presentation.tpp Zur Steuerung von tpp sind folgende Tastenfunktionen verfügbar: Leertaste............................... nächster Eintrag innerhalb der Seite Leertaste, cursor-unten, cursor-rechts.. Bewegung zur nächsten Seite b, cursor-oben, cursor-links............ Bewegung zur vorherigen Seite q, Q ................................... tpp beenden j, J ................................... Direktsprung zur Seite l, L ................................... Neuladen der laufenden Datei s, S ................................... Sprung zur Startseite e, E ................................... Sprung zur letzten Seite c, C ................................... Start einer Kommandozeile ?, h ................................... zeige Hilfebildschirm Auf der linken unteren Seite des Terminals steht in eckigen Klammern die laufende Seitennummer und Gesamtseitenzahl. Links davon erscheint ein "*", wenn das Ende der aktuellen Seite erreicht wurde. Wenn kein "*" sichtbar ist, wurde die Ausgabe angehalten (durch den Befehl `---`) und kann mit der Leertaste weitergeschaltet werden. Man kann so mit der Leertaste von Punkt zu Punkt die gesamte Präsentation vorführen. Wenn man die Tasten 'l' (kleines L) oder 'L' drückt, wird die laufende Präsentation erneut aus der Datei geladen. Dies ist besonders günstig, wenn man eine tpp-Präsentationen erstellt und dabei eine ständige Vorschau benötigt. Schreiben einer tpp-Präsentation -------------------------------- Das Präsentationsformat besteht aus normalen Textzeilen und speziellen Kommandos. Die Kommandozeilen beginnen immer mit "--", gefolgt von den speziellen Kommandowörtern. Die Präsentation besteht aus einer oder mehreren Seiten, die durch den Befehl "--newpage" getrennt werden. Vor dem ersten "--newpage"-Kommando kann eine Zusammenfassung für die gesamte Präsentation stehen. Hier lassen sich der Titel, Autor und das Datum setzen. Zusätzlich kann jede Seite der Präsentation benannt werden. Nach dem "--newpage"-Kommando und einem Leerzeichen wird der Name der nächsten Seite angegeben, falls nicht, wird ein entsprechender Name automatisch erzeugt. Die folgenden Kommandos sind in der Zusammenfassung erlaubt: --author ............... Setzt den Autor der Präsentation --title ................ Setzt den Titel der Präsentation --date ................. Setzt das Datum der Präsentation. Mit "today" fügt man das aktuelle Datum ein. Zusätzlich kann das Datumsformat angegeben werden. Es entspricht dem Format des date(1)-Befehls und ist in der man-page dokumentiert (%M %T %J ist voreingestellt). --bgcolor ...... Setzt die Hintergrundfarbe. Wird keine Farbe angegeben (Transparenz), wird der aktuelle Hintergrund des Terminals verwendet. --fgcolor ...... Setzt die Vordergrundfarbe (Textfarbe) Gültige Farben sind white (weiß), yellow (gelb), red (rot), green (grün), blue (blau), cyan (hellblau), magenta (lila), black (schwarz). --heading .... Setzt die Kopfzeile für alle Seiten. Die Kopfzeile wird zentriert und fett dargestellt (wenn es das Terminal zulässt). Innerhalb der einzelnen Seiten kann man folgende "page-local"-Befehle verwenden: --withborder ........... Darstellung mit Seitenrand --horline .............. Stellt eine horizontale Linie dar --header ........ Fügt eine Kopfzeile ein --footer ........ Fügt eine Fußzeile ein --color ........ Setze eine neue Textfarbe (erlaubte Farben siehe oben) --left .......... Linksbündige Textdarstellung (Voreinstellung) --center ........ Zentrierte Textdarstellung --right ......... Rechtsbündige Textdarstellung --- .................... Stoppt die Textausgabe, Fortsetzung mit Leertaste --sleep ...... Stoppt die Ausgabe für Sekunden --beginoutput .......... markiert den Anfang des gerahmten Textes --endoutput ............ markiert das Ende des gerahmten Textes --beginshelloutput ..... Setzt den Beginn der gerahmten Shellausgabe. Jede Zeile, die mit einem $ beginnt, erscheint so, als wenn die Buchstaben direkt eingegeben werden. --endshelloutput ....... Setzt das Ende der gerahmten Shellausgabe --boldon ............... Beginn Text fett --boldoff .............. Ende Text fett --revon ................ Beginn der inversen Darstellung --revoff ............... Ende der inversen Darstellung --ulon ................. Beginn Text unterstrichen --uloff ................ Ende Text unterstrichen --beginslideleft ....... Beginn einfliegender Text von links --endslideleft ......... Ende einfliegender Text von links --beginslideright ...... Beginn einfliegender Text von rechts --endslideright ........ Ende einfliegender Text von rechts --beginslidetop ........ Beginn einfliegender Text von oben --endslidetop .......... Ende einfliegender Text von oben --beginslidebottom ..... Beginn einfliegender Text von unten --endslidebottom ....... Ende einfliegender Text von unten --huge .......... Der wird in sehr großen Buchstaben dargestellt. Das Programm FIGlet wird benutzt, um die sehr großen Buchstaben darzustellen --sethugefont ... Wenn man den --huge Befehl und FIGlet verwendet, wird mit diesem Befehl die entsprechende FIGlet Schrift ausgewählt (siehe auch FIGlet man-page). --exec ........... führt den in angegebenen Befehl aus. Nützlich, um z.B. einen Bildbetrachter aufzurufen --## ........... Zeilen auskommentieren Beispiele --------- Einige Beispiele, die die Funktionen von tpp demonstrieren, liegen dem tpp-Programm im Unterverzeichnis examples bei. Optionen -------- tpp --help zeigt die Hilfe im Textmodus tpp -l output input.tpp Konvertiert die tpp-Datei in eine LaTeX-Datei. Diese Funktion ist derzeit in Überarbeitung. tpp --version zeigt die tpp-Versionsnummer Vim-Syntax-Datei ---------------- Um die Vim-Syntax-Datei zu nutzen, muß die Datei in das Verzeichnis ~/.vim/syntax kopiert werden. Falls das Verzeichnis noch nicht existiert, muß es angelegt werden. Danach muß das folgende in die Datei ~/.vim/filetype.vim eingefügt werden: if exists("did_load_filetypes") finish endif augroup filetype detect au! BufRead,BufNewFile *.tpp setfiletype tpp augroup END Falls der Vim keine Syntaxhervorhebung unterstützt, kann das mit dem Kommando syntax on aktiviert werden. Neben der Datei tpp.vim im Verzeichnis contrib existiert eine weitere, verbesserte Variante, welche wir aus Lizenzgründen nicht verbreiten können. Diese Datei kann unter http://www.trish.de/downloads/tpp.vim bezogen werden. Übersetzung ----------- letzte Überarbeitung der Übersetzung April 2006 Thomas Winde , Frank Hofmann Lizenz ------ ################################################################################ # # # tpp - text presentation program # # Copyright (C) 2004-2005, 2007 Andreas Krennmair , # # Nico Golde # # # # 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 # # # ################################################################################ tpp-1.3.1/examples/0000755000175000017500000000000010613074755013155 5ustar akak00000000000000tpp-1.3.1/examples/tpp-features.tpp0000644000175000017500000000774310207373317016327 0ustar akak00000000000000--bgcolor white --fgcolor black --title TPP Feature Show --author Andreas Krennmair --date today --newpage intro --heading What is TPP? * A text console application --- * "Powerpoint for Sven G^W^Wtext tool users" --- * Simple file format, only text editor required --- * First version: 4-hour hack in Ruby + ruby-ncurses --- * Extension until source code was f*cked up, then complete rewrite w/ generic design --newpage slide --heading Basic TPP Features Simple text that is in one line --- What TPP also does is that it also takes very long lines, but doesn't simply output them, but break those long lines into a series of shorter ones, which are then printed to screen. Like this one. :-) --- --center You can also center text (long lines will be wrapped, too) --- --right And everything on the right side --- --beginslideleft * You can slide it in from the left * or from the right: --endslideleft --beginslideright * Like this line, for example --endslideright --- --beginslidetop O R L O O K A T T H I S ! ! ! --endslidetop --- --beginslidebottom O R T H I S ! ! ! --endslidetop --newpage attrib --heading Attributes This should be normal --- --ulon This should be underlined --- --revon This should be underlined and reverse --- --boldon This should be underlined, reverse and bold --center This should be underlined, reverse, bold and centered --- --uloff This should be reverse and bold --- --revoff This should be bold --- --boldoff This should be normal again --newpage keys --heading Keys to Control TPP --beginoutput space bar ............................... display next entry within page 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 s, S .................................... jump to the first page e, E .................................... jump to the last page c, C .................................... start command line ?, h .................................... help screen --endoutput --newpage source --heading Source Code Example --beginoutput --##comment in the beginning --author Nico Golde --title Test for TPP --date today --withborder The next line in the source file is a comment and will not be displayed. --##This is the abstract, which is pretty cool. It consists of several lines. --newpage --withborder This is the next page, which also consists of several lines blubber. bla. --## comment somewhere else --newpage --withborder asdf jklö asdf jklö asdf jklö asdf jklö --endoutput --newpage other --heading Other Things This is supposed to be shell output: --beginshelloutput $ ls ~/bin c89 cat if.pl seq ssh-agent ssh-agent.sh $ cd ~/bin $ ls -l total 36 -rwxr-xr-x 1 ak staff 27 Jul 11 2003 c89 -rwxr-xr-x 1 ak staff 14732 Aug 26 2002 cat -rwxr-xr-x 1 ak staff 236 Apr 27 2003 if.pl -rwxr-xr-x 1 ak staff 73 Feb 19 2004 seq -rwxr-xr-x 1 ak staff 126 Dec 21 20:45 ssh-agent -rwxr-xr-x 1 ak staff 94 Jul 24 15:01 ssh-agent.sh $ --endshelloutput --newpage figlet --heading FIGlet support! --huge This is FIGlet --- --sethugefont mini --huge This is the mini font --newpage future --heading Future Goals * Release refactored version --- * More features (i.e. effects that make PowerPoint look lousy) --- * Stable support for export formats --newpage thx --heading Thanks To... * Nico Golde, the TPP co-author, who came up with lots of nice features, and brought TPP into Debian * Sven Guckes, who had the initial idea and established contact with Nico Golde, the TPP co-author * Alfie, for writing a VIM syntax file * arved, for bringing TPP into FreeBSD * Patricia "trish" Jung, for writing a very good article about TPP - "Linux User" and - "Linux Magasinet" (Norway) tpp-1.3.1/examples/ac-am.tpp0000644000175000017500000003175710100557624014665 0ustar akak00000000000000--title autoconf und automake --author Andreas Krennmair --date today Praktisch jede Software unter Linux wird mit ./configure ; make ; make install konfiguriert, compiliert und installiert. Ich möchte heute zeigen, wie man selbst mit Autoconf und Automake den Konfigurations- und Übersetzungsprozess automatisieren kann, und was das für portable Software bringen kann. --newpage agenda --heading Agenda * Einführung * Makefiles * Autoconf alleine * Autoconf und Automake --newpage intro --heading Einführung: Geschichte der automatisierten Compilierung unter Unix * Anfangs: Shellskripte namens make im Sourceverzeichnis (bis Unix V6) * Ab Unix V7: Programm make, Information aus Datei makefile * makefile enthält Informationen, welchen Dateien (Targets) aus welchen Dateien (Dependencies) erzeugt werden, und welche Kommandos dazu aufgerufen werden müssen. * Makefiles funktionierten anfangs ganz gut, bis die ersten Unix- Varianten erschienen, die subtil anders als die bisherigen Unixe waren. Software sollte aber portabel bleiben. * Einfache Lösung: ein Target pro Zielplattform. * Nachteil: bei mehr Plattformen ansteigender Wartungsaufwand --newpage intro-conf --heading Einführung: erste automatisierte Konfiguration * Makefile-Lösung hörte auf zu skalieren, als immer mehr und immer obskurere Unix-Varianten auftauchten, auf die die Entwickler von Software noch dazu keinen Zugriff mehr hatten. * Erste Lösung Mitte bis Ender der 80er Jahre: Configure * Larry Wall wollte, dass seine Software (insbesondere Perl) portabel auf möglichst vielen Unix-Plattformen läuft. * Schreib Shellskript Configure, das Informationen über das System sammelte, und aus *.SH-Dateien dementsprechende Dateien generierte (Makefile.SH -> Makefile) * Vorteil: Perl konnte ohne grossen Portierungsaufwand auf vielen, tewilweise recht obskuren Unix-Systemen betrieben werden. --newpage intro-gnu --heading Einführung: Konfiguration für GNU * GNU-Software sollte möglichst portabel sein * GNU-Projekt griff Larry Wall's Idee auf, und realisierte im wesentlichen zwei Frameworks, um das Konfigurieren und Übersetzen von GNU-Software möglichst portabel und einfach wartbar zu halten. * Konfiguration: autoconf * Übersetzung: automake * Status heute: Autoconf und Automake sind ein Quasi-Standard bei Freier Software/Open Source --newpage makefiles --heading Einfache Makefiles Makefiles bestehen im wesentlichen aus zwei Bereichen: * Variablendefinitionen * Zieldefinitionen Variablen werden verwendet, um gleiche "Textbausteine", die öfters im Makefile vorkommen, zusammenzufassen und parametrisierbar zu machen, z.B. Compilerkommandos, Compilerflags, Ausgabedatei, ... Zieldefinitionen geben an, welche Datei erzeugt werden soll, von welchen Dateien diese Datei abhängig ist, und mit welchem Kommando die Datei aus diesen Abhängigkeiten erzeugt wird. Diese Zieldefinition definiert ein sog. "Target". Wird ein Target aufgerufen, so wird das Kommando nur ausgeführt, wenn die zu generierende Datei noch nicht existiert, oder wenn eine der Abhängigkeiten erst generiert werden muss, oder wenn eine der Abhängigkeiten neuer ist als die bestehende Datei So werden unnötige Compile-Vorgänge vermieden. --newpage example1 --heading Beispiel 1: einfaches Makefile --beginoutput # Kommentar LATEX=pdflatex # Variablendefinition ac-am.pdf: ac-am.tex # Zieldefinition $(LATEX) ac-am.tex # Kommando --endoutput --newpage example2 --heading Beispiel 2: gleichartige Targets zusammenfassen --beginoutput LATEX=pdflatex RM=rm -f PDFFILES=ac-am.pdf all: $(PDFFILES) %.pdf: %.tex $(LATEX) $< clean: $(RM) $(PDFFILES) *.aux *.log --endoutput --newpage --heading Beispiel 3: modulares C-Programm übersetzen --beginoutput CC=gcc CFLAGS=-Os -Wall OBJS=foo.o bar.o baz.o quux.o OUTPUT=xyzzy all: $(OUTPUT) $(OUTPUT): $(OBJS) $(CC) $(CFLAGS) $(LDFLAGS) -o $(OUTPUT) $(OJBS) $(LIBS) %.o: %.c $(CC) $(CFLAGS) $(DEFINES) -c $< clean: $(RM) $(OBJS) $(OUTPUT) core *.core .PHONY: all clean --endoutput --newpage limitations --heading Limtationen von Makefiles Makefiles funktionieren zwar bei kleineren, einfachen Programmen, wer jedoch größere, portable Software schreiben will, stößt mit make und Makefiles schnell an Grenzen. Die Unterschied zwischen den einzelnen Unix-Systemen sind z.B. folgende: * Strukturen unterscheiden sich * Funktionen sind unterschiedlich deklariert * #defines sind anders benannt oder existieren nicht * Manche Funktionen sind nicht mehr in der libc, sondern in externe Libraries ausgelagert (z.B. Sockets nach libsocket). Auf diese Unterschiede kann make nicht eingehen. Deswegen muss man einen Konfigurationsmechanismus einführen, der dies kann. --newpage autoconf1 --heading Autoconf, Schritt 1: configure-Skript erzeugen Autoconf bietet die Möglichkeit, auf eine große Anzahl von Kommandos und Tests zurückzugreifen, um möglichst alle relevanten Systemparameter abzurufen. Diese Tests werden in einer Datei configure.in abgelegt, aus dem dann mit dem Kommando autoconf die Datei configure erzeugt wird. Mit dem Kommando autoheader wird die Datei config.h.in erzeugt. Ruft man ./configure auf, so sammelt das configure-Skript die Konfigurationsinformationen, und generiert aus config.h.in die Datei config.h sowie alle in configure.in angegebenen zu konfigurierenden Dateien, das ist meistens Makefile.in, aus der Makefile erzeugt wird. Die configure.in-Datei lässt sich übrigens erzeugen, indem man autoscan aufruft, und die resultierende Datei configure.scan in configure.in umbenennt. --newpage autoconf2 --heading Autoconf, Schritt 2: Makefile.in erstellen Die Datei Makefile.in wird wie ein normales Makefile geschrieben, mit dem Unterschied, dass für bestimmte Variablen, deren Wert vom configure-Skript bestimmt werden, spezielle Platzhalter eingefügt werden. Das sieht dann z.B. so aus: --beginoutput CC=@CC@ CFLAGS=@CFLAGS@ @DEFS@ LDFLAGS=@LDFLAGS@ LIBS=@LIBS@ --endoutput Der Rest des Makefile sieht wie ein normales Makefile aus. Um auf sämtliche ermittelten Parameter zugreifen zu können, müssen die einzelnen C-Sourcefiles nur noch die Datei config.h inkludieren. Damit ist Autoconf vollständig integriert und das Buildsystem darauf angepasst. --newpage autoconf3 --heading Autoconf, Zusammenfassung In einer Minute zur Sourcekonfiguration mit Autoconf: --beginshelloutput $ autoscan && mv configure.scan configure.in --- $ $EDITOR configure.in --- $ autoconf --- $ autoheader --- $ $EDITOR Makefile.in --endshelloutput Fertig! --newpage confex1 --heading Beispiel für configure.in (1) --beginoutput AC_PREREQ(2.57) AC_INIT(akpop3d, 0.7.7, ak@synflood.at) AC_CONFIG_SRCDIR([authenticate.c]) AC_CONFIG_HEADER([config.h]) # Checks for programs. AC_PROG_CC AC_PROG_INSTALL --endoutput --newpage confex2 --heading Beispiel für configure.in (2) --beginoutput # Checks for header files. AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h netdb.h netinet/in.h shadow.h stdlib.h string.h sys/file.h sys/socket.h sys/time.h syslog.h unistd.h]) # Checks for typedefs, structures, and compiler # characteristics. AC_C_CONST AC_TYPE_UID_T AC_TYPE_OFF_T AC_TYPE_PID_T AC_TYPE_SIZE_T AC_HEADER_TIME --endoutput --newpage confex3 --heading Beispiel für configure.in (3) --beginoutput # Checks for library functions. AC_FUNC_ALLOCA AC_FUNC_FORK AC_FUNC_REALLOC AC_FUNC_SELECT_ARGTYPES AC_FUNC_STAT AC_CHECK_FUNCS([atexit dup2 getspnam inet_ntoa memchr memset select socket strchr strerror strncasecmp strrchr]) AC_CONFIG_FILES([Makefile]) AC_OUTPUT --endoutput --newpage functions --heading Weitere nützliche Autoconf-Funktionen * AC_CHECK_LIB(library,symbol): wenn symbol in Library library gefunden wird, wird -llibrary zu den LDFLAGS hinzugefügt und HAVE_LIBLIBRARY=1 in config.h definiert. * AC_DEFINE([KEY],[VALUE]): in config.h wird #define KEY VALUE eingetragen. * AC_ARG_WITH(option,[beschreibung]): das configure-Skript um eine --with-option Option erweitern. * AC_ARG_ENABLE(option,[beschreibung]): das configure-Skript um eine --enable-option Option erweitern. --newpage funcex1 --heading Beispiele zu nützlichen Autoconf-Funktionen --beginoutput AC_ARG_WITH(openssl, [ --with-openssl use OpenSSL]) if test "$with_openssl" != "no" ; then AC_CHECK_LIB(crypto,BIO_new) AC_CHECK_LIB(ssl,SSL_new) fi AC_ARG_ENABLE(rfc2449, [ --enable-rfc2449 enable RFC 2449 support]) if test "$enable_rfc2449" != "no" ; then AC_DEFINE([ENABLE_RFC2449],[1],[rfc2449]) fi --endoutput --newpage funcauto --heading Funktionsweise von Autoconf * Vorgefertige Tests in Form von m4-Makros verfügbar * Autoconf lässt configure.in durch m4 laufen, daraus entsteht configure-Skript, was nicht anders als ein Shellskript ist. * -> man kann durch Einfügen von eigenem Shellcode eigene Tests durchführen. * -> oder man greift auf http://ac-archive.sourceforge.net/ zurück, einem umfangreichen Archiv von hunderten Autoconf-Macros. --beginoutput if test x`uname -s` = "xDarwin" ; then AC_DEFINE([HAVE_DARWIN],[1],[define whether we have Darwin]) fi --endoutput --newpage macroself --heading Autoconf-Makros selbst schreiben Autoconf-Makros sind ein Mischmasch aus m4-Skript und Shellskript. --beginoutput AC_DEFUN([AC_C_LONG_LONG], [AC_CACHE_CHECK(for long long int, ac_cv_c_long_long, [if test "$GCC" = yes; then ac_cv_c_long_long=yes else AC_TRY_COMPILE(,[long long int i;], ac_cv_c_long_long=yes, ac_cv_c_long_long=no) fi]) if test $ac_cv_c_long_long = yes; then AC_DEFINE(HAVE_LONG_LONG) fi ]) --endoutput --newpage automake1 --heading Automake: Einführung Automake ist dafür gedacht, den eigentlichen Übersetzungsprozess so weit wie möglich zu vereinfachen, und dem User das Schreiben von eigenen Makefile.in's abzunehmen. Automake setzt Autoconf voraus. Die Makefile.am-Datei besteht wie ein Makefile aus Targets, die quasi beliebig benannt werden können, und alle Kommandos enthalten wie auch ein Target in einem Makefile oder Makefile.in. Zusätzlich existieren eine Reihe von speziellen Variablen, mit denen das Übersetzen von Software einfacher wird. --beginoutput bin_PROGRAMS = hello hello_SOURCES = hello.c main.c EXTRA_DIST = hello.h --endoutput --newpage autocmd --heading Automake: mehr Kommandos --beginshelloutput $ $EDITOR Makefile.am --- $ autoscan && mv configure.scan configure.in --- $ autoheader --- $ aclocal --- AM_INIT_AUTOMAKE(programname,version) in configure.in eintragen. --- $ automake -a --- $ autoconf --- $ ls -l Makefile.in configure -rw-r--r-- 1 ak staff 16048 16 Mar 20:03 Makefile.in -rwxr-xr-x 1 ak staff 123354 16 Mar 20:03 configure $ --endshelloutput --newpage primaries --heading Automake: Primaries Die _PROGRAMS; _SOURCES, etc. Suffixe, die vorher gesehen haben, nennen sich übrigen "Primaries". Weitere Primaries sind z.B.: * DATA: gibt Datendateien an, die 1:1 mitinstalliert, ansonsten aber ignoriert werden. * HEADER: damit werden Headerfiles spezifiziert, die zusammen mit Libraries installiert werden sollen. * SCRIPTS: ausführbare Skripte, die ebenfalls installiert werden, jedoch nicht compiliert oder gestripped werden. * MANS: gibt Manpages an, die ebenfalls mitinstalliert werden. Die Grundbedürfnisse für einfache und problemlose Konfigurations-, Übersetzungs- und Installationsroutinen wäre damit gedeckt. --newpage recam --heading Rekursives Automake Um den Inhalt von Unterverzeichnissen in den Automake-Vorgang miteinzubeziehen, muss man lediglich alle relevanten Unterverzeichnisse über die SUBDIRS-Variable angeben. --beginoutput SUBDIRS = m4 src doc --endoutput In jedem Unterverzeichnis muss natürlich wiederum eine Makefile.am angelegt und daraus eine Makefile.in erzeugt werden. Ausserdem muss das dann zu erzeugende Makefile in der configure.in angegeben werden, und zwar via AC_CONFIG_FILES. --newpage resumee --heading Resümee * make mag veraltet und eingerostet wirken (wird seit Ende der 1970er eingesetzt), bietet aber ein mächtiges System, um Abhängigkeiten zu überprüfen, und unnötige Compilevorgänge zu minimieren. * Autoconf bietet ein mächtiges System, um vielerlei systemabhängige Konfigurationspunkte in Erfahrung zu bringen, was wiederum einen Eckpfeiler für systemnahe und portable Programmierung bildet. * Automake macht es für Entwickler besonders einfach, Softwarepakete in eine Form zu bringen, dass sie übersetzt und installiert werden können. * Autoconf und Automake mögen suboptimale Lösungen sein (./configure dauert lange, configure und Makefile.in sind bei Automake extrem gross), stellen jedoch eine frei verfügbare, einfach anzuwendende und vor allem weit verbreitete Lösung dar. --newpage literacy --heading Literaturempfehlungen * Das "Autobook": Autoconf, Automake and Libtool http://sources.redhat.com/autobook/autobook/autobook_toc.html * Autoconf Dokumentation: http://www.delorie.com/gnu/docs/autoconf/autoconf_toc.html * Automake Dokumentation: http://www.delorie.com/gnu/docs/automake/automake_toc.html --newpage end --heading Und jetzt... --huge Zum praktischen Teil! tpp-1.3.1/examples/colors2.tpp0000644000175000017500000000042610102131545015247 0ustar akak00000000000000--fgcolor black --bgcolor white --title FG/BG tests --author Andreas Krennmair --date today This is the abstract. Bla, bla. --newpage --heading bla bla bla * bla * bla --- --beginslideleft * bla --endslideleft --beginslidetop * bla --endslidetop more bla bla bla. tpp-1.3.1/examples/test.tpp0000644000175000017500000000070510131306636014652 0ustar akak00000000000000--##comment in the beginning --author Nico Golde --title Test for TPP --date today --withborder The next line in the source file is a comment and will not be displayed. --##This is the abstract, which is pretty cool. It consists of several lines. --newpage --withborder This is the next page, which also consists of several lines blubber. bla. --## comment somewhere else --newpage --withborder asdf jklö asdf jklö asdf jklö asdf jklö tpp-1.3.1/examples/bold.tpp0000644000175000017500000000132610101026214014577 0ustar akak00000000000000--author Andreas Krennmair --title Boldtest --newpage This is normal text. --boldon This should be bold. --boldoff This should be normal again. --revon --center This should be reverse. --revoff This should be normal. jjjjjjjjjjjjjjjjjjjjjjjjjjj --revon asdf jklö --boldon asdf jklö --boldoff asdf jklö --revoff jjjjjjjjjjjjjjjjjjjjjjjjjjj --newpage --heading This is the heading This should be normal --ulon This should be underlined --revon This should be underlined and reverse --boldon This should be underlined, reverse and bold --center This should be underlined, reverse, bold and centered --uloff This should be reverse and bold --revoff This should be bold --boldoff This should be normal again --huge This Is Huge! tpp-1.3.1/examples/slidein.tpp0000644000175000017500000000175110101720631015314 0ustar akak00000000000000--author Nico Golde --title Slide text test --newpage --beginslideleft Hallo, ich bin Nico Hallo, ich bin Andreas --endslideleft --- --beginslideright Das ist der Slide-Right-Test --endslideright --newpage --heading jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj asdf jklö asdf jklö asdf jklö asdf jklö asdf jklö asdf jklö asdf jklö asdf jklö asdf jklö asdf jklö asdf jklö asdf jklö asdf jklö asdf jklö asdf jklö asdf jklö asdf jklö asdf jklö --beginslidetop * Testtesttesttest * Test 2 TEst 2 TEst 2 * Test 3 Test 3 Test 3 --- * Test4Test4Test4Test4Test4 --endslidetop --newpage --heading jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj text first. --- more text. and even more text. bla. bla. bla. --beginslidetop aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa --endslidetop --newpage --heading jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj some text --beginslidebottom * foobar * baz quux xyzzy * blubber blubber blubber. --endslidebottom tpp-1.3.1/examples/exec.tpp0000644000175000017500000000027610207373317014626 0ustar akak00000000000000--author Andreas Krennmair --title exec fbi /home/nion/privat/bilder/linux/bart.gif --newpage --heading heading bla. bla. bla. --- --exec echo "foobar - this is the exec output" more bla. tpp-1.3.1/examples/debian-packaging.tpp0000644000175000017500000003427510207373317017054 0ustar akak00000000000000--boldon --center Debian GNU/Linux --center Paketerstellung --center am Beispiel von binclock --author Nico Golde --boldoff --center Berlinux --center 22.+23. Okt 2004 --center http://www.ngolde.de --fgcolor white --bgcolor black --boldoff --newpage Inhalt --boldon --huge Inhalt --ulon --horline --boldoff --uloff --boldon - Gründe für die Erstellung von Paketen - Benötigte Software - Vorbereitung - Debian-Pakete - Erstellung benötigter Dateien - Konfiguration - Build-Prozess - Testen des Pakets - Veröffentlichung: Wie mache ich das Paket verfügbar? - Weitere Informationen --newpage warum --boldon --huge Warum? --ulon --horline --boldoff --uloff --boldon - Eingliederung von Software in das Debian-Paketsystem - Ziel: Offizieller Maintainer - "NEU!" Das Programm war bisher nicht als Debian-Paket verfügbar - Erweiterung vorhandener Pakete, zB durch patches oder zusätzliche Konfigurationsdateien - Cluster/Pool: Leichte De- und Installation von Programmen auf mehreren Rechnern - Auflösen von Abhängigkeiten und Konflikten dem Paketsystem überlassen können - Eingliederung in das Menüsystem --newpage software --boldon --huge Software --ulon --horline --boldoff --uloff --boldon - Compiler, Bibliotheken (Paket: build-essential) - dpkg-dev (Hilfe beim Entpacken und Erstellen) - debhelper - lintian (Paket-Checker) - patch, dpatch, automake, autoconf --newpage Vorbereitung --boldon --huge Vorbereitung --ulon --horline --boldoff --uloff --boldon - Existieren schon Pakete? -> packages.debian.org - Kontakt zum Autor herstellen! Interesse an einem Paket? - Lizenzen überprüfen: Ist das Programm auch frei? aka "Klären der Fakten" -> Debian Free Software Guidelines (DFSG) - Abhängigkeiten zu anderen Programmen prüfen - Kenntnis des Programms erforderlich! - Format des Dateinamens: paketname-version.tar.gz --newpage paket --boldon --huge Pakete --ulon --horline --boldoff --uloff --boldon Inhalt: --## --exec display paket.png --beginoutput Debian Paket: (1) Quellpaket (Source Package) - paket.orig.tar.gz ("source archive") - paket.dsc ("description") - paket.diff.gz ("differences") (2) Binärpaket (.deb) (Binary Package) --endoutput - zu installierende Programme und Pfade --newpage dateierstellung --boldon --huge Dateien - 1 --ulon --horline --boldoff --uloff --boldon 1. Entpacken der Quellen --- --beginshelloutput $ tar xvfz binclock-1.5.tar.gz binclock-1.5/ binclock-1.5/CHANGELOG binclock-1.5/COPYING binclock-1.5/doc/ binclock-1.5/doc/binclock.1 binclock-1.5/src/ binclock-1.5/src/binclock.c binclock-1.5/Makefile binclock-1.5/README binclock-1.5/INSTALL binclock-1.5/binclockrc --endshelloutput 2. Umbgebungsvariablen --- --beginshelloutput $ export DEBEMAIL="nico@ngolde.de" --endshelloutput --beginshelloutput $ export DEBFULLNAME="Nico Golde" --endshelloutput --newpage dateien2 --boldon --huge Dateien - 2 --ulon --horline --boldoff --uloff --boldon --- --beginshelloutput $ dh_make Type of package: single binary, multiple \ binary, library, or kernel module? [s/m/l/k] --- Maintainer name : Nico Golde Email-Address : nico@ngolde.de Date : Sat, 16 Oct 2004 01:00:14 +0200 Package Name : binclock Version : 1.5 Type of Package : Single Hit to confirm: --- Done. Please edit the files in the debian/ subdirectory now. You should also check that the binclock Makefiles install into $DESTDIR and not in / . --endshelloutput --beginslideleft --color red ==> debian-Dateien (im Ordner debian/) --endslideleft --color white --newpage Config-1 --boldon --huge Config - 1 --ulon --horline --boldoff --uloff --boldon --ulon Die wichtigen Dateien: --uloff changelog: (später /usr/share/doc/binclock/changelog.Debian.gz) --- --beginoutput binclock (1.5-1) unstable; urgency=low * Initial Release. Nico Golde Fri, 15 Oct 2004 18:45:13 +0200 --endoutput - Paketname, Version, Distribution, Priorität - Änderungen am Paket, _nicht_ am Quellcode - Name des Maintainers, Emailaddresse, Datum --## "date -R" erstmal nicht so wichtig - neuer changelog-Eintrag mit "dch -i" --newpage Config-2a --boldon --huge Config - 2a --ulon --horline --boldoff --uloff --boldon Datei "control" (vor dem Editieren): --- --beginoutput Source: binclock Section: unknown Priority: optional Maintainer: Nico Golde Build-Depends: debhelper (>= 4.1.0) Standards-Version: 3.6.1 Package: binclock Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: --endoutput --newpage Config-2b --boldon --huge Config - 2b --ulon --horline --boldoff --uloff --boldon Datei "control" (nach dem Editieren): --- --beginoutput Source: binclock --color green Section: utils --color white Priority: optional Maintainer: Nico Golde --color green Build-Depends: debhelper (>= 4.1.0) --color white Standards-Version: 3.6.1 Package: binclock --color green Architecture: any --color white Depends: ${shlibs:Depends}, ${misc:Depends} --color green Description: binary clock for console with color support * (60 Zeichen) BinClock - Displays system time in binary format. It supports showing the time with eight different colors, and it can run a loop that prints the time every second. The default colors and characters for printing can be changed with a config file. --color white --endoutput - Kontrollinformationen, Name des Quellpakets, Subsection, Maintainer, Abhängigkeiten zum Bauen, Policy-Version - Paketname, Architektur - Abhängigkeiten (mögliche weitere Felder: Suggests, Conflicts, Replaces, ...) - kurze und lange Beschreibung, kurze Beschreibung darf nicht mit Programmnamen anfangen --newpage Config-3a --boldon --huge Config - 3a --ulon --horline --boldoff --uloff --boldon copyright (vor dem Editieren): --beginoutput This package was debianized by Nico Golde on Tue, 19 Feb 2004 16:43:41 +0200. It was downloaded from Copyright: Upstream Author(s): License: --endoutput --newpage Config-3a --boldon --huge Config - 3b --ulon --horline --boldoff --uloff --boldon --beginoutput This package was debianized by Nico Golde on Wed, 19 Feb 2004 16:43:41 +0100. It was downloaded from http://www.ngolde.de/binclock/ Upstream Author: Nico Golde This software is copyrighted (c) 2003-2004 by Nico Golde. You are free to distribute this software under the terms of the GNU General Public License. On Debian systems, the complete text of the GNU General Public License can be found in the file `/usr/share/common-licenses/GPL'. --endoutput - Download Ort - Autor des Programmes - Copyright (sollte DFSG kompatibel sein) --newpage Config-4 --boldon --huge Config - 4 --ulon --horline --boldoff --uloff --boldon dirs: - Verzeichnisse, die nicht vom Makefile angelegt werden - ohne / am Anfang, Bsp.: usr/man conffiles.ex: - Konfigurationsdateienm, für manuelle Auswahl, in dem Fall /etc/binclockrc - WICHTIG: datei.ex immer in datei umbenennen, wenn sie verwendet wird docs: - zu installierende Dokumentationsdatein, in dem Fall nur README README.Debian: - nennenswerte Unterschied zum Original --newpage Configis --boldon --huge Config - 5 --ulon --horline --boldoff --uloff --boldon menu.ex: - Fenstermanager-Menu vor dem Editieren: --beginoutput ?package(binclock):needs="X11|text|vc|wm" section="Apps/see-menu-manual"\ title="binclock" command="/usr/bin/binclock" --endoutput --beginoutput ?package(binclock): needs="text|X11" section="Apps/Tools" \ title="BinClock" command="/usr/bin/binclock" --endoutput - Bestimmung von Oberfläche, Abteilung, Titel und das auszuführende Kommando --newpage Config-5 --boldon --huge Config - 6 --ulon --horline --boldoff --uloff --boldon rules: --- --## this doesn't works here, because there is no rules file --##--exec vim rules --exec echo "eigentlich wäre hier die rules datei, sie ist in diesem beispiel leider nicht enthalten" | vim - --newpage Config-6 --boldon --huge Config - 7 --ulon --horline --boldoff --uloff --boldon Anpassung des Makefiles: vor dem Editieren: --beginoutput INSPATH = /usr/local/bin/ MANPATH = /usr/man/man1/ CONF = /etc/ all : $(MAINSRC) gcc -02 --pedantic -Wall -o binclock ./src/binclock.c strip binclock install : cp -pf CHANGELOG README COPYING cp -pf ./doc/binclock.1 $(MANPATH) cp -pf binclockrc $(CONF)binclockrc install -c -s -m 0755 binclock $(INSPATH) clean : rm -f binclock uninstall : rm -f $(INSPATH)binclock rm -f $(CONF)$(BIN)rc rm -f $(MANPATH)/binclock.1 --endoutput --newpage Config-a --boldon --huge Config - 8 --ulon --horline --boldoff --uloff --boldon Nach dem Editieren: --beginoutput --color green INSPATH = $(DESTDIR)/usr/bin/ MANPATH = $(DESTDIR)/usr/share/man/man1/ CONF = $(DESTDIR)/etc/ all : $(MAINSRC) --color white gcc --pedantic -Wall -o binclock ./src/binclock.c strip binclock install : cp -pf ./doc/binclock.1 $(MANPATH) cp -pf binclockrc $(CONF)binclockrc install -c -s -m 0755 $(BIN) $(INSPATH) clean : rm -f $(SOURCEPATH)$(BIN) --endoutput - Anpassung der Variablen mit $(DESTDIR) - Entfernen von Regeln, die von debhelper übernommen werden - bei Programmen mit configure Scripten normalerweise nicht nötig, sondern in rules statt $(DESTDIR) prefix einsetzen --newpage Config-7 --boldon --huge Config-9 --ulon --horline --boldoff --uloff --boldon Letzte Schritte: .ex-Dateien: - Spezialfälle, je nach Bedarf editieren und umbennen - anschliessend übrige .ex Dateien löschen - eventuell Manual schreiben (so wie in der Policy beschrieben) - falls benötigt die Maintainer-Scripte editieren: postinst.ex, preinst.ex, postrm.ex, prerm.ex -> werden ausgeführt bei Installation, Löschen oder Aktualisierung eines Paketes - umbenennen von binclock-1.5.tar.gz in binclock_1.5.orig.tar.gz --newpage build --boldon --huge Build Prozess --ulon --horline --boldoff --uloff --boldon Schritt 1: - Zurückkehren in das Stammverzeichnis des Programms, i.d. Fall binclock-1.5/ Schritt 2: - Bauen des Paketes mittels dpkg-buildpackage -rfakeroot --- --color red --beginslideleft ==> Debian-Paket in binclock-1.5/../ --endslideleft --color white --newpage build2 --boldon --huge Nach dem Build --ulon --horline --boldoff --uloff --boldon Neue Dateien in binclock-1.5/../ : --- --beginshelloutput $ ls --color blue binclock-1.5 --color white binclock_1.5-1.diff.gz binclock_1.5-1.dsc binclock_1.5-1_i386.changes binclock_1.5-1_i386.deb binclock_1.5.orig.tar.gz --endshelloutput - Alle Änderungen am Originalquelltext (.diff.gz) - Paketname, Version, Maintainer, Architektur, Build-Depends, Policy Version, Dateien mit md5 Summen (.dsc) - Paketdatum, Version, Distribution, Maintainer, _Veränderungen_, Paketbeschreibung, Dateien mit md5 Summen (.changes) - Alle zur installierenden Dateien mit Ordnern gezippt (.deb) - Originalquellen (.orig.tar.gz) --newpage test --boldon --huge Tests --ulon --horline --boldoff --uloff --boldon 1. Testen auf Policy mit lintian (Paket-Checker): --- --beginshelloutput $ lintian binclock_1.5-1_i386.changes E: binclock: binary-without-manpage binclock --endshelloutput - Fehler und Warnungen beseitigen (lintian -i für weiter Eklärungen) 2. Testen des Paketinhalts: --- --beginshelloutput $ dpkg -c binclock_1.5-1_i386.deb drwxr-xr-x root/root 0 2004-10-17 16:38:42 ./ drwxr-xr-x root/root 0 2004-10-17 16:38:42 ./usr/ drwxr-xr-x root/root 0 2004-10-17 16:38:42 ./usr/bin/ -rwxr-xr-x root/root 7500 2004-10-17 16:38:42 ./usr/bin/binclock drwxr-xr-x root/root 0 2004-10-17 16:38:41 ./usr/share/ drwxr-xr-x root/root 0 2004-10-17 16:38:41 ./usr/share/man/ drwxr-xr-x root/root 0 2004-10-17 16:38:43 ./usr/share/man/man1/ -rw-r--r-- root/root 882 2004-10-17 16:38:41 ./usr/share/man/man1/binclock.1.gz drwxr-xr-x root/root 0 2004-10-17 16:38:41 ./usr/share/doc/ drwxr-xr-x root/root 0 2004-10-17 16:38:43 ./usr/share/doc/binclock/ -rw-r--r-- root/root 1698 2004-07-24 13:42:04 ./usr/share/doc/binclock/README -rw-r--r-- root/root 484 2004-07-24 15:10:45 ./usr/share/doc/binclock/copyright -rw-r--r-- root/root 319 2004-07-24 15:10:45 ./usr/share/doc/binclock/changelog.Debian.gz drwxr-xr-x root/root 0 2004-10-17 16:38:42 ./usr/lib/ drwxr-xr-x root/root 0 2004-10-17 16:38:42 ./usr/lib/menu/ -rw-r--r-- root/root 99 2004-07-24 19:54:23 ./usr/lib/menu/binclock drwxr-xr-x root/root 0 2004-10-17 16:38:41 ./etc/ --endshelloutput - Installieren des Pakets mittels dpkg -i binclock-1.5-1_i386.deb (wahlweise in chroot) --newpage Veröffentlichung --boldon --huge Veröffentlichung --ulon --horline --boldoff --uloff --boldon 1. Kopieren des Quellpakets und Binärpakets in gewünschten Ordner (z.B. auf einen http-Server) --- --beginshelloutput $ ls binclock_1.5-1.diff.gz binclock_1.5-1.dsc binclock_1.5-1_i386.deb binclock_1.5.orig.tar.gz --endshelloutput 2. Erstellen von Sources.gz (Namen, Version, Build-Depends) und Packages.gz (Beschreibung, Name, Abhängigkeiten) --- --beginshelloutput $ dpkg-scanpackages ./ /dev/null | gzip -9c > Packages.gz ** Packages in archive but missing from override file: ** binclock Wrote 1 entries to output Packages file. --endshelloutput --- --beginshelloutput $ dpkg-scansources ./ /dev/null | gzip -9c > ./Sources.gz --endshelloutput --beginshelloutput $ echo thats all :) --endshelloutput --newpage Ende --boldon --huge Danke! Fragen? --ulon --horline --boldoff --uloff --boldon Feedback: --center Nico Golde --center http://www.ngolde.de --newpage Links --boldon --huge Links --ulon --horline --boldoff --uloff --boldon http://www.debian.org http://www.debian.org/devel/ debian-reference, maint-guide, debian-policy http://www.openoffice.de/linux/buch/debianpakete.html http://mentors.debian.net/ debian-mentors@lists.debian.org debian-devel@lists.debian.org http://www.ngolde.de/papers.html Vortragsunterlagen: http://www.ngolde.de/papers.html Präsentationsprogramm: TPP tpp-1.3.1/examples/align-footer.tpp0000644000175000017500000000047410207373317016270 0ustar akak00000000000000--author Nico Golde --title Testing Orientation --footer and this is the footer line --header and this is the header line This is oriented left. --- --center This is centered. --- --right This is oriented right. --- --beginoutput It works even here --center as you can see --right in these three lines. --endoutput tpp-1.3.1/examples/huge.tpp0000644000175000017500000000054010124600112014604 0ustar akak00000000000000--author Andreas Krennmair --title Huge Text --newpage asdf --huge Test! --newpage jklö --huge Text! --newpage qwertz --huge Abrakadabra! --newpage Normaler Text --- --huge Simsalabim! --- --huge Is that a stupid presentation! --- Normal text. --newpage --sethugefont block --huge other font --newpage --sethugefont standard --huge This is the end... tpp-1.3.1/examples/source.tpp0000644000175000017500000000211710101026214015156 0ustar akak00000000000000--title Some Source Code Examples --author Andreas Krennmair --date today --newpage --center The Famous "Hello World" Source Code --beginoutput #include int main(void) { puts("Hello World"); return 0; } --endoutput --newpage --center The Very Same Example, But This Time In Pieces --beginoutput #include --- int main(void) { --- puts("Hello World"); --- return 0; --- } --endoutput --newpage --heading This is some example source code --beginoutput static void run_command(char *cmd, char *ip) { int pid; pid = fork(); if (pid == 0) { char env_ip[20], env_cmd[strlen(cmd)+10]; char *const envp[] = { env_ip, env_cmd, "PATH=/bin:/usr/bin", 0 }; snprintf(env_cmd, sizeof(env_cmd), "CMD=%s", cmd); snprintf(env_ip, sizeof(env_ip), "IP=%s", ip); execle("/bin/sh", "/bin/sh", "-c", cmd, NULL, envp); limit_syslog(LOG_ERR, "execl of %s failed: %s", cmd, strerror(errno)); exit(EXIT_FAILURE); } else if (pid == -1) { limit_syslog(LOG_ERR, "fork failed: %s", strerror(errno)); } else { (void) waitpid(pid, NULL, 0); } } --endoutput tpp-1.3.1/examples/horline.tpp0000644000175000017500000000022610103471200015316 0ustar akak00000000000000--author Nico Golde --date today --heading Test of horizon line --newpage --heading TPP can display a horizontal line too. --horline tpp-1.3.1/examples/colors.tpp0000644000175000017500000000033510102126612015163 0ustar akak00000000000000--author Nico Golde --heading Colortest --bgcolor red --newpage --boldon --color red Hallo --color white das --color green ist --color blue ein --color cyan Test --color magenta mit --color yellow Farben tpp-1.3.1/examples/manyslides.tpp0000644000175000017500000000677510100415170016046 0ustar akak00000000000000--author Andreas Krennmair --title Many Slides --date today this is the abstract. bla. bla. bla. --newpage slide1 this is slide 1 --newpage slide2 this is slide 2 --newpage slide3 this is slide 3 --newpage slide4 this is slide 4 --newpage slide5 this is slide 5 --newpage slide6 this is slide 6 --newpage slide7 this is slide 7 --newpage slide8 this is slide 8 --newpage slide9 this is slide 9 --newpage slide10 this is slide 10 --newpage slide11 this is slide 11 --newpage slide12 this is slide 12 --newpage slide13 this is slide 13 --newpage slide14 this is slide 14 --newpage slide15 this is slide 15 --newpage slide16 this is slide 16 --newpage slide17 this is slide 17 --newpage slide18 this is slide 18 --newpage slide19 this is slide 19 --newpage slide20 this is slide 20 --newpage slide21 this is slide 21 --newpage slide22 this is slide 22 --newpage slide23 this is slide 23 --newpage slide24 this is slide 24 --newpage slide25 this is slide 25 --newpage slide26 this is slide 26 --newpage slide27 this is slide 27 --newpage slide28 this is slide 28 --newpage slide29 this is slide 29 --newpage slide30 this is slide 30 --newpage slide31 this is slide 31 --newpage slide32 this is slide 32 --newpage slide33 this is slide 33 --newpage slide34 this is slide 34 --newpage slide35 this is slide 35 --newpage slide36 this is slide 36 --newpage slide37 this is slide 37 --newpage slide38 this is slide 38 --newpage slide39 this is slide 39 --newpage slide40 this is slide 40 --newpage slide41 this is slide 41 --newpage slide42 this is slide 42 --newpage slide43 this is slide 43 --newpage slide44 this is slide 44 --newpage slide45 this is slide 45 --newpage slide46 this is slide 46 --newpage slide47 this is slide 47 --newpage slide48 this is slide 48 --newpage slide49 this is slide 49 --newpage slide50 this is slide 50 --newpage slide51 this is slide 51 --newpage slide52 this is slide 52 --newpage slide53 this is slide 53 --newpage slide54 this is slide 54 --newpage slide55 this is slide 55 --newpage slide56 this is slide 56 --newpage slide57 this is slide 57 --newpage slide58 this is slide 58 --newpage slide59 this is slide 59 --newpage slide60 this is slide 60 --newpage slide61 this is slide 61 --newpage slide62 this is slide 62 --newpage slide63 this is slide 63 --newpage slide64 this is slide 64 --newpage slide65 this is slide 65 --newpage slide66 this is slide 66 --newpage slide67 this is slide 67 --newpage slide68 this is slide 68 --newpage slide69 this is slide 69 --newpage slide70 this is slide 70 --newpage slide71 this is slide 71 --newpage slide72 this is slide 72 --newpage slide73 this is slide 73 --newpage slide74 this is slide 74 --newpage slide75 this is slide 75 --newpage slide76 this is slide 76 --newpage slide77 this is slide 77 --newpage slide78 this is slide 78 --newpage slide79 this is slide 79 --newpage slide80 this is slide 80 --newpage slide81 this is slide 81 --newpage slide82 this is slide 82 --newpage slide83 this is slide 83 --newpage slide84 this is slide 84 --newpage slide85 this is slide 85 --newpage slide86 this is slide 86 --newpage slide87 this is slide 87 --newpage slide88 this is slide 88 --newpage slide89 this is slide 89 --newpage slide90 this is slide 90 --newpage slide91 this is slide 91 --newpage slide92 this is slide 92 --newpage slide93 this is slide 93 --newpage slide94 this is slide 94 --newpage slide95 this is slide 95 --newpage slide96 this is slide 96 --newpage slide97 this is slide 97 --newpage slide98 this is slide 98 --newpage slide99 this is slide 99 --newpage slide100 this is slide 100 tpp-1.3.1/examples/shell.tpp0000644000175000017500000000206110100301563014765 0ustar akak00000000000000--author Andreas Krennmair --title Some shell examples --date foobar --newpage --center Some "funny" shell tricks This example shows some of the so-called "funny" shell tricks on csh/sh --beginshelloutput $ make love Make: Don't know how to make love. Stop. $ %blow %blow: No such job. $ PATH=pretending! /usr/ucb/which sense no sense in pretending! --- $ drink < bottle; opener bottle: cannot open opener: not found --- $ If I had a ( for every $ Congress spent, what would I have? Too many ('s. $ --endshelloutput --- And here some more text. --newpage --center And here some more serious shell things --beginshelloutput $ ls / bin/ dev/ initrd/ lost+found/ repos/ tftpboot/ vmlinuz@ boot/ etc/ initrd.img@ mnt/ root/ tmp/ vmlinuz.old@ cdrom/ floppy/ initrd.img.old@ opt/ sbin/ usr/ data/ home/ lib/ proc/ sys/ var/ $ uptime 23:22:41 up 23 days, 4:18, 8 users, load average: 0.10, 0.25, 0.25 $ sleep 3 --sleep 3 $ uname -rnsm Linux tintifax 2.6.6-1-686-smp i686 $ --endshelloutput tpp-1.3.1/examples/wrap.tpp0000644000175000017500000000274110207373317014652 0ustar akak00000000000000--author Andreas Krennmair --title Wrapping long lines --date today %a %b %e %H:%M:%S %Z %Y This is oriented left. This is also quite long, also there to test how the line wrapping works. You will see examples for centered wrapping and right aligned wrapping later. --- --center This is centered. And an extremely long line, so long that it is going to be wrapped at some point, wherever that is. --- --right This is oriented right. Probably this line is even longer than the other, but this doesn't matter because this test must be as real as only possible. And I will make it even longer than planned, just to test how reliable it is, and whether it really aligns to the right. --- --beginoutput This is oriented left. This is also quite long, also there to test how the line wrapping works. You will see examples for centered wrapping and right aligned wrapping later. --- --center This is centered. And an extremely long line, so long that it is going to be wrapped at some point, wherever that is. --- --right This is oriented right. Probably this line is even longer than the other, but this doesn't matter because this test must be as real as only possible. And I will make it even longer than planned, just to test how reliable it is, and whether it really aligns to the right. --endoutput --newpage --heading This is probably an overlong heading, but it's supposed to be the way it is, for testing purposes. One more sentence, and we have our test object. This is normal text after the heading. tpp-1.3.1/examples/list.tpp0000644000175000017500000000047710100272021014636 0ustar akak00000000000000--author Andreas Krennmair --title Some presentation --date today --newpage --center This Presentation's Agenda * Introduction --- * Historic Overview --- * Basic Concepts --- * Implementation --- * Examples --- * Conclusions --- And now for the inofficial part --center PARTY, PARTY, PARTY !!! tpp-1.3.1/tpp.rb0000755000175000017500000011704610613074165012476 0ustar akak00000000000000#!/usr/bin/env ruby version_number = "1.3.1" # Loads the ncurses-ruby module and imports "Ncurses" into the # current namespace. It stops the program if loading the # ncurses-ruby module fails. def load_ncurses begin require "ncurses" include Ncurses rescue LoadError $stderr.print < COLOR_WHITE, "yellow" => COLOR_YELLOW, "red" => COLOR_RED, "green" => COLOR_GREEN, "blue" => COLOR_BLUE, "cyan" => COLOR_CYAN, "magenta" => COLOR_MAGENTA, "black" => COLOR_BLACK, "default" => -1 } colors[color] end # Maps color name to a color pair index def ColorMap.get_color_pair(color) colors = { "white" => 1, "yellow" => 2, "red" => 3, "green" => 4, "blue" => 5, "cyan" => 6, "magenta" => 7, "black" => 8, "default" =>-1} colors[color] end end # Opens a TPP source file, and splits it into the different pages. class FileParser def initialize(filename) @filename = filename @pages = [] end # Parses the specified file and returns an array of Page objects def get_pages begin f = File.open(@filename) rescue $stderr.puts "Error: couldn't open file: #{$!}" Kernel.exit(1) end number_pages = 0 cur_page = Page.new("slide " + (number_pages + 1).to_s) f.each_line do |line| line.chomp! case line when /^--##/ # ignore comments when /^--newpage/ @pages << cur_page number_pages += 1 name = line.sub(/^--newpage/,"") if name == "" then name = "slide " + (number_pages+1).to_s else name.strip! end cur_page = Page.new(name) else cur_page.add_line(line) end # case end # each @pages << cur_page end end # class FileParser # Represents a page (aka `slide') in TPP. A page consists of a title and one or # more lines. class Page def initialize(title) @lines = [] @title = title @cur_line = 0 @eop = false end # Appends a line to the page, but only if _line_ is not null def add_line(line) @lines << line if line end # Returns the next line. In case the last line is hit, then the end-of-page marker is set. def next_line line = @lines[@cur_line] @cur_line += 1 if @cur_line >= @lines.size then @eop = true end return line end # Returns whether end-of-page has been reached. def eop? @eop end # Resets the end-of-page marker and sets the current line marker to the first line def reset_eop @cur_line = 0 @eop = false end # Returns all lines in the page. def lines @lines end # Returns the page's title def title @title end end # Implements a generic visualizer from which all other visualizers need to be # derived. If Ruby supported abstract methods, all the do_* methods would be # abstract. class TppVisualizer def initialize # nothing end # Splits a line into several lines, where each of the result lines is at most # _width_ characters long, caring about word boundaries, and returns an array # of strings. def split_lines(text,width) lines = [] if text then begin i = width if text.length <= i then # text length is OK -> add it to array and stop splitting lines << text text = "" else # search for word boundary (space actually) while i > 0 and text[i] != ' '[0] do i -= 1 end # if we can't find any space character, simply cut it off at the maximum width if i == 0 then i = width end # extract line x = text[0..i-1] # remove extracted line text = text[i+1..-1] # added line to array lines << x end end while text.length > 0 end return lines end def do_footer(footer_text) $stderr.puts "Error: TppVisualizer#do_footer has been called directly." Kernel.exit(1) end def do_header(header_text) $stderr.puts "Error: TppVisualizer#do_header has been called directly." Kernel.exit(1) end def do_refresh $stderr.puts "Error: TppVisualizer#do_refresh has been called directly." Kernel.exit(1) end def new_page $stderr.puts "Error: TppVisualizer#new_page has been called directly." Kernel.exit(1) end def do_heading(text) $stderr.puts "Error: TppVisualizer#do_heading has been called directly." Kernel.exit(1) end def do_withborder $stderr.puts "Error: TppVisualizer#do_withborder has been called directly." Kernel.exit(1) end def do_horline $stderr.puts "Error: TppVisualizer#do_horline has been called directly." Kernel.exit(1) end def do_color(text) $stderr.puts "Error: TppVisualizer#do_color has been called directly." Kernel.exit(1) end def do_center(text) $stderr.puts "Error: TppVisualizer#do_center has been called directly." Kernel.exit(1) end def do_right(text) $stderr.puts "Error: TppVisualizer#do_right has been called directly." Kernel.exit(1) end def do_exec(cmdline) $stderr.puts "Error: TppVisualizer#do_exec has been called directly." Kernel.exit(1) end def do_wait $stderr.puts "Error: TppVisualizer#do_wait has been called directly." Kernel.exit(1) end def do_beginoutput $stderr.puts "Error: TppVisualizer#do_beginoutput has been called directly." Kernel.exit(1) end def do_beginshelloutput $stderr.puts "Error: TppVisualizer#do_beginshelloutput has been called directly." Kernel.exit(1) end def do_endoutput $stderr.puts "Error: TppVisualizer#do_endoutput has been called directly." Kernel.exit(1) end def do_endshelloutput $stderr.puts "Error: TppVisualizer#do_endshelloutput has been called directly." Kernel.exit(1) end def do_sleep(time2sleep) $stderr.puts "Error: TppVisualizer#do_sleep has been called directly." Kernel.exit(1) end def do_boldon $stderr.puts "Error: TppVisualizer#do_boldon has been called directly." Kernel.exit(1) end def do_boldoff $stderr.puts "Error: TppVisualizer#do_boldoff has been called directly." Kernel.exit(1) end def do_revon $stderr.puts "Error: TppVisualizer#do_revon has been called directly." Kernel.exit(1) end def do_revoff $stderr.puts "Error: TppVisualizer#do_revoff has been called directly." Kernel.exit(1) end def do_ulon $stderr.puts "Error: TppVisualizer#do_ulon has been called directly." Kernel.exit(1) end def do_uloff $stderr.puts "Error: TppVisualizer#do_uloff has been called directly." Kernel.exit(1) end def do_beginslideleft $stderr.puts "Error: TppVisualizer#do_beginslideleft has been called directly." Kernel.exit(1) end def do_endslide $stderr.puts "Error: TppVisualizer#do_endslide has been called directly." Kernel.exit(1) end def do_command_prompt $stderr.puts "Error: TppVisualizer#do_command_prompt has been called directly." Kernel.exit(1) end def do_beginslideright $stderr.puts "Error: TppVisualizer#do_beginslideright has been called directly." Kernel.exit(1) end def do_beginslidetop $stderr.puts "Error: TppVisualizer#do_beginslidetop has been called directly." Kernel.exit(1) end def do_beginslidebottom $stderr.puts "Error: TppVisualizer#do_beginslidebottom has been called directly." Kernel.exit(1) end def do_sethugefont $stderr.puts "Error: TppVisualizer#do_sethugefont has been called directly." Kernel.exit(1) end def do_huge(text) $stderr.puts "Error: TppVisualizer#do_huge has been called directly." Kernel.exit(1) end def print_line(line) $stderr.puts "Error: TppVisualizer#print_line has been called directly." Kernel.exit(1) end def do_title(title) $stderr.puts "Error: TppVisualizer#do_title has been called directly." Kernel.exit(1) end def do_author(author) $stderr.puts "Error: TppVisualizer#do_author has been called directly." Kernel.exit(1) end def do_date(date) $stderr.puts "Error: TppVisualizer#do_date has been called directly." Kernel.exit(1) end def do_bgcolor(color) $stderr.puts "Error: TppVisualizer#do_bgcolor has been called directly." Kernel.exit(1) end def do_fgcolor(color) $stderr.puts "Error: TppVisualizer#do_fgcolor has been called directly." Kernel.exit(1) end def do_color(color) $stderr.puts "Error: TppVisualizer#do_color has been called directly." Kernel.exit(1) end # Receives a _line_, parses it if necessary, and dispatches it # to the correct method which then does the correct processing. # It returns whether the controller shall wait for input. def visualize(line,eop) case line when /^--heading / text = line.sub(/^--heading /,"") do_heading(text) when /^--withborder/ do_withborder when /^--horline/ do_horline when /^--color / text = line.sub(/^--color /,"") text.strip! do_color(text) when /^--center / text = line.sub(/^--center /,"") do_center(text) when /^--right / text = line.sub(/^--right /,"") do_right(text) when /^--exec / cmdline = line.sub(/^--exec /,"") do_exec(cmdline) when /^---/ do_wait return true when /^--beginoutput/ do_beginoutput when /^--beginshelloutput/ do_beginshelloutput when /^--endoutput/ do_endoutput when /^--endshelloutput/ do_endshelloutput when /^--sleep / time2sleep = line.sub(/^--sleep /,"") do_sleep(time2sleep) when /^--boldon/ do_boldon when /^--boldoff/ do_boldoff when /^--revon/ do_revon when /^--revoff/ do_revoff when /^--ulon/ do_ulon when /^--uloff/ do_uloff when /^--beginslideleft/ do_beginslideleft when /^--endslideleft/, /^--endslideright/, /^--endslidetop/, /^--endslidebottom/ do_endslide when /^--beginslideright/ do_beginslideright when /^--beginslidetop/ do_beginslidetop when /^--beginslidebottom/ do_beginslidebottom when /^--sethugefont / params = line.sub(/^--sethugefont /,"") do_sethugefont(params.strip) when /^--huge / figlet_text = line.sub(/^--huge /,"") do_huge(figlet_text) when /^--footer / @footer_txt = line.sub(/^--footer /,"") do_footer(@footer_txt) when /^--header / @header_txt = line.sub(/^--header /,"") do_header(@header_txt) when /^--title / title = line.sub(/^--title /,"") do_title(title) when /^--author / author = line.sub(/^--author /,"") do_author(author) when /^--date / date = line.sub(/^--date /,"") if date == "today" then date = Time.now.strftime("%b %d %Y") elsif date =~ /^today / then date = Time.now.strftime(date.sub(/^today /,"")) end do_date(date) when /^--bgcolor / color = line.sub(/^--bgcolor /,"").strip do_bgcolor(color) when /^--fgcolor / color = line.sub(/^--fgcolor /,"").strip do_fgcolor(color) when /^--color / color = line.sub(/^--color /,"").strip do_color(color) else print_line(line) end return false end def close # nothing end end # Implements an interactive visualizer which builds on top of ncurses. class NcursesVisualizer < TppVisualizer def initialize @figletfont = "standard" Ncurses.initscr Ncurses.curs_set(0) Ncurses.cbreak # unbuffered input Ncurses.noecho # turn off input echoing Ncurses.stdscr.intrflush(false) Ncurses.stdscr.keypad(true) @screen = Ncurses.stdscr setsizes Ncurses.start_color() Ncurses.use_default_colors() do_bgcolor("black") #do_fgcolor("white") @fgcolor = ColorMap.get_color_pair("white") @voffset = 5 @indent = 3 @cur_line = @voffset @output = @shelloutput = false end def get_key ch = @screen.getch case ch when Ncurses::KEY_RIGHT return :keyright when Ncurses::KEY_DOWN return :keydown when Ncurses::KEY_LEFT return :keyleft when Ncurses::KEY_UP return :keyup when Ncurses::KEY_RESIZE return :keyresize else return ch end end def clear @screen.clear @screen.refresh end def setsizes @termwidth = Ncurses.getmaxx(@screen) @termheight = Ncurses.getmaxy(@screen) end def do_refresh @screen.refresh end def do_withborder @withborder = true draw_border end def do_command_prompt() message = "Press any key to continue :)" cursor_pos = 0 max_len = 50 prompt = "tpp@localhost:~ $ " string = "" window = @screen.dupwin Ncurses.overwrite(window,@screen) # overwrite @screen with window Ncurses.curs_set(1) Ncurses.echo window.move(@termheight/4,1) window.clrtoeol() window.clrtobot() window.mvaddstr(@termheight/4,1,prompt) # add the prompt string loop do window.mvaddstr(@termheight/4,1+prompt.length,string) # add the code window.move(@termheight/4,1+prompt.length+cursor_pos) # move cursor to the end of code ch = window.getch case ch when Ncurses::KEY_ENTER, ?\n, ?\r Ncurses.curs_set(0) Ncurses.noecho rc = Kernel.system(string) if not rc then @screen.mvaddstr(@termheight/4+1,1,"Error: exec \"#{string}\" failed with error code #{$?}") @screen.mvaddstr(@termheight-2,@termwidth/2-message.length/2,message) end if rc then @screen.mvaddstr(@termheight-2,@termwidth/2-message.length/2,message) ch = Ncurses.getch() @screen.refresh end return when Ncurses::KEY_LEFT cursor_pos = [0, cursor_pos-1].max # jump one character to the left when Ncurses::KEY_RIGHT cursor_pos = [0, cursor_pos+1].max # jump one character to the right when Ncurses::KEY_BACKSPACE string = string[0...([0, cursor_pos-1].max)] + string[cursor_pos..-1] cursor_pos = [0, cursor_pos-1].max window.mvaddstr(@termheight/4, 1+prompt.length+string.length, " ") when " "[0]..255 if (cursor_pos < max_len) string[cursor_pos,0] = ch.chr cursor_pos += 1 else Ncurses.beep end else Ncurses.beep end end Ncurses.curs_set(0) end def draw_border @screen.move(0,0) @screen.addstr(".") (@termwidth-2).times { @screen.addstr("-") }; @screen.addstr(".") @screen.move(@termheight-2,0) @screen.addstr("`") (@termwidth-2).times { @screen.addstr("-") }; @screen.addstr("'") 1.upto(@termheight-3) do |y| @screen.move(y,0) @screen.addstr("|") end 1.upto(@termheight-3) do |y| @screen.move(y,@termwidth-1) @screen.addstr("|") end end def new_page @cur_line = @voffset @output = @shelloutput = false setsizes @screen.clear end def do_heading(line) @screen.attron(Ncurses::A_BOLD) print_heading(line) @screen.attroff(Ncurses::A_BOLD) end def do_horline @screen.attron(Ncurses::A_BOLD) @termwidth.times do |x| @screen.move(@cur_line,x) @screen.addstr("-") end @screen.attroff(Ncurses::A_BOLD) end def print_heading(text) width = @termwidth - 2*@indent lines = split_lines(text,width) lines.each do |l| @screen.move(@cur_line,@indent) x = (@termwidth - l.length)/2 @screen.move(@cur_line,x) @screen.addstr(l) @cur_line += 1 end end def do_center(text) width = @termwidth - 2*@indent if @output or @shelloutput then width -= 2 end lines = split_lines(text,width) lines.each do |l| @screen.move(@cur_line,@indent) if @output or @shelloutput then @screen.addstr("| ") end x = (@termwidth - l.length)/2 @screen.move(@cur_line,x) @screen.addstr(l) if @output or @shelloutput then @screen.move(@cur_line,@termwidth - @indent - 2) @screen.addstr(" |") end @cur_line += 1 end end def do_right(text) width = @termwidth - 2*@indent if @output or @shelloutput then width -= 2 end lines = split_lines(text,width) lines.each do |l| @screen.move(@cur_line,@indent) if @output or @shelloutput then @screen.addstr("| ") end x = (@termwidth - l.length - 5) @screen.move(@cur_line,x) @screen.addstr(l) if @output or @shelloutput then @screen.addstr(" |") end @cur_line += 1 end end def show_help_page help_text = [ "tpp help", "", "space bar ............................... display next entry within page", "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 first page", "e, E .................................... jump to the last page", "c, C .................................... start command line", "?, h .................................... this help screen" ] @screen.clear y = @voffset help_text.each do |line| @screen.move(y,@indent) @screen.addstr(line) y += 1 end @screen.move(@termheight - 2, @indent) @screen.addstr("Press any key to return to slide") @screen.refresh end def do_exec(cmdline) rc = Kernel.system(cmdline) if not rc then # @todo: add error message end end def do_wait # nothing end def do_beginoutput @screen.move(@cur_line,@indent) @screen.addstr(".") (@termwidth - @indent*2 - 2).times { @screen.addstr("-") } @screen.addstr(".") @output = true @cur_line += 1 end def do_beginshelloutput @screen.move(@cur_line,@indent) @screen.addstr(".") (@termwidth - @indent*2 - 2).times { @screen.addstr("-") } @screen.addstr(".") @shelloutput = true @cur_line += 1 end def do_endoutput if @output then @screen.move(@cur_line,@indent) @screen.addstr("`") (@termwidth - @indent*2 - 2).times { @screen.addstr("-") } @screen.addstr("'") @output = false @cur_line += 1 end end def do_title(title) do_boldon do_center(title) do_boldoff do_center("") end def do_footer(footer_txt) @screen.move(@termheight - 3, (@termwidth - footer_txt.length)/2) @screen.addstr(footer_txt) end def do_header(header_txt) @screen.move(@termheight - @termheight+1, (@termwidth - header_txt.length)/2) @screen.addstr(header_txt) end def do_author(author) do_center(author) do_center("") end def do_date(date) do_center(date) do_center("") end def do_endshelloutput if @shelloutput then @screen.move(@cur_line,@indent) @screen.addstr("`") (@termwidth - @indent*2 - 2).times { @screen.addstr("-") } @screen.addstr("'") @shelloutput = false @cur_line += 1 end end def do_sleep(time2sleep) Kernel.sleep(time2sleep.to_i) end def do_boldon @screen.attron(Ncurses::A_BOLD) end def do_boldoff @screen.attroff(Ncurses::A_BOLD) end def do_revon @screen.attron(Ncurses::A_REVERSE) end def do_revoff @screen.attroff(Ncurses::A_REVERSE) end def do_ulon @screen.attron(Ncurses::A_UNDERLINE) end def do_uloff @screen.attroff(Ncurses::A_UNDERLINE) end def do_beginslideleft @slideoutput = true @slidedir = "left" end def do_endslide @slideoutput = false end def do_beginslideright @slideoutput = true @slidedir = "right" end def do_beginslidetop @slideoutput = true @slidedir = "top" end def do_beginslidebottom @slideoutput = true @slidedir = "bottom" end def do_sethugefont(params) @figletfont = params end def do_huge(figlet_text) output_width = @termwidth - @indent output_width -= 2 if @output or @shelloutput op = IO.popen("figlet -f #{@figletfont} -w #{output_width} -k \"#{figlet_text}\"","r") op.readlines.each do |line| print_line(line) end op.close end def do_bgcolor(color) bgcolor = ColorMap.get_color(color) or COLOR_BLACK Ncurses.init_pair(1, COLOR_WHITE, bgcolor) Ncurses.init_pair(2, COLOR_YELLOW, bgcolor) Ncurses.init_pair(3, COLOR_RED, bgcolor) Ncurses.init_pair(4, COLOR_GREEN, bgcolor) Ncurses.init_pair(5, COLOR_BLUE, bgcolor) Ncurses.init_pair(6, COLOR_CYAN, bgcolor) Ncurses.init_pair(7, COLOR_MAGENTA, bgcolor) Ncurses.init_pair(8, COLOR_BLACK, bgcolor) if @fgcolor then Ncurses.bkgd(Ncurses.COLOR_PAIR(@fgcolor)) else Ncurses.bkgd(Ncurses.COLOR_PAIR(1)) end end def do_fgcolor(color) @fgcolor = ColorMap.get_color_pair(color) Ncurses.attron(Ncurses.COLOR_PAIR(@fgcolor)) end def do_color(color) num = ColorMap.get_color_pair(color) Ncurses.attron(Ncurses.COLOR_PAIR(num)) end def type_line(l) l.each_byte do |x| @screen.addstr(x.chr) @screen.refresh() r = rand(20) time_to_sleep = (5 + r).to_f / 250; # puts "#{time_to_sleep} #{r}" Kernel.sleep(time_to_sleep) end end def slide_text(l) return if l == "" case @slidedir when "left" xcount = l.length-1 while xcount >= 0 @screen.move(@cur_line,@indent) @screen.addstr(l[xcount..l.length-1]) @screen.refresh() time_to_sleep = 1.to_f / 20 Kernel.sleep(time_to_sleep) xcount -= 1 end when "right" (@termwidth - @indent).times do |pos| @screen.move(@cur_line,@termwidth - pos - 1) @screen.clrtoeol() maxpos = (pos >= l.length-1) ? l.length-1 : pos @screen.addstr(l[0..pos]) @screen.refresh() time_to_sleep = 1.to_f / 20 Kernel.sleep(time_to_sleep) end # do when "top" # ycount = @cur_line new_scr = @screen.dupwin 1.upto(@cur_line) do |i| Ncurses.overwrite(new_scr,@screen) # overwrite @screen with new_scr @screen.move(i,@indent) @screen.addstr(l) @screen.refresh() Kernel.sleep(1.to_f / 10) end when "bottom" new_scr = @screen.dupwin (@termheight-1).downto(@cur_line) do |i| Ncurses.overwrite(new_scr,@screen) @screen.move(i,@indent) @screen.addstr(l) @screen.refresh() Kernel.sleep(1.to_f / 10) end end end def print_line(line) width = @termwidth - 2*@indent if @output or @shelloutput then width -= 2 end lines = split_lines(line,width) lines.each do |l| @screen.move(@cur_line,@indent) if (@output or @shelloutput) and ! @slideoutput then @screen.addstr("| ") end if @shelloutput and (l =~ /^\$/ or l=~ /^%/ or l =~ /^#/) then # allow sh and csh style prompts type_line(l) elsif @slideoutput then slide_text(l) else @screen.addstr(l) end if (@output or @shelloutput) and ! @slideoutput then @screen.move(@cur_line,@termwidth - @indent - 2) @screen.addstr(" |") end @cur_line += 1 end end def close Ncurses.nocbreak Ncurses.endwin end def read_newpage(pages,current_page) page = [] @screen.clear() col = 0 line = 2 pages.each_index do |i| @screen.move(line,col*15 + 2) if current_page == i then @screen.printw("%2d %s <=",i+1,pages[i].title[0..80]) else @screen.printw("%2d %s",i+1,pages[i].title[0..80]) end line += 1 if line >= @termheight - 3 then line = 2 col += 1 end end prompt = "jump to slide: " prompt_indent = 12 @screen.move(@termheight - 2, @indent + prompt_indent) @screen.addstr(prompt) # @screen.refresh(); Ncurses.echo @screen.scanw("%d",page) Ncurses.noecho @screen.move(@termheight - 2, @indent + prompt_indent) (prompt.length + page[0].to_s.length).times { @screen.addstr(" ") } if page[0] then return page[0] - 1 end return -1 # invalid page end def store_screen @screen.dupwin end def restore_screen(s) Ncurses.overwrite(s,@screen) end def draw_slidenum(cur_page,max_pages,eop) @screen.move(@termheight - 2, @indent) @screen.attroff(Ncurses::A_BOLD) # this is bad @screen.addstr("[slide #{cur_page}/#{max_pages}]") if @footer_txt.to_s.length > 0 then do_footer(@footer_txt) end if @header_txt.to_s.length > 0 then do_header(@header_txt) end if eop then draw_eop_marker end end def draw_eop_marker @screen.move(@termheight - 2, @indent - 1) @screen.attron(A_BOLD) @screen.addstr("*") @screen.attroff(A_BOLD) end end # Implements a visualizer which converts TPP source to LaTeX-beamer source (http://latex-beamer.sf.net/ class LatexVisualizer < TppVisualizer def initialize(outputfile) @filename = outputfile begin @f = File.open(@filename,"w+") rescue $stderr.print "Error: couldn't open file: #{$!}" Kernel.exit(1) end @slide_open = false @verbatim_open = false @width = 50 @title = @date = @author = false @begindoc = false @f.puts '% Filename: tpp.tex % Purpose: template file for tpp latex export % Authors: (c) Andreas Gredler, Michael Prokop http://grml.org/ % License: This file is licensed under the GPL v2. % Latest change: Fre Apr 15 20:34:37 CEST 2005 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \documentclass{beamer} \mode { \usetheme{Montpellier} \setbeamercovered{transparent} } \usepackage[german]{babel} \usepackage{umlaut} \usepackage[latin1]{inputenc} \usepackage{times} \usepackage[T1]{fontenc} ' end def do_footer(footer_text) end def do_header(header_text) end def do_refresh end def try_close if @verbatim_open then @f.puts '\end{verbatim}' @verbatim_open = false end if @slide_open then @f.puts '\end{frame}' @slide_open = false end end def new_page try_close end def do_heading(text) try_close @f.puts "\\section{#{text}}" end def do_withborder end def do_horline end def do_color(text) end def do_center(text) print_line(text) end def do_right(text) print_line(text) end def do_exec(cmdline) end def do_wait end def do_beginoutput # TODO: implement output stuff end def do_beginshelloutput end def do_endoutput end def do_endshelloutput end def do_sleep(time2sleep) end def do_boldon end def do_boldoff end def do_revon end def do_command_prompt end def do_revoff end def do_ulon end def do_uloff end def do_beginslideleft end def do_endslide end def do_beginslideright end def do_beginslidetop end def do_beginslidebottom end def do_sethugefont(text) end def do_huge(text) end def try_open if not @begindoc then @f.puts '\begin{document}' @begindoc = true end if not @slide_open then @f.puts '\begin{frame}[fragile]' @slide_open = true end if not @verbatim_open then @f.puts '\begin{verbatim}' @verbatim_open = true end end def try_intro if @author and @title and @date and not @begindoc then @f.puts '\begin{document}' @begindoc = true end if @author and @title and @date then @f.puts '\begin{frame} \titlepage \end{frame}' end end def print_line(line) try_open split_lines(line,@width).each do |l| @f.puts "#{l}" end end def do_title(title) @f.puts "\\title[#{title}]{#{title}}" @title = true try_intro end def do_author(author) @f.puts "\\author{#{author}}" @author = true try_intro end def do_date(date) @f.puts "\\date{#{date}}" @date = true try_intro end def do_bgcolor(color) end def do_fgcolor(color) end def do_color(color) end def close try_close @f.puts '\end{document} %%%%% END OF FILE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%' @f.close end end # Implements a generic controller from which all other controllers need to be derived. class TppController def initialize $stderr.puts "Error: TppController.initialize has been called directly!" Kernel.exit(1) end def close $stderr.puts "Error: TppController.close has been called directly!" Kernel.exit(1) end def run $stderr.puts "Error: TppController.run has been called directly!" Kernel.exit(1) end end # Implements a non-interactive controller for ncurses. Useful for displaying # unattended presentation. class AutoplayController < TppController def initialize(filename,secs,visualizer_class) @filename = filename @vis = visualizer_class.new @seconds = secs @cur_page = 0 end def close @vis.close end def run begin @reload_file = false parser = FileParser.new(@filename) @pages = parser.get_pages if @cur_page >= @pages.size then @cur_page = @pages.size - 1 end @vis.clear @vis.new_page do_run end while @reload_file end def do_run loop do wait = false @vis.draw_slidenum(@cur_page + 1, @pages.size, false) # read and visualize lines until the visualizer says "stop" or we reached end of page begin line = @pages[@cur_page].next_line eop = @pages[@cur_page].eop? wait = @vis.visualize(line,eop) end while not wait and not eop # draw slide number on the bottom left and redraw: @vis.draw_slidenum(@cur_page + 1, @pages.size, eop) @vis.do_refresh if eop then if @cur_page + 1 < @pages.size then @cur_page += 1 else @cur_page = 0 end @pages[@cur_page].reset_eop @vis.new_page end Kernel.sleep(@seconds) end # loop end end # Implements an interactive controller which feeds the visualizer until it is # told to stop, and then reads a key press and executes the appropiate action. class InteractiveController < TppController def initialize(filename,visualizer_class) @filename = filename @vis = visualizer_class.new @cur_page = 0 end def close @vis.close end def run begin @reload_file = false parser = FileParser.new(@filename) @pages = parser.get_pages if @cur_page >= @pages.size then @cur_page = @pages.size - 1 end @vis.clear @vis.new_page do_run end while @reload_file end def do_run loop do wait = false @vis.draw_slidenum(@cur_page + 1, @pages.size, false) # read and visualize lines until the visualizer says "stop" or we reached end of page begin line = @pages[@cur_page].next_line eop = @pages[@cur_page].eop? wait = @vis.visualize(line,eop) end while not wait and not eop # draw slide number on the bottom left and redraw: @vis.draw_slidenum(@cur_page + 1, @pages.size, eop) @vis.do_refresh # read a character from the keyboard # a "break" in the when means that it breaks the loop, i.e. goes on with visualizing lines loop do ch = @vis.get_key case ch when 'q'[0], 'Q'[0] # 'Q'uit return when 'r'[0], 'R'[0] # 'R'edraw slide changed_page = true # @todo: actually implement redraw when 'e'[0], 'E'[0] @cur_page = @pages.size - 1 break when 's'[0], 'S'[0] @cur_page = 0 break when 'j'[0], 'J'[0] # 'J'ump to slide screen = @vis.store_screen p = @vis.read_newpage(@pages,@cur_page) if p >= 0 and p < @pages.size @cur_page = p @pages[@cur_page].reset_eop @vis.new_page else @vis.restore_screen(screen) end break when 'l'[0], 'L'[0] # re'l'oad current file @reload_file = true return when 'c'[0], 'C'[0] # command prompt screen = @vis.store_screen @vis.do_command_prompt @vis.clear @vis.restore_screen(screen) when '?'[0], 'h'[0] screen = @vis.store_screen @vis.show_help_page ch = @vis.get_key @vis.clear @vis.restore_screen(screen) when :keyright, :keydown, ' '[0] if @cur_page + 1 < @pages.size and eop then @cur_page += 1 @pages[@cur_page].reset_eop @vis.new_page end break when 'b'[0], 'B'[0], :keyleft, :keyup if @cur_page > 0 then @cur_page -= 1 @pages[@cur_page].reset_eop @vis.new_page end break when :keyresize @vis.setsizes end end end # loop end end # Implements a visualizer which converts TPP source to a nicely formatted text # file which can e.g. be used as handout. class TextVisualizer < TppVisualizer def initialize(outputfile) @filename = outputfile begin @f = File.open(@filename,"w+") rescue $stderr.print "Error: couldn't open file: #{$!}" Kernel.exit(1) end @output_env = false @title = @author = @date = false @figletfont = "small" @width = 80 end def do_footer(footer_text) end def do_header(header_text) end def do_refresh end def new_page @f.puts "--------------------------------------------" end def do_heading(text) @f.puts "\n" split_lines(text,@width).each do |l| @f.puts "#{l}\n" end @f.puts "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" end def do_withborder end def do_horline @f.puts "********************************************" end def do_color(text) end def do_exec(cmdline) end def do_wait end def do_beginoutput @f.puts ".---------------------------" @output_env = true end def do_beginshelloutput do_beginoutput end def do_endoutput @f.puts "`---------------------------" @output_env = false end def do_endshelloutput do_endoutput end def do_sleep(time2sleep) end def do_boldon end def do_boldoff end def do_revon end def do_command_prompt end def do_revoff end def do_ulon end def do_uloff end def do_beginslideleft end def do_endslide end def do_beginslideright end def do_beginslidetop end def do_beginslidebottom end def do_sethugefont(text) @figletfont = text end def do_huge(text) output_width = @width output_width -= 2 if @output_env op = IO.popen("figlet -f #{@figletfont} -w @output_width -k \"#{text}\"","r") op.readlines.each do |line| print_line(line) end op.close end def print_line(line) lines = split_lines(line,@width) lines.each do |l| if @output_env then @f.puts "| #{l}" else @f.puts "#{l}" end end end def do_center(text) lines = split_lines(text,@width) lines.each do |line| spaces = (@width - line.length) / 2 spaces = 0 if spaces < 0 spaces.times { line = " " + line } print_line(line) end end def do_right(text) lines = split_lines(text,@width) lines.each do |line| spaces = @width - line.length spaces = 0 if spaces < 0 spaces.times { line = " " + line } print_line(line) end end def do_title(title) @f.puts "Title: #{title}" @title = true if @title and @author and @date then @f.puts "\n\n" end end def do_author(author) @f.puts "Author: #{author}" @author = true if @title and @author and @date then @f.puts "\n\n" end end def do_date(date) @f.puts "Date: #{date}" @date = true if @title and @author and @date then @f.puts "\n\n" end end def do_bgcolor(color) end def do_fgcolor(color) end def do_color(color) end def close @f.close end end # Implements a non-interactive controller to control non-interactive # visualizers (i.e. those that are used for converting TPP source code into # another format) class ConversionController < TppController def initialize(input,output,visualizer_class) parser = FileParser.new(input) @pages = parser.get_pages @vis = visualizer_class.new(output) end def run @pages.each do |p| begin line = p.next_line eop = p.eop? @vis.visualize(line,eop) end while not eop end end def close @vis.close end end # Prints a nicely formatted usage message. def usage $stderr.puts "usage: #{$0} [-t -o ] \n" $stderr.puts "\t -t \tset filetype as output format" $stderr.puts "\t -o \twrite output to file " $stderr.puts "\t -s \twait seconds between slides (with -t autoplay)" $stderr.puts "\t --version\tprint the version" $stderr.puts "\t --help\t\tprint this help" $stderr.puts "\n\t currently available types: ncurses (default), autoplay, latex, txt" Kernel.exit(1) end ################################ # Here starts the main program # ################################ input = nil output = nil type = "ncurses" time = 1 skip_next = false ARGV.each_index do |i| if skip_next then skip_next = false else if ARGV[i] == '-v' or ARGV[i] == '--version' then printf "tpp - text presentation program %s\n", version_number Kernel.exit(1) elsif ARGV[i] == '-h' or ARGV[i] == '--help' then usage elsif ARGV[i] == '-t' then type = ARGV[i+1] skip_next = true elsif ARGV[i] == '-o' then output = ARGV[i+1] skip_next = true elsif ARGV[i] == "-s" then time = ARGV[i+1].to_i skip_next = true elsif input == nil then input = ARGV[i] end if output!=nil and output==input then $stderr.puts "Don't use the input file name as the output filename to prevent overwriting it. \n" Kernel.exit(1) end end end if input == nil then usage end ctrl = nil case type when "ncurses" load_ncurses ctrl = InteractiveController.new(input,NcursesVisualizer) when "autoplay" load_ncurses ctrl = AutoplayController.new(input,time,NcursesVisualizer) when "txt" if output == nil then usage else ctrl = ConversionController.new(input,output,TextVisualizer) end when "latex" if output == nil then usage else ctrl = ConversionController.new(input,output,LatexVisualizer) end else usage end # case ctrl.run ctrl.close tpp-1.3.1/CHANGES0000644000175000017500000000335110613074165012327 0ustar akak000000000000001.3.1: - added patch by Gregor Herrman to close the boxes - implemented some kind of auto-advance-after-n-seconds - added german translation of README, thanks Thomas Winde and Frank Hofmann 1.3: - implemented text output mode - implemented (working) LaTeX output mode - refactored controller/visualizer architecture to be more generic 1.2: - heavily refactored tpp code - added line wrapping - added possibility of a footer and a header - added LinuxDoc SGML output mode - added reload feature - added support for transparent terminals 1.1.1: - added version number command line option 1.1: - fixed two spelling mistakes (one reported by Michael Prokop) - added the possibility to set a custom format string for --date today - added function check of ncurses-ruby - fixed white space ignoring after color tag - added vim syntax file for tpp files - added new command "--sethugefont" - added possibility of commenting out lines with --## 1.0: - added manual page - fixed LaTeX converter - added horizontal line feature - --help option - cursor keys usable from within slides 0.2: - end-of-page notification added - LaTeX conversion mode added (still incomplete!) - added help screen - support for setting colors for foreground and background added - added possibility to slide in text from all left, right, top and bottom - added possibility to show slides with border around - added command line, you can execute system command during the presentation without change the window. They will be displayed in the slide. - added the possibility to jump to the start and the end of the slides with one key - exec-feature, you can execute commands in you slide directly 0.1: initial release tpp-1.3.1/COPYING0000644000175000017500000004307610101437333012367 0ustar akak00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy 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., 675 Mass Ave, Cambridge, MA 02139, USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. tpp-1.3.1/THANKS0000644000175000017500000000046110613074165012246 0ustar akak00000000000000Sven Guckes, Florian Cramer initial idea of tpp Patricia Jung for supporting tpp and making the vim syntax file Gerfried Fuchs for making another vim syntax file Christian Dietrich for emacs file Thomas Winde Frank, Frank Hofmann for the German translation of README tpp-1.3.1/DESIGN0000644000175000017500000000330110253017160012213 0ustar akak00000000000000TPP design decisions: 1. Visualizers The visualization of a slide is done by a visualizer. Visualization in the context of TPP means outputting it to an output device, e.g. a terminal via ncurses, a LaTeX source file, a Docbook source file, you name it. The generic TppVisualizer is the base for all visualizers. Look at the source which methods you need to implement if you want to write your own visualizer. The visualizer is also responsible for encapsulating the output device, e.g. interactive visualizers (like the NcursesVisualizer) also return the user's key presses. 2. Controllers The controller controls the correct program flow, utilizing the parser and a visualizer. The generic TppVisualizer is the base for all visualizers. All controllers must implement a constructor, and the two methods run and close. So far, three types of controllers have been implemented. 2.1 InteractiveController The InteractiveController feeds the content of the page to the visualizer until it is told to stop. It then reads the next key press from the visualizer, and runs the appropriate action. 2.2 AutoplayController The AutoplayController works like the InteractiveController, with the only difference that it ignores any information to stop and wait for a key press. It can be used for unattended presentations. 2.3 ConversionController The ConversionController is used for non-interactive, non-visual processing, like converting TPP source into another file format. The "visualizer" is responsible for producing the appropriate output format. Currently, it is used for the TextVisualizer and the LatexVisualizer, which generate text/LaTeX-beamer representations of the presentations they're fed with. tpp-1.3.1/Makefile0000644000175000017500000000136610253017160012770 0ustar akak00000000000000# tpp Makefile by Nico Golde # Latest Change: Sam Jul 31 00:58:01 CEST 2004 ################################################# BIN = tpp prefix=/usr/local INSPATH= $(prefix)/bin/ DOCPATH = $(prefix)/share/doc/tpp MANPATH = $(prefix)/share/man/man1 all: @echo "TPP doesn't need to be built. Run \`make install' in order to install it." install : mkdir -p $(DOCPATH) install -m644 DESIGN CHANGES COPYING README THANKS $(DOCPATH) install -m644 doc/tpp.1 $(MANPATH) install tpp.rb $(INSPATH)$(BIN) mkdir -p $(DOCPATH)/contrib mkdir -p $(DOCPATH)/examples install -m644 examples/* $(DOCPATH)/examples/ install -m644 contrib/* $(DOCPATH)/contrib/ uninstall : rm -f $(INSPATH)$(BIN) rm -rf $(DOCPATH) rm -f $(MANPATH)/tpp.1* tpp-1.3.1/README0000644000175000017500000002132310613074165012213 0ustar akak00000000000000tpp - 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 * a recent version of ncurses * 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 .............................. display next entry within page 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 : the background color is set to . --fgcolor : the foreground color is set to . 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 : 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 : draw the text with specified color until a new color is set --center : center . The text will be drawn centered. --right : draw 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 $ are printed as if they were typed by a person. --endshelloutput: marks the end of a shell output --sleep : 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 : is drawn in huge letters. FIGlet is used to generate the huge letters. --sethugefont : If you use --huge FIGlet will use the specified to generate the huge letters. You will find the names of the available fonts in the figlet manual. --exec : executes . 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 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 License ------- ################################################################################################## # # # tpp - text presentation program # # Copyright (C) 2004-2005, 2007 Andreas Krennmair , Nico Golde # # # # 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 # # # ##################################################################################################