diff options
Diffstat (limited to 'Master/tlpkg/bin/tl-update-docindex')
-rwxr-xr-x | Master/tlpkg/bin/tl-update-docindex | 37 |
1 files changed, 26 insertions, 11 deletions
diff --git a/Master/tlpkg/bin/tl-update-docindex b/Master/tlpkg/bin/tl-update-docindex index 102ba619227..d2568aaefff 100755 --- a/Master/tlpkg/bin/tl-update-docindex +++ b/Master/tlpkg/bin/tl-update-docindex @@ -21,19 +21,24 @@ sub main { die "$progname: unable to load TLPDB\n" unless defined $tlpdb; print <<END_HEADER; -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head> +<html><head> <title>TeX Live documentation</title> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> + <meta name="viewport" content="width=device-width,initial-scale=1"> <style type="text/css"> ol { padding-left: 4em } </style> -</head> -<body> +</head><body> <h1>TeX Live documentation</h1> <p>This document lists links to all HTML and PDF files for packages and guides -contained in <a href="https://tug.org/texlive/">TeX Live</a>, sorted by -package name.</p> +contained in <a href="https://tug.org/texlive/">TeX Live</a> (<a +href="https://tug.org/texlive/doc.html">TL documentation web page), +sorted by package name.</p> + +<p>For documentation on TeX Live itself, see the <a +href="#texlive-en">texlive-en</a> package below and its several nearby +translations, as well as the <a href="#texlive.infra">texlive.infra</a> +package. There are also links from the <a href=".">index.html</a> page +here. END_HEADER print_all_pkg($tlpdb); @@ -41,7 +46,7 @@ END_HEADER # print footer chomp (my $date = `LC_ALL=C date`); print <<END_TRAILER; -<hr /> +<hr> <small>Generated $date by $progname.</small> </body></html> END_TRAILER @@ -59,6 +64,7 @@ sub print_all_pkg { # first build the output and the list of initials for my $tlpn (sort {lc $a cmp lc $b} $tlpdb->list_packages) { + next if $tlpn =~ /^00texlive\./; # don't bother with infra packages. my $tlpkg = $tlpdb->get_package($tlpn); push_pkg_list($tlpkg); } @@ -77,8 +83,16 @@ sub push_pkg_list { my $name = $tlpkg->name; my @docfiles = $tlpkg->docfiles; - # if no adequate documentation is found, print nothing + # almost always the documentation is in doc, where it should be. @docfiles = grep { m/\.(html|pdf)/ } @docfiles; + if (@docfiles == 0) { + # but in one notable case, koma-script, it is in runfiles, + # per the author's request/requirement. + my @runfiles = $tlpkg->runfiles; + @docfiles = grep { m/\.(html|pdf)/ } @runfiles; + } + + # if no adequate documentation is found, print nothing return if @docfiles == 0; $n++; # list counter @@ -105,7 +119,8 @@ sub push_pkg_list { # print package name with shortdesc my $dir = dirname($docfiles[0]); - push @lines, qq#\n<li><b><a href="$dir">$name</a></b><small>\n#; + my $id = qq!id="$name"!; # should be unique + push @lines, qq#\n<li $id><b><a href="$dir">$name</a></b><small>\n#; push @lines, qq#(<a href="https://ctan.org/pkg/$name">CTAN</a>):\n#; my $shortdesc = $tlpkg->shortdesc; push @lines, "$shortdesc\n" if defined $shortdesc; |