diff options
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | 2005-08-18 17:28:57 +0200 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2005-08-18 10:25:52 -0700 |
commit | 23bb8df2fb334368b6bd36908d13877cf6eae219 (patch) | |
tree | e2370843068fd8b45380f1c4ecef3036887d4b5e /Documentation/sort_glossary.pl | |
parent | 379955c696a417f0fb6118f2fd91dbffd2816ad1 (diff) | |
download | git-23bb8df2fb334368b6bd36908d13877cf6eae219.tar.gz |
[PATCH] Add Makefile target glossary.html
This also includes a script which does the sorting, and introduces
hyperlinks for every described term.
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'Documentation/sort_glossary.pl')
-rw-r--r-- | Documentation/sort_glossary.pl | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/Documentation/sort_glossary.pl b/Documentation/sort_glossary.pl new file mode 100644 index 0000000000..babbea0415 --- /dev/null +++ b/Documentation/sort_glossary.pl @@ -0,0 +1,70 @@ +#!/usr/bin/perl + +%terms=(); + +while(<>) { + if(/^(\S.*)::$/) { + my $term=$1; + if(defined($terms{$term})) { + die "$1 defined twice\n"; + } + $terms{$term}=""; + LOOP: while(<>) { + if(/^$/) { + last LOOP; + } + if(/^ \S/) { + $terms{$term}.=$_; + } else { + die "Error 1: $_"; + } + } + } +} + +sub format_tab_80 ($) { + my $text=$_[0]; + my $result=""; + $text=~s/\s+/ /g; + $text=~s/^\s+//; + while($text=~/^(.{1,72})(|\s+(\S.*)?)$/) { + $result.=" ".$1."\n"; + $text=$3; + } + return $result; +} + +sub no_spaces ($) { + my $result=$_[0]; + $result=~tr/ /_/; + return $result; +} + +print 'GIT Glossary +============ +Aug 2005 + +This list is sorted alphabetically: + +'; + +@keys=sort {uc($a) cmp uc($b)} keys %terms; +$pattern='(\b'.join('\b|\b',reverse @keys).'\b)'; +foreach $key (@keys) { + $terms{$key}=~s/$pattern/sprintf "<<ref_".no_spaces($1).",$1>>";/eg; + print '[[ref_'.no_spaces($key).']]'.$key."::\n" + .format_tab_80($terms{$key})."\n"; +} + +print ' + +Author +------ +Written by Johannes Schindelin <Johannes.Schindelin@gmx.de> and +the git-list <git@vger.kernel.org>. + +GIT +--- +Part of the link:git.html[git] suite +'; + |