mirror of
https://git.openafs.org/openafs.git
synced 2025-01-19 15:30:14 +00:00
85bb872e3d
a bit convoluted but this generates docbook from the pod documentation and from that pdf, epub and mobi versions. we are using variablelist.as.block since that looks prettier on smaller devices/screen. Change-Id: I5cd51ef10448373960a0aeed15212bbcf6f44039 Change-Id: Ib222dbfa30e3af644b1dbc6738df1d39cc33c92f Reviewed-on: http://gerrit.openafs.org/5255 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@dementix.org>
38 lines
1.0 KiB
Perl
Executable File
38 lines
1.0 KiB
Perl
Executable File
#!/usr/bin/perl
|
|
eval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
|
|
if $running_under_some_shell;
|
|
|
|
@sections = ('1', '5', '8');
|
|
|
|
$TOP_SRCDIR = shift @ARGV;
|
|
$doc_man_pages = sprintf "%s/../doc/man-pages", $TOP_SRCDIR;
|
|
|
|
open(ENTITIES, ">entities.dtd") || die;
|
|
|
|
foreach $section (@sections) {
|
|
printf "generating section %s...\n", $section;
|
|
|
|
mkdir(sprintf "sect%d", $section);
|
|
opendir($DIR, sprintf "%s/pod%d", $doc_man_pages, $section) || die;
|
|
open(SECT, sprintf ">sect%d.xml", $section) || die;
|
|
while ($podfile = readdir($DIR)) {
|
|
next unless $podfile =~ /\.pod$/;
|
|
|
|
($xmlfile = $podfile) =~ s/\.pod$/.xml/;
|
|
($entity = $xmlfile) =~ s/\.xml$//;
|
|
|
|
printf "pod2refentry < %s > %s\n", $podfile, $xmlfile;
|
|
|
|
system(sprintf "./pod2refentry --section=%d < %s/pod%d/%s > sect%d/%s",
|
|
$section, $doc_man_pages, $section, $podfile, $section, $xmlfile);
|
|
|
|
printf ENTITIES "<!ENTITY %s%s SYSTEM \"sect%d/%s\">\n",
|
|
$entity, $section, $section, $xmlfile;
|
|
printf SECT "&%s%s;\n", $entity, $section;
|
|
}
|
|
closedir($DIR);
|
|
close(SECT);
|
|
}
|
|
|
|
close(ENTITIES);
|