mirror of
https://git.proxmox.com/git/pve-docs
synced 2025-08-14 10:37:51 +00:00
scan-adoc-refs: allow to overwrite title using attribute
This commit is contained in:
parent
152b10fb37
commit
edc73653fb
@ -97,7 +97,13 @@ sub register_title {
|
|||||||
$title =~ s!http://\S+\[(.*?)\]!$1!g;
|
$title =~ s!http://\S+\[(.*?)\]!$1!g;
|
||||||
|
|
||||||
$fileinfo->{titles}->{$env}->{$filename} = $title;
|
$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 {
|
sub scan_adoc_file {
|
||||||
@ -157,6 +163,10 @@ sub scan_adoc_file {
|
|||||||
if !defined($title);
|
if !defined($title);
|
||||||
$fileinfo->{toplevel}->{$e}->{$filename} = 1;
|
$fileinfo->{toplevel}->{$e}->{$filename} = 1;
|
||||||
}
|
}
|
||||||
|
} elsif ($key eq 'title') {
|
||||||
|
foreach my $e (@{$env_stack->[-1]}) {
|
||||||
|
register_title($filename, $e, undef, $value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user