]> git.proxmox.com Git - pve-docs.git/blobdiff - asciidoc-pve.in
update link qemu documentation non web.archive
[pve-docs.git] / asciidoc-pve.in
index 83f59ebb383cd4558ab0bebcb32e4b2811c62d6e..d638a382c85d4e792e862c8cfabd10f911370161 100644 (file)
@@ -146,7 +146,10 @@ sub replace_man_xref {
     die "xref: no text for man page link '$blockid'\n" if !$text;
 
     my $section = $fileinfo->{mansection}->{manvolnum}->{$link};
-    die "link target is not a manual page" if !defined($section);
+    if (!defined($section)) {
+       warn "link '$blockid' target '$link' is not a manual page, ignoring\n";
+       return "$text";
+    }
 
 
     if ($man_target eq 'html') {
@@ -300,7 +303,12 @@ sub compile_asciidoc {
 
     $leveloffset = - $doctype;
 
-    my $date = `date`;
+    my $date;
+    if (defined($ENV{SOURCE_DATE_EPOCH})) {
+       $date = `date -d "\@$ENV{SOURCE_DATE_EPOCH}"`;
+    } else {
+       $date = `date`;
+    }
     chomp $date;
 
     my $attributes = {
@@ -308,6 +316,7 @@ sub compile_asciidoc {
        leveloffset => $leveloffset,
        revnumber => $release,
        revdate => $date,
+       'footer-style' => 'revdate',
     };
 
     my $mansection = $fileinfo->{mansection}->{$env}->{$infile};
@@ -318,7 +327,7 @@ sub compile_asciidoc {
        $attributes->{manvolnum} = $mansection;
     } elsif ($env eq 'default') {
        die "$infile: wrong doctype\n" if $doctype != 0;
-       $attributes->{toc} = undef;
+       $attributes->{toc2} = undef;
     }
 
     if (!defined($outfile)) {
@@ -570,14 +579,14 @@ if ($clicmd eq 'compile-wiki') {
     my $data_str =  to_json($res_data, { pretty => 1,  canonical => 1 });
     chomp $data_str;
 
-    print "var pveOnlineHelpInfo = ${data_str};\n";
+    print "const pveOnlineHelpInfo = ${data_str};\n";
 
 } elsif ($clicmd eq 'chapter-table') {
-    
+
     print '[width="100%",options="header"]' . "\n";
     print "|====\n";
     print "|Title|Link\n";
-    
+
     my $filelist = $fileinfo->{outfile}->{default};
     foreach my $sourcefile (sort keys %$filelist) {
        my $target = $filelist->{$sourcefile};
@@ -586,16 +595,16 @@ if ($clicmd eq 'compile-wiki') {
            die "not title for '$sourcefile'";
        print "|$title|link:$target\[\]\n";
     }
-    
+
     print "|====\n";
 
 } elsif ($clicmd =~ m/^man([158])page-table$/) {
-    
+
     my $section = $1;
     print '[width="100%",cols="5*d",options="header"]' . "\n";
     print "|====\n";
     print "|Name 3+|Title|Link\n";
-    
+
     my $filelist = $fileinfo->{outfile}->{manvolnum};
     foreach my $manpage (sort keys %$filelist) {
        next if $section ne $fileinfo->{mansection}->{manvolnum}->{$manpage};
@@ -609,8 +618,8 @@ if ($clicmd eq 'compile-wiki') {
        
        my $target = $filelist->{$manpage};
        print "|$mantitle 3+|$title|link:$target.html\[$target\]\n";
-    }  
-    
+    }
+
     print "|====\n";
 
 } else {