Meta/KO: allow checking against mirror sites other than k.org
[alt-git.git] / genMaintNotes.perl
blob5692fa8f24522de6453be2fd95b7cf35d220cafc
1 #!/usr/bin/perl -w
3 print <<'EOF' ;
4 <style>
5 div.inset {
6 background: #aff;
7 color: #888;
8 margin-left: 10%;
9 margin-top: 2em;
10 margin-bottom: 2em;
11 width: 60%;
12 padding: 1.2em;
14 div.inset {
15 color: #444;
17 div.inset a {
18 color: #444;
20 div.inset a:hover {
21 color: #00f;
23 h2 {
24 text-decoration: underline;
25 color: #888;
27 span.tt {
28 font-family: monospace;
30 img#ohloh-badge, img#git {
31 border: none;
32 float: right;
34 </style>
35 <img height="64" id="git" src="http://www.kernel.org/%7Ejunio/Kun-Wave.gif" width="64" />
36 EOF
38 sub show_links {
39 local ($_) = @_;
40 my $br = '';
41 for (split(/\n/, $_)) {
42 s/^\s*//;
43 s/\s*\Z//;
44 my $url = $_;
45 my $comment = $_;
46 $url =~ s/ .*//;
47 if ($url =~ /^http:/) {
48 print "$br<a href=\"$url\"\n>$comment</a>";
49 } else {
50 print "$br$comment";
52 $br = "<br />\n";
54 print "\n";
57 sub show_commands {
58 local ($_) = @_;
59 my $br = '';
60 for (split(/\n/, $_)) {
61 s/^\s*//;
62 s/\s*\Z//;
63 print "$br<span class=\"tt\">$_</span>";
64 $br = "<br />\n";
66 print "\n";
69 my $in_ul;
70 $/ = "";
71 while (<>) {
72 $_ =~ s/\n+$//s;
74 if (/^ - /) {
75 if (!$in_ul) {
76 $in_ul = 1;
77 print "<ul>\n";
79 s/^ - //;
80 print "<li>$_</li>\n";
81 next;
84 if ($in_ul) {
85 $in_ul = undef;
86 print "</ul>\n\n";
89 if (s/^\*\s*//) {
90 print "<h2>$_</h2>\n\n";
91 } elsif (s/^ {4,}//) {
92 print "<div class=\"inset\">\n";
93 if (/^(http|git|nntp):\/\//) {
94 show_links($_);
95 } else {
96 show_commands($_);
98 print "</div>\n\n";
99 } else {
100 print "<p>$_</p>\n\n";