X-Git-Url: https://git.proxmox.com/?p=pve-docs.git;a=blobdiff_plain;f=scan-adoc-refs;h=c3ac08f9b4c57623a98741588d6312f21829382f;hp=0dd4543c9ad730cb0ec51104568d8726bc22adbc;hb=5f09af76d7282a043be8fa5439349272f506cf02;hpb=58cc423cbad53de5fbc65db70e45e652d47add2f diff --git a/scan-adoc-refs b/scan-adoc-refs index 0dd4543..c3ac08f 100755 --- a/scan-adoc-refs +++ b/scan-adoc-refs @@ -129,10 +129,17 @@ sub scan_adoc_file { chomp $env_last_line->{$e}; } - # fixme: also scan <<>> - - while ($line =~ m/xref:([^\s\[\]]+)\[([^\]]*)\]/g) { - # print "$filename xref:$1 [$2]\n"; + if ($line =~ m/^:(\S+?):\s*(.*\S)?\s*$/) { + my ($key, $value) = ($1, $2); + if ($key eq 'pve-toplevel') { + + foreach my $e (@{$env_stack->[-1]}) { + my $title = $fileinfo->{titles}->{$e}->{$filename}; + die "not title for toplevel file '$filename' (env=$e)\n" + if !defined($title); + $fileinfo->{toplevel}->{$e}->{$filename} = 1; + } + } } if ($line =~ m/^\[\[(.*)\]\]\s*$/) {