14
This script generates man pages ready AsciiDoc document from the more
15
generic documents such as C<README.txt> or C<USAGE.txt>.
23
open my $in, "<", $filename
24
or die "Cannot open '$filename' for slurping - $!";
34
my ($readme_path, $usage_path, $out_path);
37
'readme=s' => \$readme_path,
38
'usage=s' => \$usage_path,
39
'output=s' => \$out_path,
41
or die "Cannot process arguments.";
43
my $readme = _slurp($readme_path);
44
my $usage = _slurp($usage_path);
46
$usage =~ s{\A.*?(^The programs *$)}{$1}ms;
48
my $manify_text = <<'EOF';
53
fc-solve - automated solver for Freecell and related Solitiare variants
56
my $man_title = 'fc-solve(6)';
58
$readme =~ s/\AFreecell Solver Readme File\n(=+)\n/
59
$man_title . "\n" . '=' x length($man_title) . "\n"/ge;
60
$readme =~ s/(:Revision[^\n]*\n)/$1$manify_text/ms;
62
open my $out, '>', $out_path;
63
print {$out} $readme, "\n\n", $usage;
66
=head1 COPYRIGHT AND LICENSE
68
Copyright (c) 2000 Shlomi Fish
70
Permission is hereby granted, free of charge, to any person
71
obtaining a copy of this software and associated documentation
72
files (the "Software"), to deal in the Software without
73
restriction, including without limitation the rights to use,
74
copy, modify, merge, publish, distribute, sublicense, and/or sell
75
copies of the Software, and to permit persons to whom the
76
Software is furnished to do so, subject to the following
79
The above copyright notice and this permission notice shall be
80
included in all copies or substantial portions of the Software.
82
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
83
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
84
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
85
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
86
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
87
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
88
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
89
OTHER DEALINGS IN THE SOFTWARE.