6 # Copyright (C) 2010 Red Hat Inc.
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 use Cwd qw(getcwd abs_path);
29 use Glib qw(TRUE FALSE);
37 techtalk-pse - superior technical demonstration software
41 cd /path/to/talk/; techtalk-pse
43 techtalk-pse /path/to/talk/
47 Tech Talk "Platinum Supreme Edition" (PSE) is Linux Presentation
48 Software designed by technical people to give technical software
49 demonstrations to other technical people. It is designed to be simple
50 to use (for people who know how to use an editor and the command line)
51 and powerful, so that you can create informative, technically accurate
52 and entertaining talks and demonstrations.
54 Tech Talk PSE is good at opening editors at the right place, opening
55 shell prompts with preloaded history, compiling and running things
56 during the demonstration, displaying text, photos, figures and video.
58 Tech Talk PSE is I<bad> at slide effects, chart junk and bullet
61 This manual page covers all the documentation you will need to use
62 Tech Talk PSE. The next section covers running the tool from the
63 command line. After that there is a L</TUTORIAL> section to get you
64 started. Then there is a detailed L</REFERENCE> section. Finally
65 there is a discussion on L<WHAT MAKES A GOOD TALK>.
67 =head1 RUNNING THE TOOL FROM THE COMMAND LINE
69 A Tech Talk PSE talk is not a single file, but a directory full of
70 files. (If you want to start a new talk, see the L</TUTORIAL> section
71 below). To display or run the talk, change into the directory
72 containing all those files and run the C<techtalk-pse> command:
74 cd /path/to/talk/; techtalk-pse
76 You can also run C<techtalk-pse> without changing directory, instead
77 specifying the path to the talk:
79 techtalk-pse /path/to/talk/
91 Display brief help and exit.
99 Start at the last slide.
101 You cannot use this with the B<-n> / B<--start> option.
107 =item B<-n SLIDE> | B<--start SLIDE>
109 Start at the named slide. I<SLIDE> is the shortest unique prefix of
110 the slide name, so to start at a slide named
111 I<00010-introduction.html>, you could use I<-n 00010> or I<-n 00010-intro>,
112 or give the full filename I<-n 00010-introduction.html>.
114 The default is to start at the first slide in the talk.
122 Don't display the initial "splash" screen which advertises Tech Talk
123 PSE to your audience. Just go straight into the talk.
131 Display verbose messages, useful for debugging or tracing
132 what the program is doing.
140 Display version number and exit.
146 GetOptions ("help|?" => \$help,
148 "mozembed" => \$mozembed,
150 "splash!" => \$splash,
151 "start=s" => \$start,
152 "verbose" => \$verbose,
153 "version" => \$version,
160 pod2usage (1) if $help;
162 print "@PACKAGE@ @VERSION@\n";
165 die "techtalk-pse: cannot use --start and --last options together\n"
166 if defined $last && defined $start;
168 # --mozembed runs Gtk2::MozEmbed as a subprocess, because MozEmbed
171 my $w = Gtk2::Window->new ();
172 my $moz = Gtk2::MozEmbed->new ();
174 $w->signal_connect (delete_event => sub {
179 $w->set_default_size (600, 400);
182 $moz->load_url ($ARGV[0]);
188 die "techtalk-pse: too many arguments\n" if @ARGV >= 2;
190 # Get the true name of the program.
197 chdir $d or die "techtalk-pse: chdir: $d: $!";
199 # XXX In future allow people to specify an archive and unpack
201 die "techtalk-pse: argument is not a directory"
214 foreach (glob ("*")) {
215 if (/^(\d+)([A-Z])?(?:-.*)\.(html|sh)$/) {
216 print STDERR "reading $_\n" if $verbose;
221 warn "techtalk-pse: $_: command file is not executable (+x)\n"
222 if $ext eq "sh" && ! -x $_;
224 my $h = { name => $_, seq => $1, pos => $2, ext => $3 };
228 $groups{$seq} = [] unless exists $groups{$seq};
229 push @{$groups{$seq}}, $h;
231 print STDERR "ignoring $_\n" if $verbose;
236 print STDERR "read ", 0+@files, " files\n" if $verbose;
238 warn "techtalk-pse: no files found, continuing anyway ...\n"
241 # Work out what slide we're starting on.
243 if (defined $current) {
244 die "start slide not implemented yet XXX"
247 $current = $files[0];
249 # else $current is undefined
252 my $w = Gtk2::AboutDialog->new;
253 $w->set_authors ("Richard W.M. Jones");
255 "Superior technical demonstration software\n".
258 "↑ — Go back one slide\n".
259 "↓ — Go forward one slide\n"
261 $w->set_program_name ("Tech Talk Platinum Supreme Edition (PSE)");
262 $w->set_version ("@VERSION@");
263 $w->set_website ("http://people.redhat.com/~rjones");
264 $w->set_license ("GNU General Public License v2 or above");
265 $w->signal_connect (destroy => sub { Gtk2->main_quit });
272 if (defined $current) {
273 my $go = show_slide ($current);
274 if (defined $go && ($go eq "PREV" || $go eq "NEXT")) {
275 print STDERR "go = $go\n" if $verbose;
279 last FOUND if $files[$i]->{name} eq $current->{name};
282 die "internal error: cannot find \$current in \@files"
284 print STDERR "found current entry at i = $i\n" if $verbose;
285 $i-- if $go eq "PREV" && $i > 0;
286 $i++ if $go eq "NEXT" && $i+1 < @files;
287 $current = $files[$i];
290 print "No slides found. Press any key to reload directory ...\n";
296 if (defined $current && !exists $files{$current->{name}}) {
297 # Current slide was deleted.
299 $current = $files[0] if @files;
306 if ($slide->{ext} eq "html") {
307 # MozEmbed is incredibly crashy, so we run ourself as a
308 # subprocess, so when it segfaults we don't care.
310 my $url = "file://" . $cwd . "/" . $slide->{name};
311 my @cmd = ($0, "--mozembed", $url);
313 die "failed to execute subcommand: $!\n" if $? == -1;
315 # Subcommand probably segfaulted, just continue to next slide.
328 elsif ($slide->{ext} eq "sh") {
329 system ("PATH=.:\$PATH " . $slide->{name});
340 =head1 WHAT MAKES A GOOD TALK
344 The Cognitive Style of PowerPoint, Tufte, Edward R.
348 Richard W.M. Jones L<http://people.redhat.com/~rjones/>
352 Copyright (C) 2010 Red Hat Inc.
354 This program is free software; you can redistribute it and/or modify
355 it under the terms of the GNU General Public License as published by
356 the Free Software Foundation; either version 2 of the License, or
357 (at your option) any later version.
359 This program is distributed in the hope that it will be useful,
360 but WITHOUT ANY WARRANTY; without even the implied warranty of
361 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
362 GNU General Public License for more details.
364 You should have received a copy of the GNU General Public License
365 along with this program; if not, write to the Free Software
366 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.