File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # !/usr/local/bin/perl -w
2+ # Add special markup to document
3+ # - Add keyword "Example:" before examples for non-CSS UAs
4+ # $id$
5+ # Ian Jacobs (ij@w3.org)
6+
7+ use DB_File;
8+ use lib ' bin' ;
9+ use utils;
10+ use English;
11+
12+ $PROG = substr ($0 , rindex ($0 , " /" ) + 1);
13+ $USAGE = " Usage: $PROG input [output]\n " ;
14+
15+ if ($#ARGV >= 0) {$input = $ARGV [0]; shift ;} else {die $USAGE ;}
16+ if ($#ARGV >= 0) {$output = $ARGV [0]; shift ;} else {$output = ' -' ;}
17+ if ($#ARGV >= 0) {die $USAGE ;}
18+
19+ # Copy file in memory
20+ $buf = readfile($input );
21+
22+ $attrs = " \\ s+class\\ s*=\\ s*\" ?example\" ?" ;
23+ $buf =~ s / <div$attrs>/ $& <P style="display:none">Example(s):<\/ P>/ sgio ;
24+ $attrs = " \\ s+class\\ s*=\\ s*\" ?illegal-example\" ?" ;
25+ $buf =~ s / <div$attrs>/ $& <P style="display:none">Illegal example(s):<\/ P>/ sgio ;
26+
27+ open (OUTPUT, " > $output " ) || die " Cannot open for output: $output \n " ;
28+ print OUTPUT $buf ;
29+ close (OUTPUT);
Original file line number Diff line number Diff line change 1+ # !/usr/local/bin/perl -w
2+ # Add special markup to document
3+ # - Add keyword "Example:" before examples for non-CSS UAs
4+ # $id$
5+ # Ian Jacobs (ij@w3.org)
6+
7+ use DB_File;
8+ use lib ' bin' ;
9+ use utils;
10+ use English;
11+
12+ $PROG = substr ($0 , rindex ($0 , " /" ) + 1);
13+ $USAGE = " Usage: $PROG input [output]\n " ;
14+
15+ if ($#ARGV >= 0) {$input = $ARGV [0]; shift ;} else {die $USAGE ;}
16+ if ($#ARGV >= 0) {$output = $ARGV [0]; shift ;} else {$output = ' -' ;}
17+ if ($#ARGV >= 0) {die $USAGE ;}
18+
19+ # Copy file in memory
20+ $buf = readfile($input );
21+
22+ $attrs = " \\ s+class\\ s*=\\ s*\" ?example\" ?" ;
23+ $buf =~ s / <div$attrs>/ $& <P style="display:none">Example(s):<\/ P>/ sgio ;
24+ $attrs = " \\ s+class\\ s*=\\ s*\" ?illegal-example\" ?" ;
25+ $buf =~ s / <div$attrs>/ $& <P style="display:none">Illegal example(s):<\/ P>/ sgio ;
26+
27+ open (OUTPUT, " > $output " ) || die " Cannot open for output: $output \n " ;
28+ print OUTPUT $buf ;
29+ close (OUTPUT);
You can’t perform that action at this time.
0 commit comments