]>
git.proxmox.com Git - pve-docs.git/blob - gen-index-includes.pl
9 my $fh = IO
::File-
>new("link-refs.json", "r") ||
10 die "unable to open 'link-refs.json' - $!\n";
13 while (<$fh>) { $data_str .= $_; }
14 my $fileinfo = decode_json
($data_str);
18 die "missing command name" if !$cmd;
19 die "too many arguments" if scalar(@ARGV);
22 #print Dumper($fileinfo);
24 if ($cmd eq 'chapter-table') {
25 print '[width="100%",options="header"]' . "\n";
27 print "|Title|Link\n";
28 my $filelist = $fileinfo->{outfile
}->{default};
29 foreach my $sourcefile (sort keys %$filelist) {
30 my $target = $filelist->{$sourcefile};
31 next if $target eq 'pve-admin-guide.html';
32 my $title = $fileinfo->{titles
}->{default}->{$sourcefile} ||
33 die "not title for '$sourcefile'";
34 print "|$title|link:$target\[\]\n";
38 } elsif ($cmd =~ m/^man([158])page-table$/) {
40 print '[width="100%",cols="5*d",options="header"]' . "\n";
42 print "|Name 3+|Title|Link\n";
43 my $filelist = $fileinfo->{outfile
}->{manvolnum
};
44 foreach my $manpage (sort keys %$filelist) {
45 next if $section ne $fileinfo->{mansection
}->{manvolnum
}->{$manpage};
46 my $mantitle = $fileinfo->{titles
}->{manvolnum
}->{$manpage} ||
47 die "not manual title for '$manpage'";
48 my $title = $fileinfo->{titles
}->{default}->{$manpage} ||
49 die "not title for '$manpage'";
51 # hack - remove command name prefix from titles
52 $title =~ s/^[a-z]+\s*-\s*//;
54 my $target = $filelist->{$manpage};
55 print "|$mantitle 3+|$title|link:$target.html\[$target\]\n\n";
59 die "unknown command '$cmd'\n";