die "unable to change title (no doctype)"
if !defined($fileinfo->{doctype}->{$env}->{$filename});
}
+ } elsif (!defined($doctype)) {
+ # change title via :title: attribute
+ $fileinfo->{titles}->{$env}->{$filename} = $title;
+ }
- if (defined($doctype) && ($env eq 'manvolnum') && ($doctype == 0)) {
- if ($title =~ m/.*\(([1-8])\)\s*$/) {
- $fileinfo->{mansection}->{$env}->{$filename} = $1;
- }
+ if (defined($doctype) && ($env eq 'manvolnum') && ($doctype == 0)) {
+ if ($title =~ m/.*\(([1-8])\)\s*$/) {
+ $fileinfo->{mansection}->{$env}->{$filename} = $1;
}
}
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 not marked as manual page!" if !$mansection;
+ $realfn .= ".$mansection";
+ $fileinfo->{outfile}->{$e}->{$fn} = $realfn;
+ } elsif ($e eq 'default') {
+ my $realfn = $fn;
+ $realfn =~ s/\.adoc$//;
+ if (defined($mansection) && ($mansection == 5)) {
+ $realfn .= ".$mansection";
+ $realfn = "$realfn.html";
+ } else {
+ if (($fn ne 'pve-admin-guide.adoc') &&
+ $fileinfo->{doctype}->{$e}->{$fn} == 0) {
+ $realfn = "chapter-$realfn.html";
+ } else {
+ $realfn = "$realfn.html";
+ }
+ }
+ $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 = $fn;
- $realfn =~ s/\.adoc//;
- if (($realfn eq 'datacenter.cfg') || ($realfn eq 'qm.conf') || ($realfn eq 'pct.conf')) {
- $realfn .= ".5";
- } else {
- $realfn = "chapter-$realfn";
- }
- $realfn .= ".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;
}
}