]> git.proxmox.com Git - pmg-docs.git/blobdiff - asciidoc-pmg.in
asciidoc: minimally update derived docbook conf templates to work with python333
[pmg-docs.git] / asciidoc-pmg.in
index e473d8bcfa4277009ebde62f6b40e94eaf736816..532ea7fd0ba317b559cc8939bbb24ff8ae48e369 100644 (file)
@@ -45,11 +45,11 @@ my $online_help_links = {
     },
     'pmg_documentation_index' => {
        link => '/pmg-docs/index.html',
-       title => 'Proxmox VE Documentation Index',
+       title => 'Proxmox Mail Gateway Documentation Index',
     },
     'pmg_admin_guide' => {
        link => '/pmg-docs/pmg-admin-guide.html',
-       title => 'Proxmox VE Administration Guide',
+       title => 'Proxmox Mail Gateway Administration Guide',
     },
 };
 
@@ -146,7 +146,11 @@ 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);
+    # 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') {
@@ -319,6 +323,7 @@ sub compile_asciidoc {
     } elsif ($env eq 'default') {
        die "$infile: wrong doctype\n" if $doctype != 0;
        $attributes->{toc} = undef;
+       $attributes->{toc2} = undef;
     }
 
     if (!defined($outfile)) {
@@ -456,7 +461,7 @@ sub scan_extjs_file {
     debug("scan-extjs $filename");
 
     while(defined(my $line = <$fh>)) {
-       if ($line =~ m/\s+onlineHelp:\s*[\'\"](.*?)[\'\"]/) {
+       if ($line =~ m/(?:\s+|Utils\.)onlineHelp(?:Tool)?[:(]\s*[\'\"](.*?)[\'\"]/) {
            my $blockid = $1;
            my $link = $fileinfo->{blockid_target}->{default}->{$blockid};
            die "undefined blockid '$blockid' ($filename, line $.)\n"
@@ -570,7 +575,7 @@ if ($clicmd eq 'compile-wiki') {
     my $data_str =  to_json($res_data, { pretty => 1,  canonical => 1 });
     chomp $data_str;
 
-    print "var pmgOnlineHelpInfo = ${data_str};\n";
+    print "const proxmoxOnlineHelpInfo = ${data_str};\n";
 
 } elsif ($clicmd eq 'chapter-table') {
     
@@ -605,7 +610,7 @@ if ($clicmd eq 'compile-wiki') {
            die "not title for '$manpage'";
 
        # hack - remove command name prefix from titles
-       $title =~ s/^[a-z]+\s*-\s*//;
+       $title =~ s/^[a-z_\-]+\s+-\s*//;
        
        my $target = $filelist->{$manpage};
        print "|$mantitle 3+|$title|link:$target.html\[$target\]\n";