-
Notifications
You must be signed in to change notification settings - Fork 0
/
preprocess.pl
37 lines (32 loc) · 840 Bytes
/
preprocess.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
use strict;
use warnings;
open my $fr, '<', 'core/index.html' or die "$@";
open my $fw, '>', 'omegat/source/core/index.html' or die "$@";
my $f = 0;
while(<$fr>){
s@<em class="rfc2119" title="[A-Z ]+">([A-Z ]+)</em>@$1@g;
if(m@<figcaption>@){
$f = 1;
}
if($f == 1){
s@\.\n@:\n@;
}
if(m@</figcaption>@){
$f = 0;
}
print $fw $_;
if(/<body/){
print $fw <<EOF
<aside>
This is a Japanese translation of <a href="https://www.w3.org/TR/2017/REC-activitystreams-core-20170523/">Activity Streams 2.0</a>.
The official document is an English version.
This document may contain errors due to translations.
Please contact the <a href = "https://github.com/argrath/activitystream"> GitHub repository </a> regarding this document.
</aside>
<hr>
EOF
;
}
}
close $fr;
close $fw;