Skip to content

Commit 7dda4c8

Browse files
committed
[css2] Added to allow generation of Example keyword
--HG-- extra : convert_revision : svn%3A73dc7c4b-06e6-40f3-b4f7-9ed1dbc14bfc/trunk%401456
1 parent 988af3c commit 7dda4c8

2 files changed

Lines changed: 58 additions & 0 deletions

File tree

css2/bin/Attic/addmarkup

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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);

css2/bin/addmarkup

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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);

0 commit comments

Comments
 (0)