mirror of
https://git.proxmox.com/git/pve-docs
synced 2025-04-28 17:49:53 +00:00
scan-adoc-refs: improve title parser, store doctype
We store the titel heading level (0 => chapter, 1 => article).
This commit is contained in:
parent
508e00124c
commit
0142692aed
@ -122,9 +122,20 @@ sub scan_adoc_file {
|
||||
my $title = $fileinfo->{titles}->{$e}->{$filename};
|
||||
next if defined($title);
|
||||
|
||||
if (($line =~ m/^=====+/) || ($line =~ m/^-----+/)) {
|
||||
if ($line =~ m/^=====+$/) {
|
||||
$fileinfo->{titles}->{$e}->{$filename} = $env_last_line->{$e};
|
||||
$fileinfo->{doctype}->{$e}->{$filename} = 0;
|
||||
} elsif ($line =~ m/^-----+$/) {
|
||||
$fileinfo->{titles}->{$e}->{$filename} = $env_last_line->{$e};
|
||||
$fileinfo->{doctype}->{$e}->{$filename} = 1;
|
||||
} elsif ($line =~ m/^= +(\S.*?)( +=)?$/) {
|
||||
$fileinfo->{titles}->{$e}->{$filename} = $1;
|
||||
$fileinfo->{doctype}->{$e}->{$filename} = 0;
|
||||
} elsif ($line =~ m/^== +(\S.*?)( +==)?$/) {
|
||||
$fileinfo->{titles}->{$e}->{$filename} = $1;
|
||||
$fileinfo->{doctype}->{$e}->{$filename} = 1;
|
||||
}
|
||||
|
||||
$env_last_line->{$e} = $line;
|
||||
chomp $env_last_line->{$e};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user