What's cooking (2015/08 #04)
[alt-git.git] / genMaintNotes.perl
blob9b470a7816db9d61c905f51d24ce84e3e437ed72
1 #!/usr/bin/perl -w
3 print <<'EOF' ;
4 <a href="http://3.bp.blogspot.com/-zbY2zfS4fKE/TlgfTSTK-oI/AAAAAAAACOQ/E_0Y4408QRE/s1600/GprofileSmall.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="http://3.bp.blogspot.com/-zbY2zfS4fKE/TlgfTSTK-oI/AAAAAAAACOQ/E_0Y4408QRE/s1600/GprofileSmall.png"></a>
5 <style>
6 div.inset {
7 background: #aff;
8 color: #888;
9 margin-left: 10%;
10 margin-top: 2em;
11 margin-bottom: 2em;
12 width: 60%;
13 padding: 1.2em;
15 div.inset {
16 color: #444;
18 div.inset a {
19 color: #444;
21 div.inset a:hover {
22 color: #00f;
24 h2 {
25 text-decoration: underline;
26 color: #888;
28 span.tt {
29 font-family: monospace;
31 img#ohloh-badge, img#git {
32 border: none;
33 float: right;
35 </style>
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";