texlive[55257] Master/tlpkg/bin/tl-update-docindex: indent two

commits+karl at tug.org commits+karl at tug.org
Sun May 24 20:18:26 CEST 2020


Revision: 55257
          http://tug.org/svn/texlive?view=revision&revision=55257
Author:   karl
Date:     2020-05-24 20:18:25 +0200 (Sun, 24 May 2020)
Log Message:
-----------
indent two spaces, not four

Modified Paths:
--------------
    trunk/Master/tlpkg/bin/tl-update-docindex

Modified: trunk/Master/tlpkg/bin/tl-update-docindex
===================================================================
--- trunk/Master/tlpkg/bin/tl-update-docindex	2020-05-24 18:16:16 UTC (rev 55256)
+++ trunk/Master/tlpkg/bin/tl-update-docindex	2020-05-24 18:18:25 UTC (rev 55257)
@@ -20,15 +20,15 @@
 
 

 sub main {
-    my $tlpdb = TeXLive::TLPDB->new('root' => "$progdir/../..");
-    die "$progname: unable to load TLPDB\n" unless defined $tlpdb;
+  my $tlpdb = TeXLive::TLPDB->new('root' => "$progdir/../..");
+  die "$progname: unable to load TLPDB\n" unless defined $tlpdb;
 
-    print <<END_HEADER;
+  print <<END_HEADER;
 <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>
+<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>
 <h1>TeX Live documentation</h1>
 
@@ -44,118 +44,120 @@
 here.
 END_HEADER
 
-    print_all_pkg($tlpdb);
+  print_all_pkg($tlpdb);
 
-    # print footer
-    chomp (my $date = `LC_ALL=C date`);
-    print <<END_TRAILER;
+  # print footer
+  chomp (my $date = `LC_ALL=C date`);
+  print <<END_TRAILER;
 <hr>
 <small>Generated $date by $progname.</small>
 </body></html>
 END_TRAILER
 
-    return 0;
+  return 0;
 }
 
 

 # print the links for letters, then packages
+#
 sub print_all_pkg {
-    my ($tlpdb) = @_;
+  my ($tlpdb) = @_;
 
-    # @lines is the big list, @letters the list of initials of package names
-    local (@lines, @letters, $current_letter, $n);
-    $current_letter = "\0";
+  # @lines is the big list, @letters the list of initials of package names
+  local (@lines, @letters, $current_letter, $n);
+  $current_letter = "\0";
 
-    # 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.
-        next if $tlpn =~ /texlive-docindex/;
-        my $tlpkg = $tlpdb->get_package($tlpn);
-        push_pkg_list($tlpkg);
-    }
-    push @lines, "\n</ol>\n\n";
+  # first build the output and the list of initials
+  for my $tlpn (sort {lc $a cmp lc $b} $tlpdb->list_packages) {
+    # don't show our infra packages, just confusing:
+    next if $tlpn =~ /^00texlive\.|texlive-docindex/;
+    my $tlpkg = $tlpdb->get_package($tlpn);
+    push_pkg_list($tlpkg);
+  }
+  push @lines, "\n</ol>\n\n";
 
-    # then actually print them
-    my $access = "\n<p>" . join(" - ", @letters) . "</p>\n";
-    print $access;
-    print @lines;
-    print $access;
+  # then actually print them
+  my $access = "\n<p>" . join(" - ", @letters) . "</p>\n";
+  print $access;
+  print @lines;
+  print $access;
 }
 
 

 # push the content for a package to the list of lines
+#
 sub push_pkg_list {
-    my ($tlpkg) = @_;
-    my $name = $tlpkg->name;
-    my @docfiles = $tlpkg->docfiles;
+  my ($tlpkg) = @_;
+  my $name = $tlpkg->name;
+  my @docfiles = $tlpkg->docfiles;
 
-    # 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 specification.
-      my @runfiles = $tlpkg->runfiles;
-      @docfiles = grep { m/\.(html|pdf)/ } @runfiles;
-    }
+  # 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 specification.
+    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
+  # if no adequate documentation is found, print nothing
+  return if @docfiles == 0;
+  $n++; # list counter
 
-    # check initial
-    my $init = uc(substr($name, 0, 1));
-    unless ($init eq $current_letter) {
-        $current_letter = $init;
-        # put header in the big list...
-        push @lines, "\n</ol>\n" unless $n == 1;
-        push @lines, qq#\n<h2 id="letter-$init">$init</h2>\n#;
-        push @lines, qq#\n<ol start="$n">\n#;
-        # ... and a reference in quick access list
-        push @letters, qq!<a href="#letter-$init">$init</a>!;
-    }
+  # check initial
+  my $init = uc(substr($name, 0, 1));
+  unless ($init eq $current_letter) {
+    $current_letter = $init;
+    # put header in the big list...
+    push @lines, "\n</ol>\n" unless $n == 1;
+    push @lines, qq#\n<h2 id="letter-$init">$init</h2>\n#;
+    push @lines, qq#\n<ol start="$n">\n#;
+    # ... and a reference in quick access list
+    push @letters, qq!<a href="#letter-$init">$init</a>!;
+  }
 
-    # if there is an index.html file, drop the rest
-    # catches, e.g.: FAQ-en bosisio epspdf fontname jadetex
-    # metapost ppower4 sttools tds tex4ht
-    my @index = grep /\/index\.html/, @docfiles;
-    if (@index == 1) {
-        #warn "Using index.html for $name\n";
-        @docfiles = @index;
-    }
+  # if there is an index.html file, drop the rest
+  # catches, e.g.: FAQ-en bosisio epspdf fontname jadetex
+  # metapost ppower4 sttools tds tex4ht
+  my @index = grep /\/index\.html/, @docfiles;
+  if (@index == 1) {
+    #warn "Using index.html for $name\n";
+    @docfiles = @index;
+  }
 
-    # print package name with ctan link and shortdesc
-    my $id = qq!id="$name"!; # should be unique
-    my $dir = &find_doc_dir($name, @docfiles);
-    push @lines, qq#\n<li $id><b><a href="$dir">$name</a></b><small>\n#;
-    #
-    # Don't link to CTAN if the package doesn't exist.
-    # We could find more by looking at the .tlpsrc, but let's skip
-    # until someone notices. Except 12many works, and it's the very
-    # first one, so add that in.
-    my $lc_name = lc($name);
-    my $name1 = substr($name, 0, 1); # for Catalogue check
-    push @lines, qq#(<a href="https://ctan.org/pkg/$name">CTAN</a>):\n#
-      if -r "$CATALOGUE_DIR/$name1/$lc_name.xml" || $name eq "12many";
-    #
-    my $shortdesc = $tlpkg->shortdesc;
-    # a few shortdescs already end with a period:
-    $shortdesc =~ s/\.$// if defined $shortdesc;
-    #push @lines, "$shortdesc. \n" if defined $shortdesc;
-    push @lines, "$shortdesc\n" if defined $shortdesc;
-    #warn "$name\n" if not defined $shortdesc;
+  # print package name with ctan link and shortdesc
+  my $id = qq!id="$name"!; # should be unique
+  my $dir = &find_doc_dir($name, @docfiles);
+  push @lines, qq#\n<li $id><b><a href="$dir">$name</a></b><small>\n#;
+  #
+  # Don't link to CTAN if the package doesn't exist.
+  # We could find more by looking at the .tlpsrc, but let's skip
+  # until someone notices. Except 12many works, and it's the very
+  # first one, so add that in.
+  my $lc_name = lc($name);
+  my $name1 = substr($name, 0, 1); # for Catalogue check
+  push @lines, qq#(<a href="https://ctan.org/pkg/$name">CTAN</a>):\n#
+    if -r "$CATALOGUE_DIR/$name1/$lc_name.xml" || $name eq "12many";
+  #
+  my $shortdesc = $tlpkg->shortdesc;
+  # a few shortdescs already end with a period:
+  $shortdesc =~ s/\.$// if defined $shortdesc;
+  #push @lines, "$shortdesc. \n" if defined $shortdesc;
+  push @lines, "$shortdesc\n" if defined $shortdesc;
+  #warn "$name\n" if not defined $shortdesc;
 
-    # now the list of docfiles
-    my $list;
-    for my $file (@docfiles) {
-        my $name = basename($file);
-        $list .= qq#<a href="$file">$name</a>#;
-        my $dflanguage = $tlpkg->{'docfiledata'}{$file}{'language'};
-        $list .= " ($dflanguage) "
-                 if (defined $dflanguage && $dflanguage ne "en");
-        $list .= "\n";
-    }
-    $list =~ s/( )?\n$/./;
-    push @lines, "$list\n</small></li>\n";
+  # now the list of docfiles
+  my $list;
+  for my $file (@docfiles) {
+    my $name = basename($file);
+    $list .= qq#<a href="$file">$name</a>#;
+    my $dflanguage = $tlpkg->{'docfiledata'}{$file}{'language'};
+    $list .= " ($dflanguage) "
+             if (defined $dflanguage && $dflanguage ne "en");
+    $list .= "\n";
+  }
+  $list =~ s/( )?\n$/./;
+  push @lines, "$list\n</small></li>\n";
 }
 
 




More information about the tex-live-commits mailing list.