USAGE | 3 +++ swg | 29 ++++++++++++++++++++--------- diff --git a/USAGE b/USAGE index ec4614d840b4bccf4dae708dfa5dd514ac35b58ae14dd718e33b84ca094c2df3..f2b36499090b5424c6c44fad8b6de5f6049af397fc8fa6ea7c44607a9b81005f 100644 --- a/USAGE +++ b/USAGE @@ -25,5 +25,8 @@ If $SWG_PRINT_MISSING environment variable is set, then warning will be print for links leading to non-existent pages. +If $SWG_DO_SRC=0 environment variable is set, then no links and source +pages will be generated. Pure HTML output. + How to forcefully change the title of the generated HTML page? Use sed/perl to replace "
END_HTML
+;
}
my $indent = q{};
my sub procline;
@@ -508,11 +515,13 @@ my $fn;
foreach my $cat (keys %CatFiles) {
make_path "$ARGV[1]/$cat";
next if (exists $Mtimes{"${cat}index"});
- $fn = "$ARGV[1]/${cat}index.txt";
- open $fh, q{>:encoding(UTF-8)}, $fn or croak "$!";
- genIndex $fh, $cat;
- close $fh or croak "$!";
- utime $now, $now, $fn;
+ if ($DoSrc) {
+ $fn = "$ARGV[1]/${cat}index.txt";
+ open $fh, q{>:encoding(UTF-8)}, $fn or croak "$!";
+ genIndex $fh, $cat;
+ close $fh or croak "$!";
+ utime $now, $now, $fn;
+ }
$fn = "$ARGV[1]/${cat}index.html";
open $fh, q{>:encoding(UTF-8)}, $fn or croak "$!";
genHTML $fh, $cat, genIndex2Buf $cat;
@@ -531,8 +540,10 @@ utime $now, $now, "$ARGV[1]/$pth.html";
} else {
utime $mtime, $mtime, "$ARGV[1]/$pth.html";
}
- copy $pth, "$ARGV[1]/$pth.txt" or croak "$!";
- utime $mtime, $mtime, "$ARGV[1]/$pth.txt";
+ if ($DoSrc) {
+ copy $pth, "$ARGV[1]/$pth.txt" or croak "$!";
+ utime $mtime, $mtime, "$ARGV[1]/$pth.txt";
+ }
}
} elsif ($ARGV[0] eq q{info}) {
print "Autogenerated by swg $VERSION\n";