X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=techtalk-pse.pl;h=5f5b6882886f8040869b46ea288cb1dbc142dfd0;hb=982d6da5d4d71196ee5cb626dcc7d770fd94f2ea;hp=ae8a9c9a1230113a245d7f3441f2c08d6955363a;hpb=ccd8fffc4ae378f86dc399ea6eefec2f7f9ad8ed;p=techtalk-pse.git
diff --git a/techtalk-pse.pl b/techtalk-pse.pl
index ae8a9c9..5f5b688 100755
--- a/techtalk-pse.pl
+++ b/techtalk-pse.pl
@@ -67,10 +67,38 @@ there is a discussion on L.
=head1 RUNNING THE TOOL FROM THE COMMAND LINE
-A Tech Talk PSE talk is not a single file, but a directory full of
-files. (If you want to start a new talk, see the L section
-below). To display or run the talk, change into the directory
-containing all those files and run the C command:
+=head2 CREATING A NEW TALK
+
+Tech Talk PSE talks are just directories containing C<*.html> and
+C<*.sh> (shell script) files:
+
+ 0010-introduction.html
+ 0500-demonstration.sh
+ 9900-conclusion.html
+
+The filenames that Tech Talk PSE considers to be slides have to match
+the regular expression:
+
+ ^(\d+)(?:-.*)\.(html|sh)$
+
+(any other file or subdirectory is ignored). Shell scripts I
+be executable.
+
+You can create a new talk just by creating an empty directory and
+adding files as above, but you can also create a useful skeleton talk
+like this:
+
+ mkdir talk
+ cd talk
+ techtalk-pse --new
+
+The C<--new> flag will refuse to overwrite any existing files, so you
+should run it in an empty directory.
+
+=head2 DISPLAYING AN EXISTING TALK
+
+To display or run a talk, change into the directory containing all
+those files and run the C command:
cd /path/to/talk/; techtalk-pse
@@ -103,6 +131,16 @@ You cannot use this with the B<-n> / B<--start> option.
=cut
+my $new;
+
+=item B<--new>
+
+Create a new outline talk in an empty directory.
+
+This refuses to overwrite existing files.
+
+=cut
+
my $start;
=item B<-n SLIDE> | B<--start SLIDE>
@@ -143,15 +181,12 @@ Display version number and exit.
=cut
my $mozembed;
-my $mozembed_first;
-my $mozembed_last;
GetOptions ("help|?" => \$help,
"last" => \$last,
"mozembed" => \$mozembed,
- "mozembed-first" => \$mozembed_first,
- "mozembed-last" => \$mozembed_last,
"n=s" => \$start,
+ "new" => \$new,
"splash!" => \$splash,
"start=s" => \$start,
"verbose" => \$verbose,
@@ -170,11 +205,7 @@ if ($version) {
die "techtalk-pse: cannot use --start and --last options together\n"
if defined $last && defined $start;
-# Run with --mozembed: see below.
-run_mozembed () if $mozembed;
-
-# Normal run of the program.
-die "techtalk-pse: too many arguments\n" if @ARGV >= 2;
+die "techtalk-pse: too many arguments\n" if !$mozembed && @ARGV >= 2;
# Get the true name of the program.
$0 = abs_path ($0);
@@ -191,6 +222,149 @@ if (@ARGV > 0) {
}
}
+# Get the talk directory and set environment variable $talkdir
+# which is inherited by all the scripts.
+my $talkdir = getcwd;
+$ENV{talkdir} = $talkdir;
+
+# Create a new talk (--new flag).
+if ($new) {
+ my %files = (
+ "essay.txt" => {
+ mode => 0644,
+ desc => "essay and background notes",
+ c => 'Start by writing your thoughts in this file as an essay.
+
+You can then provide this as extra background reading material
+for your audience after the talk.'
+ },
+
+ "0010-introduction.html" => {
+ mode => 0644,
+ desc => "title slide",
+ c => '
+
+
+