]> git.proxmox.com Git - pve-docs.git/blobdiff - scan-adoc-refs
mark toplevel docs
[pve-docs.git] / scan-adoc-refs
index 0dd4543c9ad730cb0ec51104568d8726bc22adbc..c3ac08f9b4c57623a98741588d6312f21829382f 100755 (executable)
@@ -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*$/) {