More untested work.
[artemus.git] / art5
blob3ee13922d617191ed4c1963f58022222745e61fe
1 #!/usr/bin/perl
3 use Artemus5;
5 my $a = Artemus5->new();
7 #my $src = join('', <>);
9 #print $a->process($src);
11 # <a href = http://host?t=<{$0}>;offset=0><{or $1 "Main index"}></a>
13 my $url = [ '?',
14 [ '"', '<a href = http://host/?t=' ],
15 [ '$', 0 ],
16 [ '"', ';offset=0>'],
17 [ 'or',
18 [ '$', 1 ],
19 [ '"', 'Main index' ],
21 [ '"', '</a>' ]
24 $a->{op}->{url} = $url;
26 # navigator
27 # <span class = 'prev'><{if $2
28 # {? "<a href = "
29 # {url "INDEX" "topic" $0 "offset" {sub $2 $1}}
30 # ">&lt;&lt;</a>
31 # }}></span>
33 # <html>\n<{url 'LOGIN' 'Login page'}>\n<{url 'INDEX'}></html>
35 my $p = [ '?',
36 [ '"', "<html>\n" ],
37 [ '()', [ 'url', [ '"', 'LOGIN'], ['"', 'Login page'] ] ],
38 [ '"', "\n" ],
39 [ '()', [ 'url', [ '"', 'INDEX'] ] ],
40 [ '"', "\n</html>" ]
43 print $a->exec($p), "\n";
45 exit 0;