pvelogo => 0, # ignore
};
-my $fileinfo = {};
+my $fileinfo = {
+ outfile => {
+ default => {
+ "pve-admin-guide.adoc" => "pve-admin-guide.html",
+ "datacenter.cfg.adoc" => "datacenter.cfg.5.html",
+ "ha-manager.adoc" => "chapter-ha-manager.html",
+ "pct.adoc" => "chapter-pct.html",
+ "pve-bibliography.adoc" => "chapter-pve-bibliography.html",
+ "pve-firewall.adoc" => "chapter-pve-firewall.html",
+ "pve-installation.adoc" => "chapter-pve-installation.html",
+ "pvecm.adoc" => "chapter-pvecm.html",
+ "pvesm.adoc" => "chapter-pvesm.html",
+ "pveum.adoc" => "chapter-pveum.html",
+ "qm.adoc" => "chapter-qm.html",
+ "sysadmin.adoc" => "chapter-sysadmin.html",
+ "vzdump.adoc" => "chapter-vzdump.html",
+ "pmxcfs.adoc" => "chapter-pmxcfs.html",
+ "pve-faq.adoc" => "chapter-pve-faq.html",
+ },
+ },
+};
my $start_env = [];
foreach my $e (keys %$environments) {
while ($repeat) {
$repeat = 0;
foreach my $fn (keys %$include_hash) {
- next if $fn eq 'pve-admin-guide.adoc';
if ($include_hash->{$fn}->{$filename}) {
+ next if ($fn eq 'pve-admin-guide.adoc') &&
+ $fileinfo->{outfile}->{$env}->{$filename};
$filename = $fn;
$repeat = 1;
last;
return $filename;
}
+
+# try to generate output file mapping
+foreach my $e (@$start_env) {
+ my $toplevel_hash = $fileinfo->{toplevel}->{$e};
+ foreach my $fn (sort keys %$toplevel_hash) {
+ my $mansection = $fileinfo->{mansection}->{manvolnum}->{$fn};
+ if ($e eq 'wiki') {
+ my $realfn = $fn;
+ $realfn =~ s/\.adoc$//;
+ if (defined($mansection) && ($mansection == 5)) {
+ $realfn .= ".$mansection";
+ }
+ $realfn = "$realfn-plain.html";
+ $fileinfo->{outfile}->{$e}->{$fn} = $realfn;
+ } elsif ($e eq 'manvolnum') {
+ my $realfn = $fn;
+ $realfn =~ s/\.adoc$//;
+ die "toplevel file '$fn' is marhes as manual page!" if !$mansection;
+ $realfn .= ".$mansection";
+ $fileinfo->{outfile}->{$e}->{$fn} = $realfn;
+ }
+ }
+}
+
# now resolve blockids
foreach my $e (@$start_env) {
my $blockid_hash = $fileinfo->{blockid}->{$e};
$title =~ s/\s/_/g;
die "found not title for '$fn' in env '$e'" if !$title;
$fileinfo->{blockid_target}->{$e}->{$blockid} = "link:/wiki/$title#$blockid";
+
+ # we do not produce wiki pages for all content
+ #my $realfn = $fileinfo->{outfile}->{$e}->{$fn};
+ #warn "no output file mapping for '$fn' ($e)\n" if !$realfn;
+
} elsif ($e eq 'default') {
- my $realfn = "chapter-$fn";
- $realfn =~ s/\.adoc/.html/;
+ my $realfn = $fileinfo->{outfile}->{$e}->{$fn} ||
+ die "no output file mapping for '$fn'\n";
$fileinfo->{blockid_target}->{$e}->{$blockid} = "link:/pve-docs/$realfn#$blockid";
- } else {
+ } elsif ($e eq 'manvolnum') {
+ # we do not produce manpages for all content
+ # my $realfn = $fileinfo->{outfile}->{$e}->{$fn} ||
+ # warn "no output file mapping for '$fn'\n";
$fileinfo->{blockid_target}->{$e}->{$blockid} = $fn;
}
}