Remove link to GitHub sponsors
[openssl-web.git] / bin / strip-man-html
1 #! /usr/bin/env perl
2
3 # pod2html creates complete pages, but we want embeddable ones.
4 # Fortunately, it's easy to find the stuff that need to go away.
5
6 local $/;                       # Slurp the whole file
7 my $contents = <STDIN>;
8
9 $contents =~ m@^<h1 id="NAME">NAME</h1>@m;
10 $contents = $&.$';              # Everything before NAME is stripped
11 $contents =~ m@^</body>@m;
12 $contents = $`;                 # </body> and everything after is stripped
13
14 # Adapt all H tags to be wrapped inside H1 and H2
15 $contents =~ s@(</?h)(\d)(\s|>)@$1.($2 + 2).$3@emg;
16
17 print $contents;