X-Git-Url: https://git.proxmox.com/?p=pve-docs.git;a=blobdiff_plain;f=asciidoc-pve.in;h=d1a754d5a0f5034d15e4f95a4287d4065b12c1c8;hp=83a6c5c33f9d42872041936205702b0f554d5694;hb=5c683f1378826ae38e706d8923f953c7392e1324;hpb=ae0ad291e143fee80defd6d1f2428f85911b52f4 diff --git a/asciidoc-pve.in b/asciidoc-pve.in index 83a6c5c..d1a754d 100644 --- a/asciidoc-pve.in +++ b/asciidoc-pve.in @@ -23,7 +23,7 @@ while () { $data_str .= $_; } my $fileinfo = decode_json($data_str); -my $tmpprefix = ".asciidoc-pve-tmp_"; +my $tmpprefix = '.asciidoc-pve-tmp'.$$.'_'; my $adoc_source_dir = "/usr/share/pve-doc-generator"; @@ -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};