doc/fr/search/atoz.pl
Stephane Legrand 863912c451 New translations.
fr/prstats/index.sgml: MFen 1.5
  fr/releng/index.sgml: MFen 1.5
  fr/releases/2.0/credits.sgml: MFen 1.5
  fr/releases/2.2.8R/notes.sgml: MFen 1.6 (incomplete translation)
  fr/releases/3.1R/notes.sgml: MFen 1.5 (incomplete translation)
  fr/releases/3.2R/notes.sgml: MFen 1.5 (incomplete translation)
  fr/releases/3.3R/notes.sgml: MFen 1.4 (incomplete translation)
  fr/releases/3.4R/notes.sgml: MFen 1.2 (incomplete translation)
  fr/releases/3.5R/notes.sgml: MFen 1.4 (incomplete translation)
  fr/releases/4.0R/notes.sgml: MFen 1.4 (incomplete translation)
  fr/releases/4.0R/errata.sgml: MFen 1.5
  fr/releases/4.0R/announce.sgml: MFen 1.3
  fr/releases/4.1.1R/errata.sgml: MFen 1.2
  fr/releases/4.1R/notes.sgml: MFen 1.3 (incomplete translation)
  fr/releases/4.1R/errata.sgml: MFen 1.3
  fr/releases/4.1R/announce.sgml: MFen 1.3
  fr/releases/4.2R/notes.sgml: MFen 1.2 (incomplete translation)
  fr/releases/4.2R/errata.sgml: MFen 1.2
  fr/releases/4.2R/announce.sgml: MFen 1.2
  fr/releases/4.3R/announce.sgml: MFen 1.2
  fr/releases/4.3R/errata.sgml: MFen 1.18
  fr/releases/4.3R/notes.sgml: MFen 1.3
  fr/releases/4.4R/announce.sgml: MFen 1.4
  fr/releases/4.4R/docbook.css: MFen 1.4
  fr/releases/4.5R/docbook.css: MFen 1.4
  fr/releases/4.5R/notes.sgml: MFen 1.2
  fr/releases/4.5R/announce.sgml: MFen 1.2
  fr/releases/4.5R/relnotes-i386.html: MFen 1.22.2.192
  fr/releases/4.5R/relnotes-alpha.html: MFen 1.22.2.192
  fr/releases/4.5R/errata.html: MFen 1.1.2.52
  fr/releases/4.6.2R/relnotes.sgml: MFen 1.1
  fr/releases/4.6.2R/relnotes-i386.html: MFen 1.22.2.249.2.13
  fr/releases/4.6.2R/relnotes-alpha.html: MFen 1.22.2.249.2.13
  fr/releases/4.6.2R/docbook.css: MFen 1.4
  fr/releases/4.6R/relnotes.sgml: MFen 1.1
  fr/releases/4.6R/relnotes-i386.html: MFen 1.22.2.249
  fr/releases/4.6R/relnotes-alpha.html: MFen 1.22.2.249
  fr/releases/4.6R/docbook.css: MFen 1.4
  fr/releases/4.7R/hardware-i386.html: MFen 1.13.2.68
  fr/releases/4.7R/hardware-alpha.html: MFen 1.13.2.68
  fr/releases/4.7R/errata.html: MFen 1.1.2.87
  fr/releases/4.7R/docbook.css: MFen 1.1
  fr/releases/4.7R/announce.sgml: MFen 1.2
  fr/releases/5.0R/DP1/relnotes.sgml: MFen 1.2
  fr/releases/snapshots.sgml: MFen 1.16
  fr/releases/index.sgml: MFen 1.94
  fr/search/atoz.pl: MFen 1.5 (script, no translation)
  fr/search/site.pl: MFen 1.3 (script, no translation)
  fr/search/site.map: MFen 1.22
  fr/search/searchhints.sgml: MFen 1.8
  fr/search/search.sgml: MFen 1.92
  fr/search/search-mid.sgml: MFen 1.8
  fr/search/index-site.sgml: MFen 1.25
  fr/search/web.atoz: MFen 1.68
  fr/security/security.sgml: MFen 1.72
  fr/security/advisories.xml: MFen 1.143
  fr/smp/index.sgml: MFen 1.1
  fr/tutorials/index.sgml: MFen 1.23
2003-12-10 17:13:33 +00:00

53 lines
1.7 KiB
Perl

#!/usr/bin/perl
# Copyright (c) May 1997 Wolfram Schneider <wosch@FreeBSD.org>, Berlin.
#
# atoz - create automatically an `A-Z Index' from a pre-sorted database
# (sort -uf) with the format `<titel>|<url>'
#
# $FreeBSD$
# The FreeBSD French Documentation Project
# Original revision: 1.5
if ($ARGV[0] eq '-u' && $#ARGV > 0) {
$urlprefix = $ARGV[1]; shift; shift; # prefix for relative URLs
} elsif ($ARGV[0] =~ /^-/) { die "usage: $0 [-u urlprefix] files ...\n" }
$top = 'ruebezahl'; # HTML tag name for `go to top of page'
$hr = "<HR NOSHADE>\n\n"; $h2 = 'H2';
$table = 1; # use table output for alphabet
sub eol { "</UL>\n\n" }
$firstold = ''; @az = (); @list = ();
while(<>) {
chop; next if /^\s*#/ || /^\s*$/; # ignore comments
$first = substr($_, 0, 1); $first =~ y/a-z/A-Z/;
if ($firstold ne $first) { # a new alphabet character
push(@az, $first);
push(@list, &eol) if $#az > 0; # close previous list
push(@list,
qq{<$h2><A NAME="$first" HREF="#$top">$first</a></$h2>\n<UL>\n});
}
$firstold = $first;
($title, $url) = split('\|', $_); $url =~ s/^\s+//; $url =~ s/\s+$//;
$url = $urlprefix . $url unless
($url =~ m%^/% || $url =~ /^(news|mailto|ftp|http|telnet):/oi);
push(@list, qq{<LI><A HREF="$url">$title</A>\n});
}
push(@list, &eol); # close last list
# Output header, list, and copyright
print qq{<A NAME="$top"></A>\n};
print qq{<TABLE BORDER=4><TR>\n} if $table;
foreach (@az) {
if ($table) {
print qq{<TD><A HREF="#$_">$_</A></TD>\n};
} else {
print qq{<A HREF="#$_">$_</A>\n};
}
}
print "</TR></TABLE>\n" if $table;
print $hr; print @list;
#print qq{<link ref="made" href="http://www.de.freebsd.org/~wosch/">\n};