]> git.ipfire.org Git - thirdparty/git.git/blame - genMaintNotes.perl
What's cooking (2024/01 #09)
[thirdparty/git.git] / genMaintNotes.perl
CommitLineData
151d4dc9
JH
1#!/usr/bin/perl -w
2
3print <<'EOF' ;
d3c2832a 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>
151d4dc9
JH
5<style>
6div.inset {
7background: #aff;
8color: #888;
9margin-left: 10%;
10margin-top: 2em;
11margin-bottom: 2em;
12width: 60%;
13padding: 1.2em;
14}
15div.inset {
16color: #444;
17}
18div.inset a {
19color: #444;
20}
21div.inset a:hover {
22color: #00f;
23}
24h2 {
25text-decoration: underline;
26color: #888;
27}
28span.tt {
29font-family: monospace;
30}
31img#ohloh-badge, img#git {
32border: none;
33float: right;
34}
35</style>
151d4dc9
JH
36EOF
37
38sub 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";
51 }
52 $br = "<br />\n";
53 }
54 print "\n";
55}
56
57sub 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";
65 }
66 print "\n";
67}
68
69my $in_ul;
70$/ = "";
71while (<>) {
72 $_ =~ s/\n+$//s;
73
74 if (/^ - /) {
75 if (!$in_ul) {
76 $in_ul = 1;
77 print "<ul>\n";
78 }
79 s/^ - //;
80 print "<li>$_</li>\n";
81 next;
82 }
83
84 if ($in_ul) {
85 $in_ul = undef;
86 print "</ul>\n\n";
87 }
88
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($_);
97 }
98 print "</div>\n\n";
99 } else {
100 print "<p>$_</p>\n\n";
101 }
102}