/[pub]/suikawiki/script/misc/plugins/link/map.wp2
Suika

Diff of /suikawiki/script/misc/plugins/link/map.wp2

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

revision 1.14 by wakaba, Fri Aug 6 03:38:11 2004 UTC revision 1.15 by wakaba, Tue Sep 21 03:18:22 2004 UTC
# Line 26  Plugin: Line 26  Plugin:
26    @Namespace:    @Namespace:
27      @@relrev:      @@relrev:
28        http://suika.fam.cx/~wakaba/archive/2004/7/25/html-relrev#        http://suika.fam.cx/~wakaba/archive/2004/7/25/html-relrev#
29        @@sw:
30          http://suika.fam.cx/~wakaba/archive/2004/7/20/sw#
31    
32  PluginConst:  PluginConst:
33    @NS_XHTML1:    @NS_XHTML1:
# Line 45  PluginConst: Line 47  PluginConst:
47    
48  FormattingRule:  FormattingRule:
49    @Category[list]: view    @Category[list]: view
50      @Name: m--wikipage-obsolete
51      @Description:
52        @@@:
53          The navigation notify that this WikiPage is obsolete and
54          should refer the other WikiPages.
55        @@lang: en
56      @Parameter:
57        @@Name: desc-after
58        @@Type: template
59        @@Default: (none)
60        @@Description:
61          @@@lang:en
62          @@@@: The description should be located after WikiPage names if any.
63      @Parameter:
64        @@Name: desc-before
65        @@Type: template
66        @@Default: (none)
67        @@Description:
68          @@@lang:en
69          @@@@: The description should be located before WikiPage names if any.
70      @Parameter:
71        @@Name: page
72        @@Type: WikiName
73        @@Default: (current)
74        @@Description:
75          @@@lang: en
76          @@@@: The WikiPage that might be obsoleted.
77      @Formatting:
78          my $page = $o->{wiki}->name ($p->{page} || $o->{wiki}->{var}->{page});
79          my $content_prop;
80          try {
81            $content_prop = $o->{wiki}->{db}->get (content_prop => $page);
82          } catch SuikaWiki::DB::Util::Error with {
83            my $err = shift;
84            $err->throw if $err->{-type} eq 'ERROR_REPORTED';
85          } catch SuikaWiki::Format::Definition::error with {
86            #
87          };
88    
89        if ($content_prop) {
90          my $obs = $content_prop->get_attribute_value
91                                            (<Q:sw:obsolete>, as_array => 1,
92                                             default => []);
93          if (@$obs) {
94            my $pp = $p->{-parent}->append_new_node
95                                     (type => '#element',
96                                      namespace_uri => $NS_XHTML1,
97                                      local_name => 'p');
98            $pp->set_attribute (class => 'm--wikipage-obsolete');
99            __ATTRNODE:%desc_before->{$pp}__;
100            my $i = 0;
101            for (@$obs) {
102              $pp->append_text (', ') if $i++;
103                __FUNCPACK{WikiLinking}__->to_wikipage_in_html (
104                {
105                } => {
106                  base            => $page,
107                  page_name_relative => $o->{wiki}->name ($_),
108                }, {
109                  o               => $o,
110                  parent          => $pp,
111                });
112            }
113            __ATTRNODE:%desc_after->{$pp}__;
114          }
115        }
116    
117    FormattingRule:
118      @Category[list]: view
119    @Name: m--html-link-navigation    @Name: m--html-link-navigation
120    @Description:    @Description:
121      @@@: Navigation links (HTML link elements) made from content properties      @@@: Navigation links (HTML link elements) made from content properties

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24