5
0
mirror of git://git.proxmox.com/git/pve-docs.git synced 2025-03-19 18:50:06 +03:00

scan-adoc-refs: allow to overwrite title using attribute

This commit is contained in:
Dietmar Maurer 2016-10-10 08:42:20 +02:00
parent 152b10fb37
commit edc73653fb

View File

@ -97,7 +97,13 @@ sub register_title {
$title =~ s!http://\S+\[(.*?)\]!$1!g;
$fileinfo->{titles}->{$env}->{$filename} = $title;
$fileinfo->{doctype}->{$env}->{$filename} = $doctype;
if (defined($doctype)) {
$fileinfo->{doctype}->{$env}->{$filename} = $doctype;
} else {
die "unable to change title (no doctype)"
if !defined($fileinfo->{doctype}->{$env}->{$filename});
}
}
sub scan_adoc_file {
@ -157,6 +163,10 @@ sub scan_adoc_file {
if !defined($title);
$fileinfo->{toplevel}->{$e}->{$filename} = 1;
}
} elsif ($key eq 'title') {
foreach my $e (@{$env_stack->[-1]}) {
register_title($filename, $e, undef, $value);
}
}
}