#?SuikaWikiConfig/2.0 Plugin: @Name: WikiPluginInfo @Description: @@@: WikiPlugin information @@lang:en @License: %%Perl%% @Author: @@Name: @@@@: Wakaba @@@lang:ja @@@script:Latn @@Mail[list]: w@suika.fam.cx @Date.RCS: $Date: 2004/02/14 10:53:13 $ @RequiredPlugin[list]: WikiStruct @Use: my $WIKIRESOURCE; use Message::Util::Error; PluginConst: @NS_XHTML1: http://www.w3.org/1999/xhtml @WIKIRESOURCE: {($WIKIRESOURCE ||= SuikaWiki::Plugin->module_package ('WikiResource'))} FormattingRule: @Category[list]: view view-resource form-input @Name: wpi--for-each-plugin @Description: @@@: Apply template for each WikiPlugin module @@lang: en @Parameter: @@Name: template @@Type: template @@Default: #REQUIRED @@Description: @@@@: Template to be applied for each module @@lang: en @Formatting: __ATTRTEXT:%template__; $p->{template} ||= $WIKIRESOURCE->get (name => 'WikiPluginInfo:ForEachPlugin:Template', o => $o, wiki => $o->{wiki}); my $formatter = SuikaWiki::Plugin->formatter ('view_resource'); for (sort keys %SuikaWiki::Plugin::Registry::Info) { local $o->{var}->{wpi__plugin_module} = $_; try { $formatter->replace ($p->{template}, param => $o, -parent => $p->{-parent}); } catch Message::Util::Formatter::error with { my $err = shift; if ($err->{-object}->{-category_name} eq 'view_resource') { my $wiki = $err->{option}->{param}->{wiki}; SuikaWiki::Plugin->module_package ('Error') ->reporting_formatting_template_error ($err, $wiki, template => $p->{template}); undef; } else { $err->throw; } }; } FormattingRule: @Category[list]: view view-resource form-input @Name: wpi--for-each-formatting-category @Description: @@@: Apply template for each formatting caregory @@lang: en @Parameter: @@Name: template @@Type: template @@Default: #REQUIRED @@Description: @@@@: Template to be applied for each module @@lang: en @Formatting: __ATTRTEXT:%template__; $p->{template} ||= $WIKIRESOURCE->get (name => 'WikiPluginInfo:ForEachCategory:Template', o => $o, wiki => $o->{wiki}); my $formatter = SuikaWiki::Plugin->formatter ('view_resource'); for (sort keys %SuikaWiki::Plugin::Rule) { local $o->{var}->{wpi__formatting_category} = $_; try { $formatter->replace ($p->{template}, param => $o, -parent => $p->{-parent}); } catch Message::Util::Formatter::error with { my $err = shift; if ($err->{-object}->{-category_name} eq 'view_resource') { my $wiki = $err->{option}->{param}->{wiki}; SuikaWiki::Plugin->module_package ('Error') ->reporting_formatting_template_error ($err, $wiki, template => $p->{template}); undef; } else { $err->throw; } }; } FormattingRule: @Category[list]: view view-resource form-input @Name: wpi--for-each-formatting-rule @Description: @@@: Apply template for each formatting rule @@lang: en @Parameter: @@Name: category @@Type: text @@Default: (auto) @@Description: @@@@: Formatting category to which rule belongs @@@lang: en @Parameter: @@Name: template @@Type: template @@Default: #REQUIRED @@Description: @@@@: Template to be applied for each module @@lang: en @Formatting: my $category = $p->{category} || $o->{var}->{wpi__formatting_category}; __ATTRTEXT:%template__; $p->{template} ||= $WIKIRESOURCE->get (name => 'WikiPluginInfo:ForEachRule:Template', o => $o, wiki => $o->{wiki}); my $formatter = SuikaWiki::Plugin->formatter ('view_resource'); for (sort keys %{$SuikaWiki::Plugin::Rule{$category}}) { local $o->{var}->{wpi__formatting_rule} = $_; try { $formatter->replace ($p->{template}, param => $o, -parent => $p->{-parent}); } catch Message::Util::Formatter::error with { my $err = shift; if ($err->{-object}->{-category_name} eq 'view_resource') { my $wiki = $err->{option}->{param}->{wiki}; SuikaWiki::Plugin->module_package ('Error') ->reporting_formatting_template_error ($err, $wiki, template => $p->{template}); undef; } else { $err->throw; } }; } FormattingRule: @Category[list]: view view-resource form-input @Name: wpi--plugin-name @Description: @@@: WikiPlugin module name @@lang: en @Parameter: @@Name: module @@Type: text @@Default: (auto) @@Description: @@@@: WikiPlugin module name @@@lang: en @Formatting: my $module = $p->{module} || $o->{var}->{wpi__plugin_module}; $p->{-parent}->append_text ( ($SuikaWiki::Plugin::Registry::Info{ $module } || {}) ->{Name} ); FormattingRule: @Category[list]: view view-resource form-input @Name: wpi--plugin-version @Description: @@@: WikiPlugin module version @@lang: en @Parameter: @@Name: module @@Type: text @@Default: (auto) @@Description: @@@@: WikiPlugin module name @@@lang: en @Formatting: my $module = $p->{module} || $o->{var}->{wpi__plugin_module}; $p->{-parent}->append_text ( ($SuikaWiki::Plugin::Registry::Info{ $module } || {}) ->{Version} ); FormattingRule: @Category[list]: view view-resource form-input @Name: wpi--plugin-version-rcs-date @Description: @@@: WikiPlugin module version as RCS date-time @@lang: en @Parameter: @@Name: module @@Type: text @@Default: (auto) @@Description: @@@@: WikiPlugin module name @@@lang: en @Formatting: my $module = $p->{module} || $o->{var}->{wpi__plugin_module}; $p->{-parent}->append_text ( ($SuikaWiki::Plugin::Registry::Info{ $module } || {}) ->{'Date.RCS'} ); FormattingRule: @Category[list]: view view-resource form-input @Name: wpi--plugin-interface-version @Description: @@@: WikiPlugin interface version implemented by the WikiPlugin module @@lang: en @Parameter: @@Name: module @@Type: text @@Default: (auto) @@Description: @@@@: WikiPlugin module name @@@lang: en @Formatting: my $module = $p->{module} || $o->{var}->{wpi__plugin_module}; $p->{-parent}->append_text ( ($SuikaWiki::Plugin::Registry::Info{ $module } || {}) ->{InterfaceVersion} ); FormattingRule: @Category[list]: view view-resource form-input @Name: wpi--plugin-mkplugin-version @Description: @@@: Version of mkplugin that genearted the WikiPlugin module @@lang: en @Parameter: @@Name: module @@Type: text @@Default: (auto) @@Description: @@@@: WikiPlugin module name @@@lang: en @Formatting: my $module = $p->{module} || $o->{var}->{wpi__plugin_module}; $p->{-parent}->append_text ( ($SuikaWiki::Plugin::Registry::Info{ $module } || {}) ->{mkpluginVersion} ); FormattingRule: @Category[list]: view view-resource form-input @Name: wpi--plugin-license @Description: @@@: WikiPlugin module license @@lang: en @Parameter: @@Name: module @@Type: text @@Default: (auto) @@Description: @@@@: WikiPlugin module name @@@lang: en @Formatting: my $module = $p->{module} || $o->{var}->{wpi__plugin_module}; my $license = $WIKIRESOURCE->temp_get_language_resource_from_array (source => ($SuikaWiki::Plugin::Registry::Info{ $module } || {}) ->{License}, o => $o)->[0]; $license =~ s{ %%([A-Za-z0-9_.+-]+)%% | ((?:(?!%%).)+)} {$1 ? $WIKIRESOURCE->get_op ('WikiPluginInfo:License:'.$1, $o, $p->{-parent}) : $p->{-parent}->append_text ($2); ''}gex; FormattingRule: @Category[list]: view view-resource form-input @Name: wpi--plugin-description @Description: @@@: WikiPlugin module description @@lang: en @Parameter: @@Name: module @@Type: text @@Default: (auto) @@Description: @@@@: WikiPlugin module name @@@lang: en @Formatting: my $module = $p->{module} || $o->{var}->{wpi__plugin_module}; $p->{-parent}->append_text ( ($WIKIRESOURCE->temp_get_language_resource_from_array (source => ($SuikaWiki::Plugin::Registry::Info{ $module } || {}) ->{Description}, o => $o) || [])->[0], ); FormattingRule: @Category[list]: view view-resource form-input @Name: wpi--plugin-required-plugins @Description: @@@: WikiPlugin modules required by this WikiPlugin module @@lang: en @Parameter: @@Name: module @@Type: text @@Default: (auto) @@Description: @@@@: WikiPlugin module name @@@lang: en @Formatting: my $module = $p->{module} || $o->{var}->{wpi__plugin_module}; my $list = ($SuikaWiki::Plugin::Registry::Info{ $module } || {}) ->{RequiredPlugin} || []; return unless @$list; my $ul = $p->{-parent}->append_new_node (type => '#element', namespace_uri => $NS_XHTML1, local_name => 'ul'); for (sort @$list) { $ul->append_new_node (type => '#element', namespace_uri => $NS_XHTML1, local_name => 'li') ->append_text ($_); ## TODO: Should be template aware } FormattingRule: @Category[list]: view view-resource form-input @Name: wpi--plugin-required-modules @Description: @@@: Perl modules required by this WikiPlugin module @@lang: en @Parameter: @@Name: module @@Type: text @@Default: (auto) @@Description: @@@@: WikiPlugin module name @@@lang: en @Formatting: my $module = $p->{module} || $o->{var}->{wpi__plugin_module}; my $list = ($SuikaWiki::Plugin::Registry::Info{ $module } || {}) ->{RequiredModule} || []; return unless @$list; my $ul = $p->{-parent}->append_new_node (type => '#element', namespace_uri => $NS_XHTML1, local_name => 'ul'); for (sort @$list) { $ul->append_new_node (type => '#element', namespace_uri => $NS_XHTML1, local_name => 'li') ->append_text ($_); ## TODO: Should be template aware } FormattingRule: @Category[list]: view view-resource form-input @Name: wpi--formatting-category-name @Description: @@@: Formatting category name @@lang: en @Parameter: @@Name: category @@Type: text @@Default: (auto) @@Description: @@@@: Formatting category @@@lang: en @Formatting: my $name = $p->{category} || $o->{var}->{wpi__formatting_category}; $name =~ s/(?<=.)_/-/g; $p->{-parent}->append_text ($name); FormattingRule: @Category[list]: view view-resource form-input @Name: wpi--formatting-rule-name @Description: @@@: Formatting rule name @@lang: en @Parameter: @@Name: rule @@Type: text @@Default: (auto) @@Description: @@@@: Formatting rule @@@lang: en @Formatting: my $name = $p->{rule} || $o->{var}->{wpi__formatting_rule}; $name =~ s/(?<=.)_/-/g; $p->{-parent}->append_text ($name); FormattingRule: @Category[list]: view view-resource form-input @Name: wpi--formatting-rule-description @Description: @@@: FormattingRule description @@lang: en @Parameter: @@Name: category @@Type: text @@Default: (auto) @@Description: @@@@: Formatting category @@@lang: en @Parameter: @@Name: rule @@Type: text @@Default: (auto) @@Description: @@@@: Formatting rule @@@lang: en @Formatting: my $category = $p->{category} || $o->{var}->{wpi__formatting_category}; my $rule = $p->{rule} || $o->{var}->{wpi__formatting_rule}; $category =~ s/(?=.)-/_/ if $p->{category}; $rule =~ s/(?=.)-/_/ if $p->{rule}; $p->{-parent}->append_text ( ($WIKIRESOURCE->temp_get_language_resource_from_array (source => (($SuikaWiki::Plugin::Rule{ $category } || {}) ->{ $rule } || {}) ->{Description}, o => $o) || [])->[0] ); Resource: @WikiPluginInfo:Description: @@@: Description @@lang: en @WikiPluginInfo:ForEachCategory:Template: %section ( title => {%wpi--formatting-category-name;}p, heading, content => {%wpi--for-each-formatting-rule;}p, ); @WikiPluginInfo:ForEachPlugin:Template: %section ( title => {%wpi--plugin-name;}p, heading, content => { %list ( {%res (name => {WikiPluginInfo:Description});}p => {%wpi--plugin-description;}p, {%res (name => {WikiPluginInfo:Version});}p => {%wpi--plugin-version; (%wpi--plugin-version-rcs-date;)}p, {%res (name => {WikiPluginInfo:InterfaceVersion});}p => {%wpi--plugin-interface-version;}p, {%res (name => {WikiPluginInfo:mkpluginVersion});}p => {%wpi--plugin-mkplugin-version;}p, {%res (name => {WikiPluginInfo:License});}p => {%wpi--plugin-license;}p, {%res (name => {WikiPluginInfo:RequiredPlugins});}p => {%wpi--plugin-required-plugins;}p, {%res (name => {WikiPluginInfo:RequiredModules});}p => {%wpi--plugin-required-modules;}p, ); }p, ); @WikiPluginInfo:ForEachRule:Template: %section ( title => {%wpi--formatting-rule-name;}p, heading, content => { %list ( {%res (name => {WikiPluginInfo:Rule:Name});}p => {%wpi--formatting-category-name;/%wpi--formatting-rule-name;}p, {%res (name => {WikiPluginInfo:Description});}p => {%wpi--formatting-rule-description;}p, ); }p, ); @WikiPluginInfo:InterfaceVersion: @@@: WikiPlugin interface implemented by this module @@lang: en @WikiPluginInfo:License: @@@: License of this module @@lang: en @WikiPluginInfo:License:GPL: @@@: %paragraph (content => {This program is free software; you can redistribute it and/or modify it under the terms of the %link-to-resource ( label => {%link-to-it (label => {GNU General Public License});}, uri => {http://www.gnu.org/copyleft/gpl.html}, ); as published by the %link-to-resource ( label => {%link-to-it (label => {Free Software Foundation});}, uri => {http://www.fsf.org/}, ); either version 2 of the License, or (at your option) any later version.}p); %paragraph (content => {This program is distributed in the hope that it will be useful, but %em (content => {WITHOUT ANY WARRANTY});; without even the implied warranty of %em (content => {MERCHANTABILITY}); or %em (content => {FITNESS FOR A PARTICULAR PURPOSE});. See the GNU General Public License for more details.}p); %paragraph (content => {You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.}); @@lang: en @WikiPluginInfo:License:Mozilla: @@@: Version: MPL 1.1/GPL 2.0/LGPL 2.1 %paragraph (content => {The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at <%link-to-resource ( label => {%link-to-it (label => {http://www.mozilla.org/MPL/});}, uri => {http://www.mozilla.org/MPL/});>}p); %paragraph (content => {Software distributed under the License is distributed on an "%em (content => {AS IS});" basis, %em (content => {WITHOUT WARRANTY OF ANY KIND});, either express or implied. See the License for the specific language governing rights and limitations under the License.}p); # The Original Code is something code. #The Initial Developer of the Original Code is #Someone . #Portions created by the Initial Developer are Copyright (C) yyyy #the Initial Developer. All Rights Reserved. #Contributor(s): # Somwone (original author) %paragraph (content => {Alternatively, the contents of this file may be used under the terms of either the %link-to-resource ( label => {%link-to-it (label => {GNU General Public License});}, uri => {http://www.gnu.org/copyleft/gpl.html}, ); Version 2 or later (the "GPL"), or the %link-to-resource ( label => {%link-to-it (label => {GNU Lesser General Public License});}, uri => {http://www.gnu.org/copyleft/lesser.html}, ); Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the LGPL are applicable instead of those above. If you wish to allow use of your version of this file only under the terms of either the GPL or the LGPL, and not to allow others to use your version of this file under the terms of the MPL, indicate your decision by deleting the provisions above and replace them with the notice and other provisions required by the GPL or the LGPL. If you do not delete the provisions above, a recipient may use your version of this file under the terms of any one of the MPL, the GPL or the LGPL.}p); @@lang: en @WikiPluginInfo:License:Perl: @@@: %paragraph (content => {This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.}); @@lang: en @WikiPluginInfo:mkpluginVersion: @@@: Version of mkplugin that generated this module @@lang: en @WikiPluginInfo:RequiredModules: @@@: Perl modules required by this module @@lang: en @WikiPluginInfo:RequiredPlugins: @@@: WikiPlugin modules required by this module @@lang: en @WikiPluginInfo:Rule:Name: @@@: Formatting rule name @@lang: en @WikiPluginInfo:Version: @@@: Version @@lang: en