/[suikacvs]/markup/html/html5/spec-ja/make.pl
Suika

Diff of /markup/html/html5/spec-ja/make.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by wakaba, Sat Jun 28 06:13:12 2008 UTC revision 1.7 by wakaba, Fri Jul 11 10:42:26 2008 UTC
# Line 1  Line 1 
1  #!/usr/bin/perl  #!/usr/bin/perl
2  use strict;  use strict;
3    
4  my $source_file_name = q[.spec.en.html];  my $source_file_name = shift;
5  my $data_dir_name = q[data/];  my $data_dir_name = q[data/];
6  my $data_suffix = q[.dat];  my $data_suffix = q[.dat];
7  my $result_file_name = q[non-normative.ja.html.u8];  my $result_file_name = shift;
8    
9  sub normalize ($) {  sub normalize ($) {
10    my $s = shift;    my $s = shift;
# Line 43  my %pattern; Line 43  my %pattern;
43        my ($en, $ja) = split /\n#ja\n/, $_;        my ($en, $ja) = split /\n#ja\n/, $_;
44        if ($en =~ s/^#en\n//) {        if ($en =~ s/^#en\n//) {
45          $data{normalize ($en)} = $ja;          $data{normalize ($en)} = $ja;
46        } elsif ($en =~ s/^#regexp\n//) {        } elsif ($en =~ s/^#pattern\n//) {
47          $pattern{create_pattern1 (normalize ($en))} = $ja;          $pattern{create_pattern1 (normalize ($en))} = $ja;
48        }        }
49      }      }
# Line 75  $source_text =~ s{(<(?>p(?>re)?|li|d[td] Line 75  $source_text =~ s{(<(?>p(?>re)?|li|d[td]
75          $v = $tag . q[<span class=ja-translation lang=ja>] .          $v = $tag . q[<span class=ja-translation lang=ja>] .
76              replace_pattern2 ($pattern{$pattern}, $1, $2, $3, $4, $5) .              replace_pattern2 ($pattern{$pattern}, $1, $2, $3, $4, $5) .
77              q[</span>];              q[</span>];
78            last;
79        }        }
80      }      }
81      $v;      $v;
# Line 91  $source_text =~ s{(<(?>link|img|script)\ Line 92  $source_text =~ s{(<(?>link|img|script)\
92    }    }
93  }ges;  }ges;
94    
95  $source_text =~ s{\[\[([A-Z]+):([^]]+)\]\]}  $source_text =~ s{\[\[([A-Z ]+):([^]]+)\]\]}
96  {<em class=rfc2119 title="$1">$2</em>}gs;  {<em class=rfc2119 title="$1">$2</em>}gs;
97    
98  #$source_text =~ s[<title>][<base href="http://www.whatwg.org/specs/web-apps/current-work/"><title>];  #$source_text =~ s[<title>][<base href="http://www.whatwg.org/specs/web-apps/current-work/"><title>];

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.7

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24