summaryrefslogtreecommitdiff
path: root/doc/todo
diff options
context:
space:
mode:
authorJoey Hess <joey@gnu.kitenet.net>2008-12-17 15:22:16 -0500
committerJoey Hess <joey@gnu.kitenet.net>2008-12-17 15:22:16 -0500
commitbb93fccf0690344aa77f9538a508959a6de09847 (patch)
tree2381c9c097e553f384b6136be1322ec205695119 /doc/todo
parent985b229be632126f376aaad7bd354d0d7d014464 (diff)
Coding style change: Remove explcit vim folding markers.
Diffstat (limited to 'doc/todo')
-rw-r--r--doc/todo/Add_DATE_parameter_for_use_in_templates.mdwn14
-rw-r--r--doc/todo/Add_support_for_latest_Text::Markdown_as_found_on_CPAN.mdwn2
-rw-r--r--doc/todo/Allow_change_of_wiki_file_types.mdwn8
-rw-r--r--doc/todo/Allow_edittemplate_to_set_file_type.mdwn8
-rw-r--r--doc/todo/Bestdir_along_with_bestlink_in_IkiWiki.pm.mdwn8
-rw-r--r--doc/todo/Default_text_for_new_pages.mdwn8
-rw-r--r--doc/todo/Give_access_to_more_TMPL__95__VAR_variables_in_templates_inserted_by_the_template_plugin.mdwn2
-rw-r--r--doc/todo/Inline_plugin_option_to_show_full_page_path.mdwn2
-rw-r--r--doc/todo/Move_teximg_latex_preamble_to_config_file.mdwn10
-rw-r--r--doc/todo/Set_arbitrary_date_to_be_used_by_calendar_plugin.mdwn12
-rw-r--r--doc/todo/Silence_monotone_warning.mdwn2
-rw-r--r--doc/todo/Support_wildcard_inside_of_link__40____41___within_a_pagespec.mdwn4
-rw-r--r--doc/todo/Wrapper_config_with_multiline_regexp.mdwn4
-rw-r--r--doc/todo/add_forward_age_sorting_option_to_inline.mdwn2
-rw-r--r--doc/todo/automatic_use_of_syntax_plugin_on_source_code_files/discussion.mdwn20
-rw-r--r--doc/todo/blogpost_plugin.mdwn20
-rw-r--r--doc/todo/bzr.mdwn28
-rw-r--r--doc/todo/cas_authentication.mdwn14
-rw-r--r--doc/todo/color_plugin.mdwn20
-rw-r--r--doc/todo/darcs.mdwn26
-rw-r--r--doc/todo/datearchives-plugin.mdwn8
-rw-r--r--doc/todo/different_search_engine.mdwn40
-rw-r--r--doc/todo/directive_docs.mdwn12
-rw-r--r--doc/todo/enable-htaccess-files.mdwn2
-rw-r--r--doc/todo/format_escape.mdwn16
-rw-r--r--doc/todo/fortune:_select_options_via_environment.mdwn4
-rw-r--r--doc/todo/index.html_allowed.mdwn10
-rw-r--r--doc/todo/inline:_numerical_ordering_by_title.mdwn22
-rw-r--r--doc/todo/language_definition_for_the_meta_plugin.mdwn4
-rw-r--r--doc/todo/meta_rcsid.mdwn2
-rw-r--r--doc/todo/missingparents.pm.mdwn44
-rw-r--r--doc/todo/modify_page_filename_in_plugin.mdwn6
-rw-r--r--doc/todo/pagespec_relative_to_a_target.mdwn16
-rw-r--r--doc/todo/provide_sha1_for_git_diffurl.mdwn2
-rw-r--r--doc/todo/require_CAPTCHA_to_edit.mdwn22
-rw-r--r--doc/todo/source_link.mdwn14
-rw-r--r--doc/todo/structured_page_data.mdwn50
-rw-r--r--doc/todo/supporting_comments_via_disussion_pages.mdwn12
-rw-r--r--doc/todo/syntax_highlighting.mdwn4
-rw-r--r--doc/todo/tidy_git__39__s_ctime_debug_output.mdwn2
-rw-r--r--doc/todo/tmplvars_plugin.mdwn12
-rw-r--r--doc/todo/tracking_bugs_with_dependencies.mdwn58
-rw-r--r--doc/todo/turn_edittemplate_verbosity_off_by_default.mdwn6
-rw-r--r--doc/todo/using_meta_titles_for_parentlinks.html8
-rw-r--r--doc/todo/varioki_--_add_template_variables___40__with_closures_for_values__41___in_ikiwiki.setup.mdwn8
45 files changed, 299 insertions, 299 deletions
diff --git a/doc/todo/Add_DATE_parameter_for_use_in_templates.mdwn b/doc/todo/Add_DATE_parameter_for_use_in_templates.mdwn
index c908f57c8..8ecdf36d0 100644
--- a/doc/todo/Add_DATE_parameter_for_use_in_templates.mdwn
+++ b/doc/todo/Add_DATE_parameter_for_use_in_templates.mdwn
@@ -44,7 +44,7 @@ regenerate this one against that).
%config %links %renderedfiles %pagesources %destsources);
our $VERSION = 2.00; # plugin interface version, next is ikiwiki version
our $version="2.1";my $installdir="/usr";
- @@ -70,6 +70,7 @@ sub defaultconfig () { #{{{
+ @@ -70,6 +70,7 @@ sub defaultconfig () {
plugin => [qw{mdwn inline htmlscrubber passwordauth openid signinedit
lockedit conditional}],
timeformat => '%c',
@@ -52,27 +52,27 @@ regenerate this one against that).
locale => undef,
sslcookie => 0,
httpauth => 0,
- @@ -447,6 +448,15 @@ sub displaytime ($) { #{{{
+ @@ -447,6 +448,15 @@ sub displaytime ($) {
$config{timeformat}, localtime($time)));
- } #}}}
+ }
- +sub displaydate ($) { #{{{
+ +sub displaydate ($) {
+ my $time=shift;
+
+ # strftime doesn't know about encodings, so make sure
+ # its output is properly treated as utf8
+ return decode_utf8(POSIX::strftime(
+ $config{dateformat}, localtime($time)));
- +} #}}}
+ +}
+
- sub beautify_url ($) { #{{{
+ sub beautify_url ($) {
my $url=shift;
diff --git a/Plugin/inline.pm b/Plugin/inline.pm
index 8f6ab51..7bd6147 100644
--- a/Plugin/inline.pm
+++ b/Plugin/inline.pm
- @@ -148,6 +148,7 @@ sub preprocess_inline (@) { #{{{
+ @@ -148,6 +148,7 @@ sub preprocess_inline (@) {
$template->param(pageurl => urlto(bestlink($params{page}, $page), $params{destpage}));
$template->param(title => pagetitle(basename($page)));
$template->param(ctime => displaytime($pagectime{$page}));
diff --git a/doc/todo/Add_support_for_latest_Text::Markdown_as_found_on_CPAN.mdwn b/doc/todo/Add_support_for_latest_Text::Markdown_as_found_on_CPAN.mdwn
index 222cd8c46..6b9fa0535 100644
--- a/doc/todo/Add_support_for_latest_Text::Markdown_as_found_on_CPAN.mdwn
+++ b/doc/todo/Add_support_for_latest_Text::Markdown_as_found_on_CPAN.mdwn
@@ -12,7 +12,7 @@ This patch allows IkiWiki to work with either of the two:
--- IkiWiki/Plugin/mdwn.pm.orig 2008-03-08 11:33:50.000000000 +0100
+++ IkiWiki/Plugin/mdwn.pm 2008-03-08 13:37:21.000000000 +0100
- @@ -28,14 +28,20 @@ sub htmlize (@) { #{{{
+ @@ -28,14 +28,20 @@ sub htmlize (@) {
$markdown_sub=\&Markdown::Markdown;
}
else {
diff --git a/doc/todo/Allow_change_of_wiki_file_types.mdwn b/doc/todo/Allow_change_of_wiki_file_types.mdwn
index 8a398f2e0..19574b175 100644
--- a/doc/todo/Allow_change_of_wiki_file_types.mdwn
+++ b/doc/todo/Allow_change_of_wiki_file_types.mdwn
@@ -12,7 +12,7 @@ I was hoping that the [[plugins/rename]] plugin would allow web uses to change t
index 527ee88..123b772 100644
--- a/IkiWiki/Plugin/rename.pm
+++ b/IkiWiki/Plugin/rename.pm
- @@ -43,7 +43,7 @@ sub check_canrename ($$$$$$$) { #{{{
+ @@ -43,7 +43,7 @@ sub check_canrename ($$$$$$$) {
# Dest checks can be omitted by passing undef.
if (defined $dest) {
@@ -21,7 +21,7 @@ I was hoping that the [[plugins/rename]] plugin would allow web uses to change t
error(gettext("no change to the file name was specified"));
}
- @@ -54,7 +54,7 @@ sub check_canrename ($$$$$$$) { #{{{
+ @@ -54,7 +54,7 @@ sub check_canrename ($$$$$$$) {
}
# Must not be a known source file.
@@ -30,7 +30,7 @@ I was hoping that the [[plugins/rename]] plugin would allow web uses to change t
error(sprintf(gettext("%s already exists"),
htmllink("", "", $dest, noimageinline => 1)));
}
- @@ -97,6 +97,24 @@ sub rename_form ($$$) { #{{{
+ @@ -97,6 +97,24 @@ sub rename_form ($$$) {
$f->field(name => "do", type => "hidden", value => "rename", force => 1);
$f->field(name => "page", type => "hidden", value => $page, force => 1);
$f->field(name => "new_name", value => IkiWiki::pagetitle($page), size => 60);
@@ -55,7 +55,7 @@ I was hoping that the [[plugins/rename]] plugin would allow web uses to change t
$f->field(name => "attachment", type => "hidden");
return $f, ["Rename", "Cancel"];
- @@ -223,12 +241,19 @@ sub sessioncgi ($$) { #{{{
+ @@ -223,12 +241,19 @@ sub sessioncgi ($$) {
my $dest=IkiWiki::possibly_foolish_untaint(IkiWiki::titlepage($q->param("new_name")));
# The extension of dest is the same as src if it's
diff --git a/doc/todo/Allow_edittemplate_to_set_file_type.mdwn b/doc/todo/Allow_edittemplate_to_set_file_type.mdwn
index b49968c18..1b99a4e05 100644
--- a/doc/todo/Allow_edittemplate_to_set_file_type.mdwn
+++ b/doc/todo/Allow_edittemplate_to_set_file_type.mdwn
@@ -14,7 +14,7 @@ edittemplate there. --[[Joey]]
index 98308de..c381940 100644
--- a/IkiWiki/Plugin/edittemplate.pm
+++ b/IkiWiki/Plugin/edittemplate.pm
- @@ -56,8 +56,14 @@ sub preprocess (@) { #{{{
+ @@ -56,8 +56,14 @@ sub preprocess (@) {
$pagestate{$params{page}}{edittemplate}{$params{match}}=$params{template};
@@ -28,10 +28,10 @@ edittemplate there. --[[Joey]]
+
+ return sprintf(gettext("edittemplate: %s registered for %s"),
+ $linkHTML, $params{match});
- } # }}}
+ }
- sub formbuilder (@) { #{{{
- @@ -89,6 +95,9 @@ sub formbuilder (@) { #{{{
+ sub formbuilder (@) {
+ @@ -89,6 +95,9 @@ sub formbuilder (@) {
if (pagespec_match($p, $pagespec, location => $registering_page)) {
$form->field(name => "editcontent",
value => filltemplate($pagestate{$registering_page}{edittemplate}{$pagespec}, $page));
diff --git a/doc/todo/Bestdir_along_with_bestlink_in_IkiWiki.pm.mdwn b/doc/todo/Bestdir_along_with_bestlink_in_IkiWiki.pm.mdwn
index 73157a326..95c38f794 100644
--- a/doc/todo/Bestdir_along_with_bestlink_in_IkiWiki.pm.mdwn
+++ b/doc/todo/Bestdir_along_with_bestlink_in_IkiWiki.pm.mdwn
@@ -8,9 +8,9 @@ This patch adds function bestdir() which returns best directory from the directo
+++ IkiWiki.pm (working copy)
@@ -391,6 +391,35 @@
return "";
- } #}}}
+ }
- +sub bestdir ($$) { #{{{
+ +sub bestdir ($$) {
+ my $page=shift;
+ my $link=shift;
+ my $cwd=$page;
@@ -37,9 +37,9 @@ This patch adds function bestdir() which returns best directory from the directo
+ }
+
+ return "";
- +} #}}}
+ +}
+
- sub isinlinableimage ($) { #{{{
+ sub isinlinableimage ($) {
my $file=shift;
----
diff --git a/doc/todo/Default_text_for_new_pages.mdwn b/doc/todo/Default_text_for_new_pages.mdwn
index 4a17bbf8b..a904f8287 100644
--- a/doc/todo/Default_text_for_new_pages.mdwn
+++ b/doc/todo/Default_text_for_new_pages.mdwn
@@ -15,7 +15,7 @@ Inline below is a [[patch]] that implements this:
index bb21ed2..10c985c 100644
--- a/IkiWiki/Plugin/editpage.pm
+++ b/IkiWiki/Plugin/editpage.pm
- @@ -60,7 +60,7 @@ sub cgi_editpage ($$) { #{{{
+ @@ -60,7 +60,7 @@ sub cgi_editpage ($$) {
decode_cgi_utf8($q);
@@ -24,7 +24,7 @@ Inline below is a [[patch]] that implements this:
my @buttons=("Save Page", "Preview", "Cancel");
eval q{use CGI::FormBuilder};
error($@) if $@;
- @@ -117,9 +117,20 @@ sub cgi_editpage ($$) { #{{{
+ @@ -117,9 +117,20 @@ sub cgi_editpage ($$) {
}
else {
$type=$form->param('type');
@@ -45,7 +45,7 @@ Inline below is a [[patch]] that implements this:
elsif (defined $from && exists $pagesources{$from}) {
# favor the type of linking page
$type=pagetype($pagesources{$from});
- @@ -129,7 +140,7 @@ sub cgi_editpage ($$) { #{{{
+ @@ -129,7 +140,7 @@ sub cgi_editpage ($$) {
if (! $form->submitted) {
$form->field(name => "rcsinfo", value => "", force => 1);
}
@@ -58,7 +58,7 @@ Inline below is a [[patch]] that implements this:
index 8efef3f..075d7d8 100644
--- a/IkiWiki/Plugin/inline.pm
+++ b/IkiWiki/Plugin/inline.pm
- @@ -271,6 +271,7 @@ sub preprocess_inline (@) { #{{{
+ @@ -271,6 +271,7 @@ sub preprocess_inline (@) {
$rootpage=$params{page};
}
$formtemplate->param(rootpage => $rootpage);
diff --git a/doc/todo/Give_access_to_more_TMPL__95__VAR_variables_in_templates_inserted_by_the_template_plugin.mdwn b/doc/todo/Give_access_to_more_TMPL__95__VAR_variables_in_templates_inserted_by_the_template_plugin.mdwn
index a644e236b..c71250b3a 100644
--- a/doc/todo/Give_access_to_more_TMPL__95__VAR_variables_in_templates_inserted_by_the_template_plugin.mdwn
+++ b/doc/todo/Give_access_to_more_TMPL__95__VAR_variables_in_templates_inserted_by_the_template_plugin.mdwn
@@ -94,7 +94,7 @@ most possible of these pages.
> index a6e34fc..bb9dd8d 100644
> --- a/IkiWiki/Plugin/template.pm
> +++ b/IkiWiki/Plugin/template.pm
-> @@ -57,6 +57,8 @@ sub preprocess (@) { #{{{
+> @@ -57,6 +57,8 @@ sub preprocess (@) {
> }
> }
>
diff --git a/doc/todo/Inline_plugin_option_to_show_full_page_path.mdwn b/doc/todo/Inline_plugin_option_to_show_full_page_path.mdwn
index 9f52a724a..691694009 100644
--- a/doc/todo/Inline_plugin_option_to_show_full_page_path.mdwn
+++ b/doc/todo/Inline_plugin_option_to_show_full_page_path.mdwn
@@ -19,7 +19,7 @@ Cheers,
index 59eabb6..82913ba 100644
--- a/IkiWiki/Plugin/inline.pm
+++ b/IkiWiki/Plugin/inline.pm
- @@ -229,6 +229,7 @@ sub preprocess_inline (@) { #{{{
+ @@ -229,6 +229,7 @@ sub preprocess_inline (@) {
$template->param(content => $content);
}
$template->param(pageurl => urlto(bestlink($params{page}, $page), $params{destpage}));
diff --git a/doc/todo/Move_teximg_latex_preamble_to_config_file.mdwn b/doc/todo/Move_teximg_latex_preamble_to_config_file.mdwn
index d94d24ee4..3cedd5ae3 100644
--- a/doc/todo/Move_teximg_latex_preamble_to_config_file.mdwn
+++ b/doc/todo/Move_teximg_latex_preamble_to_config_file.mdwn
@@ -71,10 +71,10 @@ Happy TeXing.
+
+my $default_postfix = '\\end{document}';
+
- sub import { #{{{
+ sub import {
hook(type => "getsetup", id => "teximg", call => \&getsetup);
hook(type => "preprocess", id => "teximg", call => \&preprocess);
- @@ -21,6 +33,26 @@ sub getsetup () { #{{{
+ @@ -21,6 +33,26 @@ sub getsetup () {
safe => 1,
rebuild => undef,
},
@@ -98,10 +98,10 @@ Happy TeXing.
+ safe => 0, # Not sure how secure LaTeX is...
+ rebuild => 1,
+ },
- } #}}}
+ }
- sub preprocess (@) { #{{{
- @@ -105,25 +137,35 @@ sub gen_image ($$$$) { #{{{
+ sub preprocess (@) {
+ @@ -105,25 +137,35 @@ sub gen_image ($$$$) {
my $digest = shift;
my $imagedir = shift;
diff --git a/doc/todo/Set_arbitrary_date_to_be_used_by_calendar_plugin.mdwn b/doc/todo/Set_arbitrary_date_to_be_used_by_calendar_plugin.mdwn
index a26433919..89167c084 100644
--- a/doc/todo/Set_arbitrary_date_to_be_used_by_calendar_plugin.mdwn
+++ b/doc/todo/Set_arbitrary_date_to_be_used_by_calendar_plugin.mdwn
@@ -42,13 +42,13 @@ Longer term plans:
my %cache;
my %linkcache;
@@ -32,6 +34,7 @@
- sub import { #{{{
+ sub import {
hook(type => "needsbuild", id => "version", call => \&needsbuild);
hook(type => "preprocess", id => "calendar", call => \&preprocess);
+ hook(type => "preprocess", id => "event", call => \&preprocess_event);
- } #}}}
+ }
- sub is_leap_year (@) { #{{{
+ sub is_leap_year (@) {
@@ -58,6 +61,7 @@
my $nmonth = $params{nmonth};
my $pyear = $params{pyear};
@@ -137,9 +137,9 @@ Longer term plans:
# finish off the week
@@ -304,6 +333,18 @@
return $calendar;
- } #}}}
+ }
- +sub preprocess_event (@) { #{{{
+ +sub preprocess_event (@) {
+ my %params=@_;
+ # if now time is given, use now
+ $params{begin} = localtime($time) unless defined $params{begin};
@@ -151,7 +151,7 @@ Longer term plans:
+ return "<!-- $params{begin} -->";
+} #}}
+
- sub preprocess (@) { #{{{
+ sub preprocess (@) {
my %params=@_;
$params{pages} = "*" unless defined $params{pages};
@@ -311,6 +352,8 @@
diff --git a/doc/todo/Silence_monotone_warning.mdwn b/doc/todo/Silence_monotone_warning.mdwn
index e3f0224c2..d875900c5 100644
--- a/doc/todo/Silence_monotone_warning.mdwn
+++ b/doc/todo/Silence_monotone_warning.mdwn
@@ -4,7 +4,7 @@ A quick [[patch]] to silence a [[rcs/monotone]] warning I started seeing:
index 4b9be31..9d4e280 100644
--- a/IkiWiki/Plugin/monotone.pm
+++ b/IkiWiki/Plugin/monotone.pm
- @@ -55,7 +55,7 @@ sub checkconfig () { #{{{
+ @@ -55,7 +55,7 @@ sub checkconfig () {
error("Monotone version too old, is $version but required 0.38");
}
diff --git a/doc/todo/Support_wildcard_inside_of_link__40____41___within_a_pagespec.mdwn b/doc/todo/Support_wildcard_inside_of_link__40____41___within_a_pagespec.mdwn
index 2837634d9..8320f72a6 100644
--- a/doc/todo/Support_wildcard_inside_of_link__40____41___within_a_pagespec.mdwn
+++ b/doc/todo/Support_wildcard_inside_of_link__40____41___within_a_pagespec.mdwn
@@ -20,7 +20,7 @@ That doesn't work in ikiwiki 2.1, but I have it
index 38aa46a..cd42e8d 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
- @@ -1082,10 +1082,15 @@ sub match_link ($$;@) { #{{{
+ @@ -1082,10 +1082,15 @@ sub match_link ($$;@) {
my $links = $IkiWiki::links{$page} or return undef;
return IkiWiki::FailReason->new("$page has no links") unless @$links;
my $bestlink = IkiWiki::bestlink($from, $link);
@@ -38,7 +38,7 @@ That doesn't work in ikiwiki 2.1, but I have it
+ }
}
return IkiWiki::FailReason->new("$page does not link to $link");
- } #}}}
+ }
--
1.5.1.1.g6aead
diff --git a/doc/todo/Wrapper_config_with_multiline_regexp.mdwn b/doc/todo/Wrapper_config_with_multiline_regexp.mdwn
index c0311bc92..7b4323de1 100644
--- a/doc/todo/Wrapper_config_with_multiline_regexp.mdwn
+++ b/doc/todo/Wrapper_config_with_multiline_regexp.mdwn
@@ -13,12 +13,12 @@ Second, the untainting of $configstring should allow newlines.
+++ wiki-meta/perl/IkiWiki.pm Mon Jun 11 10:52:07 2007
@@ -205,7 +205,7 @@
- sub possibly_foolish_untaint ($) { #{{{
+ sub possibly_foolish_untaint ($) {
my $tainted=shift;
- my ($untainted)=$tainted=~/(.*)/;
+ my ($untainted)=$tainted=~/(.*)/s;
return $untainted;
- } #}}}
+ }
Modified: wiki-meta/perl/IkiWiki/Wrapper.pm
diff --git a/doc/todo/add_forward_age_sorting_option_to_inline.mdwn b/doc/todo/add_forward_age_sorting_option_to_inline.mdwn
index 684419f90..e91c5a42f 100644
--- a/doc/todo/add_forward_age_sorting_option_to_inline.mdwn
+++ b/doc/todo/add_forward_age_sorting_option_to_inline.mdwn
@@ -19,7 +19,7 @@ diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm
index d2e5832..9e52712 100644
--- a/IkiWiki/Plugin/inline.pm
+++ b/IkiWiki/Plugin/inline.pm
-@@ -194,6 +194,9 @@ sub preprocess_inline (@) { #{{{
+@@ -194,6 +194,9 @@ sub preprocess_inline (@) {
elsif (! exists $params{sort} || $params{sort} eq 'age') {
@list=sort { $pagectime{$b} <=> $pagectime{$a} } @list;
}
diff --git a/doc/todo/automatic_use_of_syntax_plugin_on_source_code_files/discussion.mdwn b/doc/todo/automatic_use_of_syntax_plugin_on_source_code_files/discussion.mdwn
index 467ec350e..dc6c0001e 100644
--- a/doc/todo/automatic_use_of_syntax_plugin_on_source_code_files/discussion.mdwn
+++ b/doc/todo/automatic_use_of_syntax_plugin_on_source_code_files/discussion.mdwn
@@ -17,13 +17,13 @@ Updated to use fix noted in [[bugs/multiple_pages_with_same_name]].
my %metaheaders;
- sub import { #{{{
+ sub import {
hook(type => "getsetup", id => "sourcecode", call => \&getsetup);
hook(type => "checkconfig", id => "sourcecode", call => \&checkconfig);
hook(type => "pagetemplate", id => "sourcecode", call => \&pagetemplate);
- } # }}}
+ }
- sub getsetup () { #{{{
+ sub getsetup () {
return
plugin => {
safe => 1,
@@ -57,9 +57,9 @@ Updated to use fix noted in [[bugs/multiple_pages_with_same_name]].
safe => 1,
rebuild => 1,
},
- } #}}}
+ }
- sub checkconfig () { #{{{
+ sub checkconfig () {
if (! $config{sourcecode_lang}) {
error("The sourcecode plugin requires a list of suffixes in the 'sourcecode_lang' config option");
}
@@ -97,9 +97,9 @@ Updated to use fix noted in [[bugs/multiple_pages_with_same_name]].
error("Your installation of source-highlight cannot handle sourcecode language $lang!");
}
}
- } #}}}
+ }
- sub htmlize (@) { #{{{
+ sub htmlize (@) {
my %params=@_;
my $page = $params{page};
@@ -141,9 +141,9 @@ Updated to use fix noted in [[bugs/multiple_pages_with_same_name]].
}
return '<div id="sourcecode">'."\r\n".join("\r\n",@html)."\r\n</div>\n";
- } # }}}
+ }
- sub pagetemplate (@) { #{{{
+ sub pagetemplate (@) {
my %params=@_;
my $page=$params{page};
@@ -154,6 +154,6 @@ Updated to use fix noted in [[bugs/multiple_pages_with_same_name]].
my %seen;
$template->param(meta => join("\n", grep { (! $seen{$_}) && ($seen{$_}=1) } @{$metaheaders{$page}}));
}
- } # }}}
+ }
1
diff --git a/doc/todo/blogpost_plugin.mdwn b/doc/todo/blogpost_plugin.mdwn
index 60b1e2515..bb91ffd02 100644
--- a/doc/todo/blogpost_plugin.mdwn
+++ b/doc/todo/blogpost_plugin.mdwn
@@ -51,13 +51,13 @@ Index: IkiWiki/Plugin/blogpost.pm
+use POSIX;
+use IkiWiki 2.00;
+
-+sub import { #{{{
++sub import {
+ hook(type => "checkconfig", id => "blogpost", call => \&checkconfig);
+ hook(type => "authcgi", id => "blogpost", call => \&authcgi);
+ hook(type => "canedit", id => "blogpost", call => \&canedit);
-+} # }}}
++}
+
-+sub checkconfig () { #{{{
++sub checkconfig () {
+ if (! defined $config{blogformat}){
+ $config{blogformat} = 'posts/%Y/%m/%d/$title';
+ }
@@ -72,9 +72,9 @@ Index: IkiWiki/Plugin/blogpost.pm
+ if (! defined $config{blogusers}) {
+ $config{blogusers} = (); # disallow all posting by default
+ }
-+} #}}}
++}
+
-+sub authcgi ($$) { #{{{
++sub authcgi ($$) {
+ my $cgi=shift;
+ my $session=shift;
+
@@ -115,16 +115,16 @@ Index: IkiWiki/Plugin/blogpost.pm
+ $cgi->param("page", $page);
+ }
+
-+} #}}}
++}
+
-+sub blogpage ($) { #{{{
++sub blogpage ($) {
+ my $title=shift;
+ my $page=POSIX::strftime $config{blogformat}, localtime;
+ $page =~ s/\$title/$title/;
+ return $page;
-+} #}}}
++}
+
-+sub canedit ($$$) { #{{{
++sub canedit ($$$) {
+ my $page=shift;
+ my $cgi=shift;
+ my $session=shift;
@@ -136,7 +136,7 @@ Index: IkiWiki/Plugin/blogpost.pm
+ return "" if ($config{blogusers} eq "*" ||
+ grep {$_ eq $user} $config{blogusers});
+ return ("not allowed to blog, $user");
-+} #}}}
++}
+
+1
Index: IkiWiki.pm
diff --git a/doc/todo/bzr.mdwn b/doc/todo/bzr.mdwn
index 179ea2f24..a50c58d26 100644
--- a/doc/todo/bzr.mdwn
+++ b/doc/todo/bzr.mdwn
@@ -56,15 +56,15 @@ and rcs_getctime and rcs_notify aren't written at all. --[[bma]]
return @ret;
}
- sub rcs_update () { #{{{
+ sub rcs_update () {
# Not needed.
- } #}}}
+ }
- sub rcs_prepedit ($) { #{{{
+ sub rcs_prepedit ($) {
return "";
- } #}}}
+ }
- sub rcs_commit ($$$;$$) { #{{{
+ sub rcs_commit ($$$;$$) {
my ($file, $message, $rcstoken, $user, $ipaddr) = @_;
if (defined $user) {
@@ -95,18 +95,18 @@ and rcs_getctime and rcs_notify aren't written at all. --[[bma]]
system("bzr","whoami",$olduser);
return undef; # success
- } #}}}
+ }
- sub rcs_add ($) { # {{{
+ sub rcs_add ($) {
my ($file) = @_;
my @cmdline = ("bzr", "add", "--quiet", "$config{srcdir}/$file");
if (system(@cmdline) != 0) {
warn "'@cmdline' failed: $!";
}
- } #}}}
+ }
- sub rcs_recentchanges ($) { #{{{
+ sub rcs_recentchanges ($) {
my ($num) = @_;
eval q{use CGI 'escapeHTML'};
@@ -153,15 +153,15 @@ and rcs_getctime and rcs_notify aren't written at all. --[[bma]]
}
return @ret;
- } #}}}
+ }
- sub rcs_notify () { #{{{
+ sub rcs_notify () {
# TODO
- } #}}}
+ }
- sub rcs_getctime ($) { #{{{
+ sub rcs_getctime ($) {
# TODO
- } #}}}
+ }
1
diff --git a/doc/todo/cas_authentication.mdwn b/doc/todo/cas_authentication.mdwn
index c8ffe7005..8bf7042df 100644
--- a/doc/todo/cas_authentication.mdwn
+++ b/doc/todo/cas_authentication.mdwn
@@ -43,11 +43,11 @@ follows) ?
> the use of it: `eval q{use AuthCAS}; error $@ if $@`
+
- +sub import { #{{{
+ +sub import {
+ hook(type => "getopt", id => "cas", call => \&getopt);
+ hook(type => "auth", id => "cas", call => \&auth);
+ hook(type => "formbuilder_setup", id => "cas", call => \&formbuilder_setup);
- +} # }}}
+ +}
> Could you please use tabs for indentation of program flow?
@@ -61,15 +61,15 @@ follows) ?
> Why would you want to make other auth plugins not work? Could a site not
> legitimatly chose to use this and another auth method?
- +sub getopt () { #{{{
+ +sub getopt () {
+ eval q{use Getopt::Long};
+ error($@) if $@;
+ Getopt::Long::Configure('pass_through');
+ GetOptions("cas_url=s" => \$config{cas_url});
+ GetOptions("ca_file=s" => \$config{ca_file});
- +} #}}}
+ +}
+
- +sub auth ($$) { #{{{
+ +sub auth ($$) {
+ my $q=shift;
+ my $session=shift;
+
@@ -98,11 +98,11 @@ follows) ?
+ error("CAS failure: ".&AuthCAS::get_errors());
+ }
+ }
- +} #}}}
+ +}
+
+# I use formbuilder_setup and not formbuilder type in order to bypass the
+# Logout processing done in IkiWiki::CGI::cgi_prefs()
- +sub formbuilder_setup (@) { #{{{
+ +sub formbuilder_setup (@) {
+ my %params=@_;
+
+ my $form=$params{form};
diff --git a/doc/todo/color_plugin.mdwn b/doc/todo/color_plugin.mdwn
index 69afe837d..19fba3b35 100644
--- a/doc/todo/color_plugin.mdwn
+++ b/doc/todo/color_plugin.mdwn
@@ -132,12 +132,12 @@ Of course, I'm open for discussion or exchange of ideas :) --[[Paweł|ptecza]]
+use strict;
+use IkiWiki 2.00;
+
- +sub import { #{{{
+ +sub import {
+ hook(type => "preprocess", id => "color", call => \&preprocess);
+ hook(type => "format", id => "color", call => \&format);
- +} #}}}
+ +}
+
- +sub preserve_style ($$$) { #{{{
+ +sub preserve_style ($$$) {
+ my $foreground = shift;
+ my $background = shift;
+ my $text = shift;
@@ -162,18 +162,18 @@ Of course, I'm open for discussion or exchange of ideas :) --[[Paweł|ptecza]]
+
+ return $preserved;
+
- +} #}}}
+ +}
+
- +sub replace_preserved_style ($) { #{{{
+ +sub replace_preserved_style ($) {
+ my $content = shift;
+
+ $content =~ s!<span class="color">((color: ([a-z]+|\#[0-9a-f]{3,6})?)?((; )?(background-color: ([a-z]+|\#[0-9a-f]{3,6})?)?)?)</span>!<span class="color" style="$1">!g;
+ $content =~ s!<span class="colorend">!!g;
+
+ return $content;
- +} #}}}
+ +}
+
- +sub preprocess (@) { #{{{
+ +sub preprocess (@) {
+ my %params = @_;
+
+ # Preprocess the text to expand any preprocessor directives
@@ -182,14 +182,14 @@ Of course, I'm open for discussion or exchange of ideas :) --[[Paweł|ptecza]]
+ IkiWiki::filter($params{page}, $params{destpage}, $params{text}));
+
+ return preserve_style($params{foreground}, $params{background}, $params{text});
- +} #}}}
+ +}
+
- +sub format (@) { #{{{
+ +sub format (@) {
+ my %params = @_;
+
+ $params{content} = replace_preserved_style($params{content});
+ return $params{content};
- +} #}}}
+ +}
+
+1
--- /dev/null 2008-06-21 02:02:15.000000000 +0200
diff --git a/doc/todo/darcs.mdwn b/doc/todo/darcs.mdwn
index e5bf5ee27..882a41379 100644
--- a/doc/todo/darcs.mdwn
+++ b/doc/todo/darcs.mdwn
@@ -219,14 +219,14 @@ This is my ([bma](bma@bmalee.eu)) darcs.pm - it's messy (my Perl isn't up to muc
package IkiWiki;
- sub rcs_update () { #{{{
+ sub rcs_update () {
# Do nothing - there's nowhere to update *from*.
- } #}}}
+ }
- sub rcs_prepedit ($) { #{{{
- } #}}}
+ sub rcs_prepedit ($) {
+ }
- sub rcs_commit ($$$;$$) { #{{{
+ sub rcs_commit ($$$;$$) {
my ($file, $message, $rcstoken, $user, $ipaddr) = @_;
# $user should probably be a name and an email address, by darcs
@@ -257,16 +257,16 @@ This is my ([bma](bma@bmalee.eu)) darcs.pm - it's messy (my Perl isn't up to muc
return undef; # success
- sub rcs_add ($) { # {{{
+ sub rcs_add ($) {
my ($file) = @_;
my @cmdline = ("darcs", "add", "--repodir", "$config{srcdir}", "-a", "-q", "$file");
if (system(@cmdline) != 0) {
warn "'@cmdline' failed: $!";
}
- } #}}}
+ }
- sub rcs_recentchanges ($) { #{{{
+ sub rcs_recentchanges ($) {
# TODO: This is horrible code. It doesn't work perfectly, and uses regexes
# rather than parsing Darcs' XML output.
my $num=shift;
@@ -314,15 +314,15 @@ This is my ([bma](bma@bmalee.eu)) darcs.pm - it's messy (my Perl isn't up to muc
}
}
return @ret;
- } #}}}
+ }
- sub rcs_notify () { #{{{
+ sub rcs_notify () {
# TODO
- } #}}}
+ }
- sub rcs_getctime ($) { #{{{
+ sub rcs_getctime ($) {
error gettext("getctime not implemented");
- } #}}}
+ }
1
diff --git a/doc/todo/datearchives-plugin.mdwn b/doc/todo/datearchives-plugin.mdwn
index 5a5560d6c..5f33cde4c 100644
--- a/doc/todo/datearchives-plugin.mdwn
+++ b/doc/todo/datearchives-plugin.mdwn
@@ -17,11 +17,11 @@ Index: IkiWiki/Plugin/datearchives.pm
+use strict;
+use IkiWiki;
+
-+sub import { #{{{
++sub import {
+ hook(type => "pagetemplate", id => "datearchives", call => \&pagetemplate, scan => 1);
-+} # }}}
++}
+
-+sub pagetemplate (@) { #{{{
++sub pagetemplate (@) {
+ my %args = @_;
+ my $dt;
+ eval {
@@ -37,7 +37,7 @@ Index: IkiWiki/Plugin/datearchives.pm
+ $template->param(ctime => htmllink( $args{page}, $args{destpage}, $link, 0, 0,
+ $template->param('ctime')));
+ }
-+} # }}}
++}
+
+1
</pre>
diff --git a/doc/todo/different_search_engine.mdwn b/doc/todo/different_search_engine.mdwn
index 2f309dea5..9d0fc92c9 100644
--- a/doc/todo/different_search_engine.mdwn
+++ b/doc/todo/different_search_engine.mdwn
@@ -126,7 +126,7 @@ Index: IkiWiki/Plugin/search.pm
+ $PLUCENE_DIR = $config{wikistatedir}.'/plucene';
+}
+
- sub import { #{{{
+ sub import {
- hook(type => "getopt", id => "hyperestraier",
- call => \&amp;getopt);
- hook(type => "checkconfig", id => "hyperestraier",
@@ -142,14 +142,14 @@ Index: IkiWiki/Plugin/search.pm
call => \&amp;change);
- hook(type => "cgi", id => "hyperestraier",
- call => \&amp;cgi);
- } # }}}
+ }
--sub getopt () { #{{{
+-sub getopt () {
- eval q{use Getopt::Long};
- error($@) if $@;
- Getopt::Long::Configure('pass_through');
- GetOptions("estseek=s" => \$config{estseek});
--} #}}}
+-}
+sub writer {
+ init();
@@ -165,20 +165,20 @@ Index: IkiWiki/Plugin/search.pm
+ grep { defined pagetype($_) } @_;
+}
+
- sub checkconfig () { #{{{
+ sub checkconfig () {
foreach my $required (qw(url cgiurl)) {
if (! length $config{$required}) {
@@ -36,112 +58,55 @@
}
- } #}}}
+ }
-my $form;
--sub pagetemplate (@) { #{{{
+-sub pagetemplate (@) {
- my %params=@_;
- my $page=$params{page};
- my $template=$params{template};
+#my $form;
-+#sub pagetemplate (@) { #{{{
++#sub pagetemplate (@) {
+# my %params=@_;
+# my $page=$params{page};
+# my $template=$params{template};
@@ -193,7 +193,7 @@ Index: IkiWiki/Plugin/search.pm
+#
+# $template->param(searchform => $form);
+# }
-+#} #}}}
++#}
- # Add search box to page header.
- if ($template->query(name => "searchform")) {
@@ -205,9 +205,9 @@ Index: IkiWiki/Plugin/search.pm
-
- $template->param(searchform => $form);
- }
--} #}}}
+-}
-
- sub delete (@) { #{{{
+ sub delete (@) {
- debug(gettext("cleaning hyperestraier search index"));
- estcmd("purge -cl");
- estcfg();
@@ -219,9 +219,9 @@ Index: IkiWiki/Plugin/search.pm
+ $reader->delete_term( Plucene::Index::Term->new({ field => "id", text => $_ }));
+ }
+ $reader->close;
- } #}}}
+ }
- sub change (@) { #{{{
+ sub change (@) {
- debug(gettext("updating hyperestraier search index"));
- estcmd("gather -cm -bc -cl -sd",
- map {
@@ -250,9 +250,9 @@ Index: IkiWiki/Plugin/search.pm
+ $doc->add(Plucene::Document::Field->UnStored('text' => $data));
+ $writer->add_document($doc);
+ }
- } #}}}
+ }
-
--sub cgi ($) { #{{{
+-sub cgi ($) {
- my $cgi=shift;
-
- if (defined $cgi->param('phrase') || defined $cgi->param("navi")) {
@@ -260,10 +260,10 @@ Index: IkiWiki/Plugin/search.pm
- chdir("$config{wikistatedir}/hyperestraier") || error("chdir: $!");
- exec("./".IkiWiki::basename($config{cgiurl})) || error("estseek.cgi failed");
- }
--} #}}}
+-}
-
-my $configured=0;
--sub estcfg () { #{{{
+-sub estcfg () {
- return if $configured;
- $configured=1;
-
@@ -301,9 +301,9 @@ Index: IkiWiki/Plugin/search.pm
- unlink($cgi);
- my $estseek = defined $config{estseek} ? $config{estseek} : '/usr/lib/estraier/estseek.cgi';
- symlink($estseek, $cgi) || error("symlink $estseek $cgi: $!");
--} # }}}
+-}
-
--sub estcmd ($;@) { #{{{
+-sub estcmd ($;@) {
- my @params=split(' ', shift);
- push @params, "-cl", "$config{wikistatedir}/hyperestraier";
- if (@_) {
@@ -323,7 +323,7 @@ Index: IkiWiki/Plugin/search.pm
- open(STDOUT, "/dev/null"); # shut it up (closing won't work)
- exec("estcmd", @params) || error("can't run estcmd");
- }
--} #}}}
+-}
-
-1
+1;
diff --git a/doc/todo/directive_docs.mdwn b/doc/todo/directive_docs.mdwn
index 1f6307381..2baa61b40 100644
--- a/doc/todo/directive_docs.mdwn
+++ b/doc/todo/directive_docs.mdwn
@@ -40,15 +40,15 @@ defined them: --[[Joey]]
index e476521..afe982a 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
- @@ -493,6 +493,7 @@ sub loadplugins () { #{{{
+ @@ -493,6 +493,7 @@ sub loadplugins () {
return 1;
- } #}}}
+ }
+my $loading_plugin;
- sub loadplugin ($) { #{{{
+ sub loadplugin ($) {
my $plugin=shift;
- @@ -502,14 +503,18 @@ sub loadplugin ($) { #{{{
+ @@ -502,14 +503,18 @@ sub loadplugin ($) {
"$installdir/lib/ikiwiki") {
if (defined $dir && -x "$dir/plugins/$plugin") {
require IkiWiki::Plugin::external;
@@ -67,7 +67,7 @@ defined them: --[[Joey]]
if ($@) {
error("Failed to load plugin $mod: $@");
}
- @@ -1429,6 +1434,9 @@ sub hook (@) { # {{{
+ @@ -1429,6 +1434,9 @@ sub hook (@) {
return if $param{no_override} && exists $hooks{$param{type}}{$param{id}};
@@ -76,4 +76,4 @@ defined them: --[[Joey]]
+
$hooks{$param{type}}{$param{id}}=\%param;
return 1;
- } # }}}
+ }
diff --git a/doc/todo/enable-htaccess-files.mdwn b/doc/todo/enable-htaccess-files.mdwn
index b3c174fba..e3b295123 100644
--- a/doc/todo/enable-htaccess-files.mdwn
+++ b/doc/todo/enable-htaccess-files.mdwn
@@ -5,7 +5,7 @@
@@ -26,7 +26,7 @@
memoize("file_pruned");
- sub defaultconfig () { #{{{
+ sub defaultconfig () {
- wiki_file_prune_regexps => [qr/\.\./, qr/^\./, qr/\/\./,
+ wiki_file_prune_regexps => [qr/\.\./, qr/^\.(?!htaccess)/, qr/\/\.(?!htaccess)/,
qr/\.x?html?$/, qr/\.ikiwiki-new$/,
diff --git a/doc/todo/format_escape.mdwn b/doc/todo/format_escape.mdwn
index 8dfe05581..574883d1b 100644
--- a/doc/todo/format_escape.mdwn
+++ b/doc/todo/format_escape.mdwn
@@ -141,13 +141,13 @@ Index: IkiWiki/Plugin/rst.pm
print html[html.find('<body>')+6:html.find('</body>')].strip();
";
- sub import { #{{{
+ sub import {
hook(type => "htmlize", id => "rst", call => \&htmlize);
+ hook(type => "htmlescape", id => "rst", call => \&htmlescape);
+ hook(type => "htmlescapelink", id => "rst", call => \&htmlescapelink);
- } # }}}
+ }
-+sub htmlescapelink ($$;@) { #{{{
++sub htmlescapelink ($$;@) {
+ my $url = shift;
+ my $text = shift;
+ my %params = @_;
@@ -158,15 +158,15 @@ Index: IkiWiki/Plugin/rst.pm
+ else {
+ return "`$text <$url>`_";
+ }
-+} # }}}
++}
+
-+sub htmlescape ($) { #{{{
++sub htmlescape ($) {
+ my $html=shift;
+ $html=~s/^/ /mg;
+ return ".. raw:: html\n\n".$html;
-+} # }}}
++}
+
- sub htmlize (@) { #{{{
+ sub htmlize (@) {
my %params=@_;
my $content=$params{content};
Index: doc/plugins/write.mdwn
@@ -272,7 +272,7 @@ Index: IkiWiki.pm
+ return $hooks{htmlescapelink}{$type}{call}->($bestlink, $linktext);
+ }
return "<a href=\"$bestlink\">$linktext</a>";
- } #}}}
+ }
@@ -628,6 +640,14 @@
preview => $preprocess_preview,
diff --git a/doc/todo/fortune:_select_options_via_environment.mdwn b/doc/todo/fortune:_select_options_via_environment.mdwn
index f906312fe..ddacd91b5 100644
--- a/doc/todo/fortune:_select_options_via_environment.mdwn
+++ b/doc/todo/fortune:_select_options_via_environment.mdwn
@@ -14,9 +14,9 @@
package IkiWiki::Plugin::fortune;
use warnings;
- @@ -12,7 +18,13 @@ sub import { #{{{
+ @@ -12,7 +18,13 @@ sub import {
- sub preprocess (@) { #{{{
+ sub preprocess (@) {
$ENV{PATH}="$ENV{PATH}:/usr/games:/usr/local/games";
- my $f = `fortune 2>/dev/null`;
+ my $f;
diff --git a/doc/todo/index.html_allowed.mdwn b/doc/todo/index.html_allowed.mdwn
index f030f9eea..f5e6f8cd7 100644
--- a/doc/todo/index.html_allowed.mdwn
+++ b/doc/todo/index.html_allowed.mdwn
@@ -91,15 +91,15 @@ page "A/B/index.html" is treated as "A/B".
+++ ikidev/IkiWiki.pm 2007-02-25 15:05:22.328852000 -0800
@@ -192,6 +192,12 @@
return $untainted;
- } #}}}
+ }
- +sub titlename($;@) { #{{{
+ +sub titlename($;@) {
+ my $page = shift;
+ $page =~ s!/index$!!;
+ return pagetitle(basename($page), @_);
- +} #}}}
+ +}
+
- sub basename ($) { #{{{
+ sub basename ($) {
my $file=shift;
@@ -117,7 +117,7 @@ diff -ru ikiwiki-2.4/IkiWiki.pm ikiwiki/IkiWiki.pm
$page=~s/\Q.$type\E*$// if defined $type;
+ $page=~s/\/index$// if $page =~ /\/index$/;
return $page;
- } #}}}
+ }
</pre>
diff --git a/doc/todo/inline:_numerical_ordering_by_title.mdwn b/doc/todo/inline:_numerical_ordering_by_title.mdwn
index 95511d998..3f6c8b598 100644
--- a/doc/todo/inline:_numerical_ordering_by_title.mdwn
+++ b/doc/todo/inline:_numerical_ordering_by_title.mdwn
@@ -155,11 +155,11 @@ Joey, have you forgotten about that request? ;) --[[Paweł|ptecza]]
%config %links %pagestate %renderedfiles
%pagesources %destsources);
our $VERSION = 2.00; # plugin interface version, next is ikiwiki version
- @@ -835,6 +835,42 @@ sub titlepage ($) { #{{{
+ @@ -835,6 +835,42 @@ sub titlepage ($) {
return $title;
- } #}}}
+ }
- +sub titlecmp ($$) { #{{{
+ +sub titlecmp ($$) {
+ my $titleA=shift;
+ my $titleB=shift;
+
@@ -193,29 +193,29 @@ Joey, have you forgotten about that request? ;) --[[Paweł|ptecza]]
+ return -1 if (@listB);
+
+ return 0;
- +} #}}}
+ +}
+
- sub linkpage ($) { #{{{
+ sub linkpage ($) {
my $link=shift;
my $chars = defined $config{wiki_file_chars} ? $config{wiki_file_chars} : "-[:alnum:]+/.:_";
diff --git a/IkiWiki/Plugin/brokenlinks.pm b/IkiWiki/Plugin/brokenlinks.pm
index 37752dd..ccaa399 100644
--- a/IkiWiki/Plugin/brokenlinks.pm
+++ b/IkiWiki/Plugin/brokenlinks.pm
- @@ -59,7 +59,7 @@ sub preprocess (@) { #{{{
+ @@ -59,7 +59,7 @@ sub preprocess (@) {
map {
"<li>$_</li>"
}
- sort @broken)
+ sort titlecmp @broken)
."</ul>\n";
- } # }}}
+ }
diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm
index 8efef3f..263e7a6 100644
--- a/IkiWiki/Plugin/inline.pm
+++ b/IkiWiki/Plugin/inline.pm
- @@ -192,7 +192,7 @@ sub preprocess_inline (@) { #{{{
+ @@ -192,7 +192,7 @@ sub preprocess_inline (@) {
}
if (exists $params{sort} && $params{sort} eq 'title') {
@@ -228,20 +228,20 @@ Joey, have you forgotten about that request? ;) --[[Paweł|ptecza]]
index b910758..10a1d87 100644
--- a/IkiWiki/Plugin/orphans.pm
+++ b/IkiWiki/Plugin/orphans.pm
- @@ -56,7 +56,7 @@ sub preprocess (@) { #{{{
+ @@ -56,7 +56,7 @@ sub preprocess (@) {
htmllink($params{page}, $params{destpage}, $_,
noimageinline => 1).
"</li>"
- } sort @orphans).
+ } sort titlecmp @orphans).
"</ul>\n";
- } # }}}
+ }
diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm
index ceb7c84..00798e1 100644
--- a/IkiWiki/Render.pm
+++ b/IkiWiki/Render.pm
- @@ -89,7 +89,7 @@ sub genpage ($$) { #{{{
+ @@ -89,7 +89,7 @@ sub genpage ($$) {
$template->param(have_actions => 1);
}
diff --git a/doc/todo/language_definition_for_the_meta_plugin.mdwn b/doc/todo/language_definition_for_the_meta_plugin.mdwn
index 33098c601..4ac4e2e25 100644
--- a/doc/todo/language_definition_for_the_meta_plugin.mdwn
+++ b/doc/todo/language_definition_for_the_meta_plugin.mdwn
@@ -54,7 +54,7 @@ This may be useful for sites with a few pages in different languages, but no ful
my %authorurl;
+my %lang;
- sub import { #{{{
+ sub import {
hook(type => "preprocess", id => "meta", call => \&preprocess, scan => 1);
@@ -100,6 +101,11 @@
$meta{$page}.='<link href="'.encode_entities($value).
@@ -75,7 +75,7 @@ This may be useful for sites with a few pages in different languages, but no ful
+ $template->param(lang => $lang{$page})
+ if exists $lang{$page} && $template->query(name => "lang");
- } # }}}
+ }
</pre>
> Please resolve lang somewhere reusable rather than within meta plugin: It is certainly usable outside
diff --git a/doc/todo/meta_rcsid.mdwn b/doc/todo/meta_rcsid.mdwn
index 81a2c1328..158edea6e 100644
--- a/doc/todo/meta_rcsid.mdwn
+++ b/doc/todo/meta_rcsid.mdwn
@@ -26,7 +26,7 @@ of CVS/SVN-style keywords (like '$Id$', etc.) from the source file in the page t
my %copyright;
+my %rcsid;
- sub import { #{{{
+ sub import {
hook(type => "preprocess", id => "meta", call => \&preprocess, scan => 1);
@@ -110,6 +111,9 @@
$meta{$page}.="<link rel=\"copyright\" href=\"#page_copyright\" />\n";
diff --git a/doc/todo/missingparents.pm.mdwn b/doc/todo/missingparents.pm.mdwn
index 0cc7137ba..c5f2ab535 100644
--- a/doc/todo/missingparents.pm.mdwn
+++ b/doc/todo/missingparents.pm.mdwn
@@ -82,15 +82,15 @@ Index: IkiWiki/Plugin/missingparents.pm
+my %ownfiles;
+my @pagespecs;
+
-+sub import { #{{{
++sub import {
+ hook(type => "checkconfig", id => "missingparents", call => \&checkconfig);
+ hook(type => "needsdelete", id => "missingparents", call => \&needsdelete);
+ hook(type => "needsbuild", id => "missingparents", call => \&needsbuild);
+ hook(type => "savestate", id => "missingparents", call => \&savestate);
+ hook(type => "preprocess", id => "missingparents", call => \&preprocess_missingparents);
-+} # }}}
++}
+
-+sub checkconfig () { #{{{
++sub checkconfig () {
+ IkiWiki::preprocess("missingparents", "missingparents",
+ readfile(srcfile("missingparents.mdwn")));
+ loadstate();
@@ -99,9 +99,9 @@ Index: IkiWiki/Plugin/missingparents.pm
+ unlink $config{srcdir}.'/'.$file;
+ }
+ }
-+} #}}}
++}
+
-+sub preprocess_missingparents (@) { #{{{
++sub preprocess_missingparents (@) {
+ my %params=@_;
+
+ if (! defined $params{pages} || ! defined $params{generate}) {
@@ -115,10 +115,10 @@ Index: IkiWiki/Plugin/missingparents.pm
+ #translators: is text for pages that match that pagespec.
+ return sprintf(gettext("missingparents in %s will be %s"),
+ '`'.$params{pages}.'`', '`\\'.$params{generate}.'`');
-+} # }}}
++}
+
+my $state_loaded=0;
-+sub loadstate() { #{{{
++sub loadstate() {
+ my $filename = "$config{wikistatedir}/missingparents";
+ if (-e $filename) {
+ open (IN, $filename) ||
@@ -132,9 +132,9 @@ Index: IkiWiki/Plugin/missingparents.pm
+
+ $state_loaded=1;
+ }
-+} #}}}
++}
+
-+sub savestate() { #{{{
++sub savestate() {
+ my $filename = "$config{wikistatedir}/missingparents.new";
+ my $cleanup = sub { unlink ($filename) };
+ open (OUT, ">$filename") || error("open $filename: $!", $cleanup);
@@ -143,9 +143,9 @@ Index: IkiWiki/Plugin/missingparents.pm
+ }
+ rename($filename, "$config{wikistatedir}/missingparents") ||
+ error("rename $filename: $!", $cleanup);
-+} #}}}
++}
+
-+sub needsdelete (@) { #{{{
++sub needsdelete (@) {
+ my $files=shift;
+
+ my @mydel;
@@ -167,9 +167,9 @@ Index: IkiWiki/Plugin/missingparents.pm
+ foreach my $page (@mydel){
+ push @{$files}, $page;
+ }
-+} #}}}
++}
+
-+sub check_matches($) { #{{{
++sub check_matches($) {
+ my $page = shift;
+ return if $IkiWiki::pagesources{$page};
+
@@ -183,9 +183,9 @@ Index: IkiWiki/Plugin/missingparents.pm
+ return $output;
+ }
+ return "";
-+} #}}}
++}
+
-+sub needsbuild ($) { #{{{
++sub needsbuild ($) {
+ my $files=shift;
+ my @new;
+
@@ -209,7 +209,7 @@ Index: IkiWiki/Plugin/missingparents.pm
+ $ownfiles{$file} = 1;
+ push @{$files}, $file;
+ }
-+} #}}}
++}
+
+1
Index: IkiWiki.pm
@@ -227,18 +227,18 @@ Index: IkiWiki.pm
our $version='unknown'; # VERSION_AUTOREPLACE done by Makefile, DNE
@@ -330,6 +336,30 @@
error("failed renaming $newfile to $destdir/$file: $!", $cleanup);
- } #}}}
+ }
-+sub newpage($$) { #{{{
++sub newpage($$) {
+ my $file=shift;
+ my $page=shift;
+
+ $pagemtime{$page} = $pagectime{$page} = time;
+ $pagesources{$page} = $file;
+ $pagecase{lc $page} = $page;
-+} #}}}
++}
+
-+sub delpage($) { #{{{
++sub delpage($) {
+ my $page=shift;
+ $links{$page}=[];
+ $renderedfiles{$page}=[];
@@ -251,10 +251,10 @@ Index: IkiWiki.pm
+ delete $destsources{$_};
+ }
+ }
-+} #}}}
++}
+
my %cleared;
- sub will_render ($$;$) { #{{{
+ sub will_render ($$;$) {
my $page=shift;
</pre>
diff --git a/doc/todo/modify_page_filename_in_plugin.mdwn b/doc/todo/modify_page_filename_in_plugin.mdwn
index 7c0a909eb..4099487a1 100644
--- a/doc/todo/modify_page_filename_in_plugin.mdwn
+++ b/doc/todo/modify_page_filename_in_plugin.mdwn
@@ -10,7 +10,7 @@ My solution is to allow plugins to provide a hook that sets the pagename. --[[/u
+++ /usr/share/perl5/IkiWiki.pm 2008-10-07 11:57:26.000000000 -0400
@@ -196,11 +196,32 @@
- sub pagename ($) { #{{{
+ sub pagename ($) {
my $file=shift;
my $type=pagetype($file);
@@ -27,7 +27,7 @@ My solution is to allow plugins to provide a hook that sets the pagename. --[[/u
$page=~s/\Q.$type\E*$// if defined $type;
return $page;
+ }
- } #}}}
+ }
- sub htmlpage ($) { #{{{
+ sub htmlpage ($) {
diff --git a/doc/todo/pagespec_relative_to_a_target.mdwn b/doc/todo/pagespec_relative_to_a_target.mdwn
index f7b248670..4757988e0 100644
--- a/doc/todo/pagespec_relative_to_a_target.mdwn
+++ b/doc/todo/pagespec_relative_to_a_target.mdwn
@@ -57,7 +57,7 @@ diff -urNX ignorepats ikiwiki/IkiWiki/Plugin/relative.pm ikidev/IkiWiki/Plugin/r
+
+package IkiWiki::PageSpec;
+
-+sub match_relative($$;@) { #{{{
++sub match_relative($$;@) {
+ my $parent = shift;
+ my $spec = shift;
+ my %params = @_;
@@ -69,21 +69,21 @@ diff -urNX ignorepats ikiwiki/IkiWiki/Plugin/relative.pm ikidev/IkiWiki/Plugin/r
+ }
+ }
+ return IkiWiki::FailReason->new("$parent can't match $spec against anything");
-+} #}}}
++}
+
-+sub match_has_child($$;@) { #{{{
++sub match_has_child($$;@) {
+ my $page = shift;
+ my $childname = shift;
+ my $spec;
-+ if ($childname) { #{{{
++ if ($childname) {
+ $spec = "$page/$childname or $page/*/$childname";
-+ } #}}}
-+ else { #{{{
++ }
++ else {
+ $spec = "$page/*";
-+ } #}}}
++ }
+
+ return match_relative($page, $spec, @_);
-+} #}}}
++}
+
+1
</pre>
diff --git a/doc/todo/provide_sha1_for_git_diffurl.mdwn b/doc/todo/provide_sha1_for_git_diffurl.mdwn
index 9c8b340de..01aa512f8 100644
--- a/doc/todo/provide_sha1_for_git_diffurl.mdwn
+++ b/doc/todo/provide_sha1_for_git_diffurl.mdwn
@@ -10,7 +10,7 @@ diffurls of the following form:
index 5bef928..164210d 100644
--- a/IkiWiki/Plugin/git.pm
+++ b/IkiWiki/Plugin/git.pm
- @@ -518,6 +518,7 @@ sub rcs_recentchanges ($) { #{{{
+ @@ -518,6 +518,7 @@ sub rcs_recentchanges ($) {
my $diffurl = defined $config{'diffurl'} ? $config{'diffurl'} : "";
$diffurl =~ s/\[\[file\]\]/$file/go;
diff --git a/doc/todo/require_CAPTCHA_to_edit.mdwn b/doc/todo/require_CAPTCHA_to_edit.mdwn
index 110b4167f..83ba07eb0 100644
--- a/doc/todo/require_CAPTCHA_to_edit.mdwn
+++ b/doc/todo/require_CAPTCHA_to_edit.mdwn
@@ -91,15 +91,15 @@ ignored.
--- a/IkiWiki/Plugin/openid.pm
+++ b/IkiWiki/Plugin/openid.pm
-@@ -18,6 +18,7 @@ sub getopt () { #{{{
+@@ -18,6 +18,7 @@ sub getopt () {
error($@) if $@;
Getopt::Long::Configure('pass_through');
GetOptions("openidsignup=s" => \$config{openidsignup});
+ GetOptions("openidneedscaptcha=s" => \$config{openidneedscaptcha});
- } #}}}
+ }
- sub formbuilder_setup (@) { #{{{
-@@ -61,6 +62,7 @@ sub formbuilder_setup (@) { #{{{
+ sub formbuilder_setup (@) {
+@@ -61,6 +62,7 @@ sub formbuilder_setup (@) {
# Skip all other required fields in this case.
foreach my $field ($form->field) {
next if $field eq "openid_url";
@@ -107,7 +107,7 @@ ignored.
$form->field(name => $field, required => 0,
validate => '/.*/');
}
-@@ -96,6 +98,18 @@ sub validate ($$$;$) { #{{{
+@@ -96,6 +98,18 @@ sub validate ($$$;$) {
}
}
@@ -152,19 +152,19 @@ use warnings;
use strict;
use IkiWiki 2.00;
-sub import { #{{{
+sub import {
hook(type => "formbuilder_setup", id => "recaptcha", call => \&formbuilder_setup);
-} # }}}
+}
-sub getopt () { #{{{
+sub getopt () {
eval q{use Getopt::Long};
error($@) if $@;
Getopt::Long::Configure('pass_through');
GetOptions("reCaptchaPubKey=s" => \$config{reCaptchaPubKey});
GetOptions("reCaptchaPrivKey=s" => \$config{reCaptchaPrivKey});
-} #}}}
+}
-sub formbuilder_setup (@) { #{{{
+sub formbuilder_setup (@) {
my %params=@_;
my $form=$params{form};
@@ -274,7 +274,7 @@ EOTAGS
});
}
}
-} # }}}
+}
# The following function is borrowed from
# Captcha::reCAPTCHA by Andy Armstrong and are under the PERL Artistic License
diff --git a/doc/todo/source_link.mdwn b/doc/todo/source_link.mdwn
index 5d6cb89e8..b051361a8 100644
--- a/doc/todo/source_link.mdwn
+++ b/doc/todo/source_link.mdwn
@@ -31,13 +31,13 @@ I just implemented this. There is one [[patch]] to the default page template, a
use IkiWiki;
use open qw{:utf8 :std};
- sub import { #{{{
+ sub import {
hook(type => "getsetup", id => "getsource", call => \&getsetup);
hook(type => "pagetemplate", id => "getsource", call => \&pagetemplate);
hook(type => "sessioncgi", id => "getsource", call => \&cgi_getsource);
- } # }}}
+ }
- sub getsetup () { #{{{
+ sub getsetup () {
return
plugin => {
safe => 1,
@@ -50,9 +50,9 @@ I just implemented this. There is one [[patch]] to the default page template, a
safe => 1,
rebuild => 0,
},
- } #}}}
+ }
- sub pagetemplate (@) { #{{{
+ sub pagetemplate (@) {
my %params=@_;
my $page=$params{page};
@@ -62,9 +62,9 @@ I just implemented this. There is one [[patch]] to the default page template, a
$template->param(getsourceurl => IkiWiki::cgiurl(do => "getsource", page => $page));
$template->param(have_actions => 1);
}
- } # }}}
+ }
- sub cgi_getsource ($$) { #{{{
+ sub cgi_getsource ($$) {
my $cgi=shift;
my $session=shift;
diff --git a/doc/todo/structured_page_data.mdwn b/doc/todo/structured_page_data.mdwn
index 2a196ed23..22f67cc0a 100644
--- a/doc/todo/structured_page_data.mdwn
+++ b/doc/todo/structured_page_data.mdwn
@@ -257,21 +257,21 @@ in a large number of other cases.
use CGI::FormBuilder;
use IkiWiki 2.00;
- sub import { #{{{
+ sub import {
hook(type => "getsetup", id => "form", call => \&getsetup);
hook(type => "htmlize", id => "form", call => \&htmlize);
hook(type => "sessioncgi", id => "form", call => \&cgi_submit);
- } # }}}
+ }
- sub getsetup () { #{{{
+ sub getsetup () {
return
plugin => {
safe => 1,
rebuild => 1, # format plugin
},
- } #}}}
+ }
- sub makeFormFromYAML ($$$) { #{{{
+ sub makeFormFromYAML ($$$) {
my $page = shift;
my $YAMLString = shift;
my $q = shift;
@@ -350,9 +350,9 @@ in a large number of other cases.
# IkiWiki::decode_form_utf8($form);
return $form;
- } #}}}
+ }
- sub htmlize (@) { #{{{
+ sub htmlize (@) {
my %params=@_;
my $content = $params{content};
my $page = $params{page};
@@ -360,9 +360,9 @@ in a large number of other cases.
my $form = makeFormFromYAML($page, $content, undef);
return $form->render(submit => 'Update Form');
- } # }}}
+ }
- sub cgi_submit ($$) { #{{{
+ sub cgi_submit ($$) {
my $q=shift;
my $session=shift;
@@ -425,11 +425,11 @@ in a large number of other cases.
}
exit;
- } #}}}
+ }
package IkiWiki::PageSpec;
- sub match_form_eq ($$;@) { #{{{
+ sub match_form_eq ($$;@) {
my $page=shift;
my $argSet=shift;
my @args=split(/,/, $argSet);
@@ -460,7 +460,7 @@ in a large number of other cases.
} else {
return IkiWiki::FailReason->new("field value does not match");
}
- } #}}}
+ }
1
@@ -476,22 +476,22 @@ in a large number of other cases.
my $inTable = 0;
- sub import { #{{{
+ sub import {
hook(type => "getsetup", id => "data", call => \&getsetup);
hook(type => "needsbuild", id => "data", call => \&needsbuild);
hook(type => "preprocess", id => "data", call => \&preprocess, scan => 1);
hook(type => "preprocess", id => "datatable", call => \&preprocess_table, scan => 1); # does this need scan?
- } # }}}
+ }
- sub getsetup () { #{{{
+ sub getsetup () {
return
plugin => {
safe => 1,
rebuild => 1, # format plugin
},
- } #}}}
+ }
- sub needsbuild (@) { #{{{
+ sub needsbuild (@) {
my $needsbuild=shift;
foreach my $page (keys %pagestate) {
if (exists $pagestate{$page}{data}) {
@@ -506,7 +506,7 @@ in a large number of other cases.
}
}
- sub preprocess (@) { #{{{
+ sub preprocess (@) {
my @argslist = @_;
my %params=@argslist;
@@ -546,9 +546,9 @@ in a large number of other cases.
}
return $html;
- } # }}}
+ }
- sub preprocess_table (@) { #{{{
+ sub preprocess_table (@) {
my %params=@_;
my @lines;
@@ -568,11 +568,11 @@ in a large number of other cases.
push @lines, '</table>';
return join("\n", @lines);
- } #}}}
+ }
package IkiWiki::PageSpec;
- sub match_data_eq ($$;@) { #{{{
+ sub match_data_eq ($$;@) {
my $page=shift;
my $argSet=shift;
my @args=split(/,/, $argSet);
@@ -592,9 +592,9 @@ in a large number of other cases.
} else {
return IkiWiki::FailReason->new("value does not match");
}
- } #}}}
+ }
- sub match_data_link ($$;@) { #{{{
+ sub match_data_link ($$;@) {
my $page=shift;
my $argSet=shift;
my @params=@_;
@@ -618,6 +618,6 @@ in a large number of other cases.
}
return IkiWiki::FailReason->new("No data link on page $page with key $key matches glob $value");
- } #}}}
+ }
1
diff --git a/doc/todo/supporting_comments_via_disussion_pages.mdwn b/doc/todo/supporting_comments_via_disussion_pages.mdwn
index 892db18a9..aae0b3008 100644
--- a/doc/todo/supporting_comments_via_disussion_pages.mdwn
+++ b/doc/todo/supporting_comments_via_disussion_pages.mdwn
@@ -91,14 +91,14 @@ Each comment is processed to something like this:
use strict;
use IkiWiki '1.02';
- sub import { #{{{
+ sub import {
hook(type => "formbuilder_setup", id => "comments",
call => \&formbuilder_setup);
hook(type => "preprocess", id => "blogcomment",
call => \&preprocess);
- } # }}}
+ }
- sub formbuilder_setup (@) { #{{{
+ sub formbuilder_setup (@) {
my %params=@_;
my $cgi = $params{cgi};
my $form = $params{form};
@@ -138,9 +138,9 @@ Each comment is processed to something like this:
$content.=qq{[[!blogcomment from="""$name""" timestamp="""$timestamp""" subject="""$subject""" text="""$comment"""]]\n\n};
$content=~s/\n/\r\n/g;
$form->field(name => "editcontent", value => $content, force => 1);
- } # }}}
+ }
- sub preprocess (@) { #{{{
+ sub preprocess (@) {
my %params=@_;
my ($text, $date, $from, $subject, $r);
@@ -159,7 +159,7 @@ Each comment is processed to something like this:
$r .= "</dl>\n" . $text . "</div>\n";
return $r;
- } # }}}
+ }
1;
diff --git a/doc/todo/syntax_highlighting.mdwn b/doc/todo/syntax_highlighting.mdwn
index 2bdeb62be..3de3032b3 100644
--- a/doc/todo/syntax_highlighting.mdwn
+++ b/doc/todo/syntax_highlighting.mdwn
@@ -90,7 +90,7 @@ like this:
index 8d728c9..1bd46a9 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
- @@ -618,6 +618,8 @@ sub pagetype ($) { #{{{
+ @@ -618,6 +618,8 @@ sub pagetype ($) {
if ($page =~ /\.([^.]+)$/) {
return $1 if exists $hooks{htmlize}{$1};
@@ -98,7 +98,7 @@ like this:
+ return $page;
}
return;
- } #}}}
+ }
## format directive
diff --git a/doc/todo/tidy_git__39__s_ctime_debug_output.mdwn b/doc/todo/tidy_git__39__s_ctime_debug_output.mdwn
index aaa040ec7..bfc130d69 100644
--- a/doc/todo/tidy_git__39__s_ctime_debug_output.mdwn
+++ b/doc/todo/tidy_git__39__s_ctime_debug_output.mdwn
@@ -10,6 +10,6 @@
+ debug("ctime for '$file': ". localtime($ctime));
return $ctime;
- } #}}}
+ }
[[!tag patch done]]
diff --git a/doc/todo/tmplvars_plugin.mdwn b/doc/todo/tmplvars_plugin.mdwn
index f7d06a579..644cf23aa 100644
--- a/doc/todo/tmplvars_plugin.mdwn
+++ b/doc/todo/tmplvars_plugin.mdwn
@@ -11,12 +11,12 @@ A simple plugin to allow per-page customization of a template by passing paramat
my %tmplvars;
- sub import { #{{{
+ sub import {
hook(type => "preprocess", id => "tmplvars", call => \&preprocess);
hook(type => "pagetemplate", id => "tmplvars", call => \&pagetemplate);
- } # }}}
+ }
- sub preprocess (@) { #{{{
+ sub preprocess (@) {
my %params=@_;
if ($params{page} eq $params{destpage}) {
@@ -34,9 +34,9 @@ A simple plugin to allow per-page customization of a template by passing paramat
}
}
- } # }}}
+ }
- sub pagetemplate (@) { #{{{
+ sub pagetemplate (@) {
my %params=@_;
my $template = $params{template};
@@ -47,6 +47,6 @@ A simple plugin to allow per-page customization of a template by passing paramat
}
return undef;
- } # }}}
+ }
1
diff --git a/doc/todo/tracking_bugs_with_dependencies.mdwn b/doc/todo/tracking_bugs_with_dependencies.mdwn
index 3af0458bd..2832e37aa 100644
--- a/doc/todo/tracking_bugs_with_dependencies.mdwn
+++ b/doc/todo/tracking_bugs_with_dependencies.mdwn
@@ -194,9 +194,9 @@ account all comments above (which doesn't mean it is above reproach :) ). --[[W
index 4e4da11..8b3cdfe 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
- @@ -1550,7 +1550,16 @@ sub globlist_to_pagespec ($) { #{{{
+ @@ -1550,7 +1550,16 @@ sub globlist_to_pagespec ($) {
- sub is_globlist ($) { #{{{
+ sub is_globlist ($) {
my $s=shift;
- return ( $s =~ /[^\s]+\s+([^\s]+)/ && $1 ne "and" && $1 ne "or" );
+ return ! ($s =~ /
@@ -209,19 +209,19 @@ account all comments above (which doesn't mean it is above reproach :) ). --[[W
+ ) |
+ (\s and \s) | (\s or \s) # or we find 'and' or 'or' somewhere
+ /xs);
- } #}}}
+ }
- sub safequote ($) { #{{{
- @@ -1631,7 +1640,7 @@ sub pagespec_merge ($$) { #{{{
+ sub safequote ($) {
+ @@ -1631,7 +1640,7 @@ sub pagespec_merge ($$) {
return "($a) or ($b)";
- } #}}}
+ }
- -sub pagespec_translate ($) { #{{{
- +sub pagespec_makeperl ($) { #{{{
+ -sub pagespec_translate ($) {
+ +sub pagespec_makeperl ($) {
my $spec=shift;
# Support for old-style GlobLists.
- @@ -1650,12 +1659,14 @@ sub pagespec_translate ($) { #{{{
+ @@ -1650,12 +1659,14 @@ sub pagespec_translate ($) {
|
\) # )
|
@@ -238,7 +238,7 @@ account all comments above (which doesn't mean it is above reproach :) ). --[[W
my $word=$1;
if (lc $word eq 'and') {
$code.=' &&';
- @@ -1666,16 +1677,23 @@ sub pagespec_translate ($) { #{{{
+ @@ -1666,16 +1677,23 @@ sub pagespec_translate ($) {
elsif ($word eq "(" || $word eq ")" || $word eq "!") {
$code.=' '.$word;
}
@@ -265,14 +265,14 @@ account all comments above (which doesn't mean it is above reproach :) ). --[[W
}
}
- @@ -1683,8 +1701,18 @@ sub pagespec_translate ($) { #{{{
+ @@ -1683,8 +1701,18 @@ sub pagespec_translate ($) {
$code=0;
}
+ return 'sub { my $page=shift; my %params = @_; '.$code.' }';
- +} #}}}
+ +}
+
- +sub pagespec_translate ($) { #{{{
+ +sub pagespec_translate ($) {
+ my $spec=shift;
+
+ my $code = pagespec_makeperl($spec);
@@ -282,19 +282,19 @@ account all comments above (which doesn't mean it is above reproach :) ). --[[W
no warnings;
- return eval 'sub { my $page=shift; '.$code.' }';
+ return eval $code;
- } #}}}
+ }
- sub pagespec_match ($$;@) { #{{{
- @@ -1699,7 +1727,7 @@ sub pagespec_match ($$;@) { #{{{
+ sub pagespec_match ($$;@) {
+ @@ -1699,7 +1727,7 @@ sub pagespec_match ($$;@) {
my $sub=pagespec_translate($spec);
return IkiWiki::FailReason->new("syntax error in pagespec \"$spec\"") if $@;
- return $sub->($page, @params);
+ return $sub->($page, @params, specFuncs => {});
- } #}}}
+ }
- sub pagespec_valid ($) { #{{{
- @@ -1748,11 +1776,78 @@ sub new { #{{{
+ sub pagespec_valid ($) {
+ @@ -1748,11 +1776,78 @@ sub new {
package IkiWiki::PageSpec;
@@ -361,7 +361,7 @@ account all comments above (which doesn't mean it is above reproach :) ). --[[W
+ }
+}
+
- sub match_glob ($$;@) { #{{{
+ sub match_glob ($$;@) {
my $page=shift;
my $glob=shift;
my %params=@_;
@@ -373,9 +373,9 @@ account all comments above (which doesn't mean it is above reproach :) ). --[[W
my $from=exists $params{location} ? $params{location} : '';
# relative matching
- @@ -1782,11 +1877,12 @@ sub match_internal ($$;@) { #{{{
+ @@ -1782,11 +1877,12 @@ sub match_internal ($$;@) {
- sub match_link ($$;@) { #{{{
+ sub match_link ($$;@) {
my $page=shift;
- my $link=lc(shift);
+ my $fulllink=shift;
@@ -388,7 +388,7 @@ account all comments above (which doesn't mean it is above reproach :) ). --[[W
# relative matching
if ($link =~ m!^\.! && defined $from) {
$from=~s#/?[^/]+$##;
- @@ -1804,19 +1900,32 @@ sub match_link ($$;@) { #{{{
+ @@ -1804,19 +1900,32 @@ sub match_link ($$;@) {
}
else {
return IkiWiki::SuccessReason->new("$page links to page $p matching $link")
@@ -397,9 +397,9 @@ account all comments above (which doesn't mean it is above reproach :) ). --[[W
}
}
return IkiWiki::FailReason->new("$page does not link to $link");
- } #}}}
+ }
- sub match_backlink ($$;@) { #{{{
+ sub match_backlink ($$;@) {
- return match_link($_[1], $_[0], @_);
+ my $page=shift;
+ my $backlink=shift;
@@ -410,9 +410,9 @@ account all comments above (which doesn't mean it is above reproach :) ). --[[W
+ }
+
+ return match_link($backlink, $page, @params);
- } #}}}
+ }
- sub match_created_before ($$;@) { #{{{
+ sub match_created_before ($$;@) {
my $page=shift;
my $testpage=shift;
+ my @params=@_;
@@ -423,8 +423,8 @@ account all comments above (which doesn't mean it is above reproach :) ). --[[W
if (exists $IkiWiki::pagectime{$testpage}) {
if ($IkiWiki::pagectime{$page} < $IkiWiki::pagectime{$testpage}) {
- @@ -1834,6 +1943,11 @@ sub match_created_before ($$;@) { #{{{
- sub match_created_after ($$;@) { #{{{
+ @@ -1834,6 +1943,11 @@ sub match_created_before ($$;@) {
+ sub match_created_after ($$;@) {
my $page=shift;
my $testpage=shift;
+ my @params=@_;
diff --git a/doc/todo/turn_edittemplate_verbosity_off_by_default.mdwn b/doc/todo/turn_edittemplate_verbosity_off_by_default.mdwn
index 87e55685c..14bb43782 100644
--- a/doc/todo/turn_edittemplate_verbosity_off_by_default.mdwn
+++ b/doc/todo/turn_edittemplate_verbosity_off_by_default.mdwn
@@ -8,7 +8,7 @@ I think this (untested) patch might just do the trick:
--- a/IkiWiki/Plugin/edittemplate.pm
+++ b/IkiWiki/Plugin/edittemplate.pm
- @@ -46,8 +46,13 @@ sub preprocess (@) { #{{{
+ @@ -46,8 +46,13 @@ sub preprocess (@) {
$pagestate{$params{page}}{edittemplate}{$params{match}}=$params{template};
@@ -21,9 +21,9 @@ I think this (untested) patch might just do the trick:
+ else {
+ return '';
+ }
- } # }}}
+ }
- sub formbuilder (@) { #{{{
+ sub formbuilder (@) {
--[[madduck]]
diff --git a/doc/todo/using_meta_titles_for_parentlinks.html b/doc/todo/using_meta_titles_for_parentlinks.html
index d04e5a300..6da40a415 100644
--- a/doc/todo/using_meta_titles_for_parentlinks.html
+++ b/doc/todo/using_meta_titles_for_parentlinks.html
@@ -82,9 +82,9 @@ diff -c /usr/share/perl5/IkiWiki/Plugin/meta.pm.distrib /usr/share/perl5/IkiWiki
*** 289,294 ****
--- 290,319 ----
}
- } #}}}
+ }
-+ sub IkiWiki::pagetitle ($;$) { #{{{
++ sub IkiWiki::pagetitle ($;$) {
+ my $page=shift;
+ my $unescaped=shift;
+
@@ -106,11 +106,11 @@ diff -c /usr/share/perl5/IkiWiki/Plugin/meta.pm.distrib /usr/share/perl5/IkiWiki
+ }
+
+ return $page;
-+ } #}}}
++ }
+
package IkiWiki::PageSpec;
- sub match_title ($$;@) { #{{{
+ sub match_title ($$;@) {
</pre>
diff --git a/doc/todo/varioki_--_add_template_variables___40__with_closures_for_values__41___in_ikiwiki.setup.mdwn b/doc/todo/varioki_--_add_template_variables___40__with_closures_for_values__41___in_ikiwiki.setup.mdwn
index 492a32b36..b28469993 100644
--- a/doc/todo/varioki_--_add_template_variables___40__with_closures_for_values__41___in_ikiwiki.setup.mdwn
+++ b/doc/todo/varioki_--_add_template_variables___40__with_closures_for_values__41___in_ikiwiki.setup.mdwn
@@ -157,9 +157,9 @@ ManojSrivastava
+=cut
+
+
-+sub import { #{{{
++sub import {
+ hook(type => "pagetemplate", id => "varioki", call => \&pagetemplate);
-+} # }}}
++}
+
+
+=pod
@@ -175,7 +175,7 @@ ManojSrivastava
+
+=cut
+
-+sub pagetemplate (@) { #{{{
++sub pagetemplate (@) {
+ my %params=@_;
+ my $page=$params{page};
+ my $template=$params{template};
@@ -207,7 +207,7 @@ ManojSrivastava
+ $template->param("$var" =>"$value");
+ }
+ }
-+} # }}}
++}
+
+1;
+