/[pub]/suikawiki/script/misc/plugins/view/stylesheet.pm
Suika

Contents of /suikawiki/script/misc/plugins/view/stylesheet.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Sun May 16 23:05:50 2010 UTC (16 years, 6 months ago) by wakaba
Branch: MAIN
CVS Tags: suikawiki3-redirect, HEAD
Branch point for: helowiki-2005
added latest .pm files

1 use strict;
2 package SuikaWiki::Plugin::Registry;
3
4
5 our %Info;
6 $Info{q#StyleSheet#}->{Name} = q#StyleSheet#;
7 $Info{q#StyleSheet#}->{q#Version#} = q#2005.0315.0849#;
8 $Info{q#StyleSheet#}->{q#InterfaceVersion#} = q#2.9.1#;
9 $Info{q#StyleSheet#}->{q#mkpluginVersion#} = q#2.1.21#;
10 $Info{q#StyleSheet#}->{q#module_name#} = q#SuikaWiki::Plugin::plugin::StyleSheet1050215084916LDrj#;
11 $Info{q#StyleSheet#}->{q#Date.RCS#} = q#$Date: 2004/12/05 12:57:37 $#;
12 $Info{q#StyleSheet#}->{RequiredPlugin} = [q#Error#, q#HTML#];
13 $Info{q#StyleSheet#}->{RequiredModule} = [q#URI#];
14 $Info{q#StyleSheet#}->{Description} = [[q#Stylesheet support#, q#en#, q##]];
15 $Info{q#StyleSheet#}->{License} = [[q#%%Perl%%#, q##, q##]];
16 $Info{q#StyleSheet#}->{Author} = [[[[q#Wakaba#, q#ja#, q#Latn#]], [[q#[email protected]#]], [q##]]];
17 package SuikaWiki::Plugin::plugin::StyleSheet1050215084916LDrj;
18
19
20 #line 1 "(WikiPlugin module source stylesheet.wp2, block Plugin/Use)"
21 use URI;
22 use Message::Util::Error;
23 my $WIKIRESOURCE;
24 #line 1 "(WikiPlugin module StyleSheet, chunk 1)"
25
26 package SuikaWiki::Format::Definition::StyleSheet::CSS;
27
28 our @ISA;
29 push @ISA, 'SuikaWiki::Format::Definition::template';
30 $SuikaWiki::Format::Definition::Class{q#MAGIC:CSS/\#\##} = 'SuikaWiki::Format::Definition::StyleSheet::CSS';
31 $SuikaWiki::Format::Definition::Class{q#IMT:text/css\#\##} = 'SuikaWiki::Format::Definition::StyleSheet::CSS';
32
33 #line 1 "(WikiPlugin module source stylesheet.wp2, block Format[module-name()=SuikaWiki::Format::Definition::StyleSheet::CSS]/Use)"
34 use Message::Markup::XML::QName qw(NS_xml_URI);
35 #line 251 "(WikiPlugin module StyleSheet, chunk from ../../../bin/mkplugin2.pl)"
36 our $Converter;
37 sub convert ($$;%) {
38 my ($self, $source, %opt) = @_;
39 my $t = SuikaWiki::Format::Definition->serialize_media_type (%opt);
40 my $converter = $Converter->{$t->{_}};
41 return ($converter->{$opt{return_type} or 'Main'} or
42 CORE::die "Buggy implementation: $t->{_}/@{[$opt{return_type} or 'Main']} not defined")
43 ->($self, $source, \%opt)
44 if $converter;
45 local $Error::Depth = $Error::Depth + 1;
46 $self->SUPER::convert ($source, %opt);
47 }
48
49 #line 1 "(WikiPlugin module StyleSheet, chunk 2)"
50 $Converter->{q#IMT:text/css\#\##} = {q#Type#, q#text/css#, q#serialized_type#, q#IMT:text/css\#\##, q#ToString#, sub {my ($self, $source, $opt) = @_;
51 #line 1 "(WikiPlugin module source stylesheet.wp2, block //Converter/ToString)"
52 return $$source;
53 #line 1 "(WikiPlugin module StyleSheet, chunk 3)"
54 }, q#Type_param#, {}};
55 $Converter->{q#IMT:text/html\#\#f#} = {q#Type#, q#text/html#, q#serialized_type#, q#IMT:text/html\#\#f#, q#Type_param#, {}, q#IsFragment#, q#1#, q#Main#, sub {my ($self, $source, $opt) = @_;
56 #line 1 "(WikiPlugin module source stylesheet.wp2, block //Converter/Main)"
57 my $node = $opt->{-parent}->append_new_node
58 (type => '#element',
59 namespace_uri => q#http://www.w3.org/1999/xhtml#,
60 local_name => 'pre');
61 $node->set_attribute (class => 'text-css');
62 $node->set_attribute (space => 'preserve', namespace_uri => NS_xml_URI);
63 $node->append_text ($$source);
64 return $node;
65 #line 1 "(WikiPlugin module StyleSheet, chunk 4)"
66 }};
67 sub content_written {
68 my ($self, %opt) = @_;
69 #line 1 "(WikiPlugin module source stylesheet.wp2, block Format[module-name()=SuikaWiki::Format::Definition::StyleSheet::CSS]/content_written])"
70 if ($opt{wiki}->{config}->{q#http://suika.fam.cx/~wakaba/archive/2004/05/sw-stylesheet\#use-static#}) {
71 $opt{wiki}->{db}->set (static__css => $opt{page} => ${$opt{new_content}});
72 }
73 #line 1 "(WikiPlugin module StyleSheet, chunk 5)"
74 }
75 sub content_removed {
76 my ($self, %opt) = @_;
77 #line 1 "(WikiPlugin module source stylesheet.wp2, block Format[module-name()=SuikaWiki::Format::Definition::StyleSheet::CSS]/content_removed])"
78 if ($opt{wiki}->{config}->{q#http://suika.fam.cx/~wakaba/archive/2004/05/sw-stylesheet\#use-static#}) {