aboutsummaryrefslogtreecommitdiff
path: root/doc
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
parent985b229be632126f376aaad7bd354d0d7d014464 (diff)
downloadikiwiki-bb93fccf0690344aa77f9538a508959a6de09847.tar
ikiwiki-bb93fccf0690344aa77f9538a508959a6de09847.tar.gz
Coding style change: Remove explcit vim folding markers.
Diffstat (limited to 'doc')
-rw-r--r--doc/bugs/Allow_overriding_of_symlink_restriction.mdwn6
-rw-r--r--doc/bugs/Can__39__t_create_root_page.mdwn4
-rw-r--r--doc/bugs/Insecure_dependency_in_eval_while_running_with_-T_switch.mdwn4
-rw-r--r--doc/bugs/Monotone_rcs_support.mdwn2
-rw-r--r--doc/bugs/No_link_for_blog_items_when_filename_contains_a_colon.mdwn8
-rw-r--r--doc/bugs/Problem_with_toc.pm_plug-in.mdwn4
-rw-r--r--doc/bugs/Problems_with_graphviz.pm_plug-in.mdwn14
-rw-r--r--doc/bugs/RecentChanges_broken_with_empty_svnpath.mdwn2
-rw-r--r--doc/bugs/Titles_are_lower-cased_when_creating_a_page.mdwn2
-rw-r--r--doc/bugs/Warns_about_use_of_uninitialized_value_if_prefix__95__directives_is_on_and_a_directive_does_not_contain_a_space.mdwn4
-rw-r--r--doc/bugs/bugfix_for:___34__mtn:_operation_canceled:_Broken_pipe__34_____40__patch__41__.mdwn2
-rw-r--r--doc/bugs/git_stderr_output_causes_problems.mdwn2
-rw-r--r--doc/bugs/img_plugin_should_pass_through_class_attribute.mdwn4
-rw-r--r--doc/bugs/inline_sort-by-title_issues.mdwn2
-rw-r--r--doc/bugs/mercurial_fail_to_add.mdwn2
-rw-r--r--doc/bugs/methodResponse_in_add__95__plugins.mdwn2
-rw-r--r--doc/bugs/multiple_pages_with_same_name.mdwn6
-rw-r--r--doc/bugs/pagespec_parsing_chokes_on_function__40____41__.mdwn2
-rw-r--r--doc/bugs/prune_causing_taint_mode_failures.mdwn4
-rw-r--r--doc/bugs/quieten_mercurial.mdwn4
-rw-r--r--doc/bugs/search_for_locale_data_in_the_installed_location.mdwn2
-rw-r--r--doc/bugs/tbasewiki__95__brokenlinks.t_broken.mdwn6
-rw-r--r--doc/plugins/contrib/headinganchors.mdwn8
-rw-r--r--doc/plugins/contrib/siterel2pagerel.mdwn8
-rw-r--r--doc/plugins/contrib/unixauth.mdwn24
-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
70 files changed, 363 insertions, 363 deletions
diff --git a/doc/bugs/Allow_overriding_of_symlink_restriction.mdwn b/doc/bugs/Allow_overriding_of_symlink_restriction.mdwn
index 07badd646..efdd9004e 100644
--- a/doc/bugs/Allow_overriding_of_symlink_restriction.mdwn
+++ b/doc/bugs/Allow_overriding_of_symlink_restriction.mdwn
@@ -34,9 +34,9 @@ Is there a huge objection to this patch?
index 990fcaa..0fb78ba 100644
--- a/IkiWiki/Render.pm
+++ b/IkiWiki/Render.pm
- @@ -260,13 +260,15 @@ sub prune ($) { #{{{
+ @@ -260,13 +260,15 @@ sub prune ($) {
- sub refresh () { #{{{
+ sub refresh () {
# security check, avoid following symlinks in the srcdir path
- my $test=$config{srcdir};
- while (length $test) {
@@ -108,7 +108,7 @@ like this being accepted before I bothered.
use IkiWiki;
+use File::Spec;
- sub gen_wrapper () { #{{{
+ sub gen_wrapper () {
- $config{srcdir}=abs_path($config{srcdir});
- $config{destdir}=abs_path($config{destdir});
- my $this=abs_path($0);
diff --git a/doc/bugs/Can__39__t_create_root_page.mdwn b/doc/bugs/Can__39__t_create_root_page.mdwn
index 60cbcd530..91c2eae60 100644
--- a/doc/bugs/Can__39__t_create_root_page.mdwn
+++ b/doc/bugs/Can__39__t_create_root_page.mdwn
@@ -33,7 +33,7 @@ This type of page name (with leading slash) also gets created by the aggregate p
index 99cead6..23d9616 100644
--- a/IkiWiki/CGI.pm
+++ b/IkiWiki/CGI.pm
- @@ -305,9 +305,11 @@ sub cgi_editpage ($$) { #{{{
+ @@ -305,9 +305,11 @@ sub cgi_editpage ($$) {
my $page=$form->field('page');
$page=possibly_foolish_untaint($page);
if (! defined $page || ! length $page ||
@@ -46,7 +46,7 @@ This type of page name (with leading slash) also gets created by the aggregate p
my $baseurl=$config{url}."/".htmlpage($page);
- @@ -425,6 +427,7 @@ sub cgi_editpage ($$) { #{{{
+ @@ -425,6 +427,7 @@ sub cgi_editpage ($$) {
$from ne $form->field('from') ||
file_pruned($from, $config{srcdir}) ||
$from=~/^\// ||
diff --git a/doc/bugs/Insecure_dependency_in_eval_while_running_with_-T_switch.mdwn b/doc/bugs/Insecure_dependency_in_eval_while_running_with_-T_switch.mdwn
index 28b48e2c6..c3beb8219 100644
--- a/doc/bugs/Insecure_dependency_in_eval_while_running_with_-T_switch.mdwn
+++ b/doc/bugs/Insecure_dependency_in_eval_while_running_with_-T_switch.mdwn
@@ -53,7 +53,7 @@ I didn't apply your following old patch against `Ikiwiki.pm` file:
+ }
+
+ return eval $newpagespec;
- } #}}}
+ }
package IkiWiki::PageSpec;
@@ -83,7 +83,7 @@ to break the code I distribute in my backport ;)
+ my $ret=eval possibly_foolish_untaint(pagespec_translate($spec));
return IkiWiki::FailReason->new("syntax error") if $@;
return $ret;
- } #}}}
+ }
>> Thanks a lot, Joey! It works :)
>>
diff --git a/doc/bugs/Monotone_rcs_support.mdwn b/doc/bugs/Monotone_rcs_support.mdwn
index 3d1388312..8687e7983 100644
--- a/doc/bugs/Monotone_rcs_support.mdwn
+++ b/doc/bugs/Monotone_rcs_support.mdwn
@@ -11,7 +11,7 @@ diff --git a/IkiWiki/Rcs/monotone.pm b/IkiWiki/Rcs/monotone.pm
index cde6029..34f8f96 100644
--- a/IkiWiki/Rcs/monotone.pm
+++ b/IkiWiki/Rcs/monotone.pm
-@@ -186,8 +186,9 @@ sub rcs_update () { #{{{
+@@ -186,8 +186,9 @@ sub rcs_update () {
check_config();
if (defined($config{mtnsync}) && $config{mtnsync}) {
diff --git a/doc/bugs/No_link_for_blog_items_when_filename_contains_a_colon.mdwn b/doc/bugs/No_link_for_blog_items_when_filename_contains_a_colon.mdwn
index 019970899..bb3f92f9c 100644
--- a/doc/bugs/No_link_for_blog_items_when_filename_contains_a_colon.mdwn
+++ b/doc/bugs/No_link_for_blog_items_when_filename_contains_a_colon.mdwn
@@ -38,19 +38,19 @@ At the moment I see two possible solutions:
+++ IkiWiki.pm 2008-07-21 20:41:35.000000000 +0200
@@ -477,13 +477,13 @@
- sub titlepage ($) { #{{{
+ sub titlepage ($) {
my $title=shift;
- $title=~s/([^-[:alnum:]:+\/.])/$1 eq ' ' ? '_' : "__".ord($1)."__"/eg;
+ $title=~s/([^-[:alnum:]+\/.])/$1 eq ' ' ? '_' : "__".ord($1)."__"/eg;
return $title;
- } #}}}
+ }
- sub linkpage ($) { #{{{
+ sub linkpage ($) {
my $link=shift;
- $link=~s/([^-[:alnum:]:+\/._])/$1 eq ' ' ? '_' : "__".ord($1)."__"/eg;
+ $link=~s/([^-[:alnum:]+\/._])/$1 eq ' ' ? '_' : "__".ord($1)."__"/eg;
return $link;
- } #}}}
+ }
What do you think about that? Does the patch have any side-effects I didn't see?
diff --git a/doc/bugs/Problem_with_toc.pm_plug-in.mdwn b/doc/bugs/Problem_with_toc.pm_plug-in.mdwn
index 8ae347d42..6be5f89b5 100644
--- a/doc/bugs/Problem_with_toc.pm_plug-in.mdwn
+++ b/doc/bugs/Problem_with_toc.pm_plug-in.mdwn
@@ -9,7 +9,7 @@ Here is a patch for toc.pm for producing non-empty 'a' elements.
--- IkiWiki/Plugin/toc.pm.orig Thu Jun 7 11:53:53 2007
+++ IkiWiki/Plugin/toc.pm Thu Jun 7 13:00:00 2007
- @@ -47,7 +47,7 @@ sub format (@) { #{{{
+ @@ -47,7 +47,7 @@ sub format (@) {
if ($tagname =~ /^h(\d+)$/i) {
my $level=$1;
my $anchor="index".++$anchors{$level}."h$level";
@@ -18,7 +18,7 @@ Here is a patch for toc.pm for producing non-empty 'a' elements.
# Take the first header level seen as the topmost level,
# even if there are higher levels seen later on.
- @@ -90,6 +90,16 @@ sub format (@) { #{{{
+ @@ -90,6 +90,16 @@ sub format (@) {
"</a>\n";
$p->handler(text => undef);
}, "dtext");
diff --git a/doc/bugs/Problems_with_graphviz.pm_plug-in.mdwn b/doc/bugs/Problems_with_graphviz.pm_plug-in.mdwn
index 9a26e505a..c9f698158 100644
--- a/doc/bugs/Problems_with_graphviz.pm_plug-in.mdwn
+++ b/doc/bugs/Problems_with_graphviz.pm_plug-in.mdwn
@@ -15,7 +15,7 @@ It also generates image URLs relative to the page being rendered, which means th
--- IkiWiki/Plugin/graphviz.pm.orig 2007-07-27 11:35:05.000000000 +0200
+++ IkiWiki/Plugin/graphviz.pm 2007-07-27 11:36:02.000000000 +0200
- @@ -69,7 +69,12 @@ sub render_graph (\%) { #{{{
+ @@ -69,7 +69,12 @@ sub render_graph (\%) {
}
}
@@ -26,9 +26,9 @@ It also generates image URLs relative to the page being rendered, which means th
+ else {
+ return "<img src=\"".urlto($dest, $params{page})."\" />\n";
+ }
- } #}}}
+ }
- sub graph (@) { #{{{
+ sub graph (@) {
>> --[[HenrikBrixAndersen]]
@@ -38,7 +38,7 @@ The patch below fixes these two issues.
--- graphviz.pm.orig Thu Jun 7 15:45:16 2007
+++ graphviz.pm Fri Jun 8 12:03:38 2007
- @@ -41,7 +41,6 @@ sub render_graph (\%) { #{{{
+ @@ -41,7 +41,6 @@ sub render_graph (\%) {
$pid=open2(*IN, *OUT, "$params{prog} -Tpng");
# open2 doesn't respect "use open ':utf8'"
@@ -46,7 +46,7 @@ The patch below fixes these two issues.
binmode (OUT, ':utf8');
print OUT $src;
- @@ -70,7 +69,12 @@ sub render_graph (\%) { #{{{
+ @@ -70,7 +69,12 @@ sub render_graph (\%) {
}
}
@@ -57,6 +57,6 @@ The patch below fixes these two issues.
+ else {
+ return "<img src=\"".urlto($dest, $params{page})."\" />\n";
+ }
- } #}}}
+ }
- sub graph (@) { #{{{
+ sub graph (@) {
diff --git a/doc/bugs/RecentChanges_broken_with_empty_svnpath.mdwn b/doc/bugs/RecentChanges_broken_with_empty_svnpath.mdwn
index 836c39a71..c852df5e9 100644
--- a/doc/bugs/RecentChanges_broken_with_empty_svnpath.mdwn
+++ b/doc/bugs/RecentChanges_broken_with_empty_svnpath.mdwn
@@ -13,7 +13,7 @@ I can not see why this check is needed in the first place, so here's a patch for
diff -upr ikiwiki-1.49.orig/IkiWiki/Rcs/svn.pm ikiwiki-1.49/IkiWiki/Rcs/svn.pm
--- ikiwiki-1.49.orig/IkiWiki/Rcs/svn.pm Mon Apr 16 15:15:09 2007
+++ ikiwiki-1.49/IkiWiki/Rcs/svn.pm Mon Apr 16 15:15:47 2007
- @@ -176,7 +176,6 @@ sub rcs_recentchanges ($) { #{{{
+ @@ -176,7 +176,6 @@ sub rcs_recentchanges ($) {
}
foreach (keys %{$logentry->{paths}}) {
diff --git a/doc/bugs/Titles_are_lower-cased_when_creating_a_page.mdwn b/doc/bugs/Titles_are_lower-cased_when_creating_a_page.mdwn
index cc53c0aea..f2c60309b 100644
--- a/doc/bugs/Titles_are_lower-cased_when_creating_a_page.mdwn
+++ b/doc/bugs/Titles_are_lower-cased_when_creating_a_page.mdwn
@@ -6,7 +6,7 @@ If I click on "Czars in Russia", I'd like Ikiwiki to create "Czars\_in\_Russia.m
> --- a/IkiWiki.pm
> +++ b/IkiWiki.pm
-> @@ -584,7 +584,7 @@ sub htmllink ($$$;@) { #{{{
+> @@ -584,7 +584,7 @@ sub htmllink ($$$;@) {
> return "<span class=\"createlink\"><a href=\"".
> cgiurl(
> do => "create",
diff --git a/doc/bugs/Warns_about_use_of_uninitialized_value_if_prefix__95__directives_is_on_and_a_directive_does_not_contain_a_space.mdwn b/doc/bugs/Warns_about_use_of_uninitialized_value_if_prefix__95__directives_is_on_and_a_directive_does_not_contain_a_space.mdwn
index a30f110a4..efb5c70b8 100644
--- a/doc/bugs/Warns_about_use_of_uninitialized_value_if_prefix__95__directives_is_on_and_a_directive_does_not_contain_a_space.mdwn
+++ b/doc/bugs/Warns_about_use_of_uninitialized_value_if_prefix__95__directives_is_on_and_a_directive_does_not_contain_a_space.mdwn
@@ -6,7 +6,7 @@ In `IkiWiki::preprocess`, the last capturing group in the regex used to parse di
index 241a7c0..d2c35a2 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
- @@ -1167,7 +1167,8 @@ sub preprocess ($$$;$$) { #{{{
+ @@ -1167,7 +1167,8 @@ sub preprocess ($$$;$$) {
}sx;
}
@@ -14,6 +14,6 @@ In `IkiWiki::preprocess`, the last capturing group in the regex used to parse di
+ # $4 can be undef if the directive was \[[!foo]]
+ $content =~ s{$regex}{$handle->($1, $2, $3, ($4 or ""))}eg;
return $content;
- } #}}}
+ }
[[cherry-picked|done]] --[[Joey]]
diff --git a/doc/bugs/bugfix_for:___34__mtn:_operation_canceled:_Broken_pipe__34_____40__patch__41__.mdwn b/doc/bugs/bugfix_for:___34__mtn:_operation_canceled:_Broken_pipe__34_____40__patch__41__.mdwn
index aa13ec339..b7f38fd29 100644
--- a/doc/bugs/bugfix_for:___34__mtn:_operation_canceled:_Broken_pipe__34_____40__patch__41__.mdwn
+++ b/doc/bugs/bugfix_for:___34__mtn:_operation_canceled:_Broken_pipe__34_____40__patch__41__.mdwn
@@ -3,7 +3,7 @@ When using monotone as revision control system, a "mtn: operation canceled: Brok
diff -up ikiwiki/IkiWiki/Plugin/monotone.pm.orig ikiwiki/IkiWiki/Plugin/monotone.pm
--- ikiwiki/IkiWiki/Plugin/monotone.pm.orig 2008-11-12 23:45:24.000000000 +0100
+++ ikiwiki/IkiWiki/Plugin/monotone.pm 2008-12-16 12:41:38.000000000 +0100
- @@ -525,13 +525,12 @@ sub rcs_recentchanges ($) { #{{{
+ @@ -525,13 +525,12 @@ sub rcs_recentchanges ($) {
my $child = open(MTNLOG, "-|");
if (! $child) {
exec("mtn", "log", "--root=$config{mtnrootdir}", "--no-graph",
diff --git a/doc/bugs/git_stderr_output_causes_problems.mdwn b/doc/bugs/git_stderr_output_causes_problems.mdwn
index 4146a5869..c25ef6927 100644
--- a/doc/bugs/git_stderr_output_causes_problems.mdwn
+++ b/doc/bugs/git_stderr_output_causes_problems.mdwn
@@ -6,7 +6,7 @@ Ikiwiki's git handling is sending a bunch of output to stderr. The following pa
index 425536f..5734bb2 100644
--- a/IkiWiki/Rcs/git.pm
+++ b/IkiWiki/Rcs/git.pm
- @@ -24,6 +24,7 @@ sub _safe_git (&@) { #{{{
+ @@ -24,6 +24,7 @@ sub _safe_git (&@) {
if (!$pid) {
# In child.
# Git commands want to be in wc.
diff --git a/doc/bugs/img_plugin_should_pass_through_class_attribute.mdwn b/doc/bugs/img_plugin_should_pass_through_class_attribute.mdwn
index 2e67d6357..f72ecade2 100644
--- a/doc/bugs/img_plugin_should_pass_through_class_attribute.mdwn
+++ b/doc/bugs/img_plugin_should_pass_through_class_attribute.mdwn
@@ -26,7 +26,7 @@ And here's a patch to implement it. Will this survive markdown munging? It seems
index 7226231..3eb1ae7 100644
--- a/Plugin/img.pm
+++ b/Plugin/img.pm
- @@ -93,9 +93,15 @@ sub preprocess (@) { #{{{
+ @@ -93,9 +93,15 @@ sub preprocess (@) {
$imgurl="$config{url}/$imglink";
}
@@ -42,7 +42,7 @@ And here's a patch to implement it. Will this survive markdown munging? It seems
+ $result .= '/></a>';
+
+ return $result;
- } #}}}
+ }
1
--
diff --git a/doc/bugs/inline_sort-by-title_issues.mdwn b/doc/bugs/inline_sort-by-title_issues.mdwn
index 884846b32..ff4555067 100644
--- a/doc/bugs/inline_sort-by-title_issues.mdwn
+++ b/doc/bugs/inline_sort-by-title_issues.mdwn
@@ -23,7 +23,7 @@ And here is a [[patch]] for this. It makes `sort=title` actually sort on the ti
index 9c336e7..99f6de3 100644
--- a/IkiWiki/Plugin/inline.pm
+++ b/IkiWiki/Plugin/inline.pm
- @@ -185,9 +185,12 @@ sub preprocess_inline (@) { #{{{
+ @@ -185,9 +185,12 @@ sub preprocess_inline (@) {
}
}
diff --git a/doc/bugs/mercurial_fail_to_add.mdwn b/doc/bugs/mercurial_fail_to_add.mdwn
index dab40d684..3bbf4e5fd 100644
--- a/doc/bugs/mercurial_fail_to_add.mdwn
+++ b/doc/bugs/mercurial_fail_to_add.mdwn
@@ -6,7 +6,7 @@ Here is a patch that's seems to work, although I'm not quite sure what's wrong w
--- mercurial.pm 2007-03-24 16:14:35.000000000 +0100
+++ /home/hbernard/mercurial.pm 2007-04-19 19:05:47.000000000 +0200
@@ -95,7 +95,7 @@
- sub rcs_add ($) { # {{{
+ sub rcs_add ($) {
my ($file) = @_;
- my @cmdline = ("hg", "-q", "-R", "$config{srcdir}", "add", "$file");
diff --git a/doc/bugs/methodResponse_in_add__95__plugins.mdwn b/doc/bugs/methodResponse_in_add__95__plugins.mdwn
index 8a88f4eda..c82b532db 100644
--- a/doc/bugs/methodResponse_in_add__95__plugins.mdwn
+++ b/doc/bugs/methodResponse_in_add__95__plugins.mdwn
@@ -26,7 +26,7 @@
index e476521..d43abd4 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
- @@ -471,7 +471,11 @@ sub loadplugins () { #{{{
+ @@ -471,7 +471,11 @@ sub loadplugins () {
unshift @INC, possibly_foolish_untaint($config{libdir});
}
diff --git a/doc/bugs/multiple_pages_with_same_name.mdwn b/doc/bugs/multiple_pages_with_same_name.mdwn
index 5ddfb1f6b..20c38c062 100644
--- a/doc/bugs/multiple_pages_with_same_name.mdwn
+++ b/doc/bugs/multiple_pages_with_same_name.mdwn
@@ -28,14 +28,14 @@ Suggestions welcome.
index 4e4da11..853f905 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
- @@ -618,7 +618,7 @@ sub pagename ($) { #{{{
+ @@ -618,7 +618,7 @@ sub pagename ($) {
my $type=pagetype($file);
my $page=$file;
- $page=~s/\Q.$type\E*$// if defined $type;
+ $page=~s/\Q.$type\E*$// if defined $type && !$hooks{htmlize}{$type}{leavesuffix};
return $page;
- } #}}}
+ }
diff --git a/t/pagename.t b/t/pagename.t
index 96e6a87..58811b9 100755
@@ -61,7 +61,7 @@ I wonder if this patch will also be useful:
index 752d176..3f1b67b 100644
--- a/IkiWiki/Render.pm
+++ b/IkiWiki/Render.pm
- @@ -279,7 +279,11 @@ sub refresh () { #{{{
+ @@ -279,7 +279,11 @@ sub refresh () {
else {
$f=~s/^\Q$config{srcdir}\E\/?//;
push @files, $f;
diff --git a/doc/bugs/pagespec_parsing_chokes_on_function__40____41__.mdwn b/doc/bugs/pagespec_parsing_chokes_on_function__40____41__.mdwn
index a2eba694c..78fed0e5d 100644
--- a/doc/bugs/pagespec_parsing_chokes_on_function__40____41__.mdwn
+++ b/doc/bugs/pagespec_parsing_chokes_on_function__40____41__.mdwn
@@ -54,7 +54,7 @@ case the user is given to rebuilding the wiki by hand. --Ethan
+ }
return IkiWiki::FailReason->new("syntax error") if $@;
return $ret;
- } #}}}
+ }
</pre>
> Thanks, [[done]] --[[Joey]]
diff --git a/doc/bugs/prune_causing_taint_mode_failures.mdwn b/doc/bugs/prune_causing_taint_mode_failures.mdwn
index 1876d9129..5fc1d8b75 100644
--- a/doc/bugs/prune_causing_taint_mode_failures.mdwn
+++ b/doc/bugs/prune_causing_taint_mode_failures.mdwn
@@ -11,7 +11,7 @@ I've no idea what's happening (hey, I'm a C programmer), but I've hacked prune()
<pre>
use Scalar::Util qw(tainted);
-sub prune ($) { #{{{
+sub prune ($) {
my $file=shift;
unlink($file);
@@ -25,7 +25,7 @@ sub prune ($) { #{{{
$dir = $1;
}
}
-} #}}}
+}
</pre>
> Old versions of perl are known to have bugs with taint checking.
diff --git a/doc/bugs/quieten_mercurial.mdwn b/doc/bugs/quieten_mercurial.mdwn
index 26f833e5f..3fd75ea1b 100644
--- a/doc/bugs/quieten_mercurial.mdwn
+++ b/doc/bugs/quieten_mercurial.mdwn
@@ -6,7 +6,7 @@ messages which are then taken for CGI output, causing errors and general trouble
@@ -55,7 +55,7 @@
}
- sub rcs_update () { #{{{
+ sub rcs_update () {
- my @cmdline = ("hg", "-R", "$config{srcdir}", "update");
+ my @cmdline = ("hg", "-q", "-R", "$config{srcdir}", "update");
if (system(@cmdline) != 0) {
@@ -22,7 +22,7 @@ messages which are then taken for CGI output, causing errors and general trouble
if (system(@cmdline) != 0) {
warn "'@cmdline' failed: $!";
@@ -92,7 +92,7 @@
- sub rcs_add ($) { # {{{
+ sub rcs_add ($) {
my ($file) = @_;
- my @cmdline = ("hg", "-R", "$config{srcdir}", "add", "$file");
diff --git a/doc/bugs/search_for_locale_data_in_the_installed_location.mdwn b/doc/bugs/search_for_locale_data_in_the_installed_location.mdwn
index 0a2b1efea..dace2ca19 100644
--- a/doc/bugs/search_for_locale_data_in_the_installed_location.mdwn
+++ b/doc/bugs/search_for_locale_data_in_the_installed_location.mdwn
@@ -2,7 +2,7 @@ It seems like gettext only searches for locale information in /usr/share/locale,
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
- @@ -1057,6 +1057,7 @@ sub gettext { #{{{
+ @@ -1057,6 +1057,7 @@ sub gettext {
$gettext_obj=undef;
return shift;
}
diff --git a/doc/bugs/tbasewiki__95__brokenlinks.t_broken.mdwn b/doc/bugs/tbasewiki__95__brokenlinks.t_broken.mdwn
index ac895896a..db3917d21 100644
--- a/doc/bugs/tbasewiki__95__brokenlinks.t_broken.mdwn
+++ b/doc/bugs/tbasewiki__95__brokenlinks.t_broken.mdwn
@@ -25,12 +25,12 @@ After some digging I found that HTML::Template is being required after the new s
filter => sub {
my $text_ref = shift;
@@ -857,6 +856,7 @@
- } #}}}
+ }
- sub template ($;@) { #{{{
+ sub template ($;@) {
+ require HTML::Template;
HTML::Template->new(template_params(@_));
- } #}}}
+ }
**That** gave me:
diff --git a/doc/plugins/contrib/headinganchors.mdwn b/doc/plugins/contrib/headinganchors.mdwn
index ef2fa122a..c80cc0b49 100644
--- a/doc/plugins/contrib/headinganchors.mdwn
+++ b/doc/plugins/contrib/headinganchors.mdwn
@@ -12,9 +12,9 @@ rst and any other format that produces html. The code is available here:
use strict;
use IkiWiki 2.00;
- sub import { #{{{
+ sub import {
hook(type => "sanitize", id => "headinganchors", call => \&headinganchors);
- } # }}}
+ }
sub text_to_anchor {
my $str = shift;
@@ -26,11 +26,11 @@ rst and any other format that produces html. The code is available here:
return $str;
}
- sub headinganchors (@) { #{{{
+ sub headinganchors (@) {
my %params=@_;
my $content=$params{content};
$content=~s{<h([0-9])>([^>]*)</h([0-9])>}{'<h'.$1.' id="'.text_to_anchor($2).'">'.$2.'</h'.$3.'>'}gie;
return $content;
- } # }}}
+ }
1
diff --git a/doc/plugins/contrib/siterel2pagerel.mdwn b/doc/plugins/contrib/siterel2pagerel.mdwn
index 956b6728f..9b09657bf 100644
--- a/doc/plugins/contrib/siterel2pagerel.mdwn
+++ b/doc/plugins/contrib/siterel2pagerel.mdwn
@@ -13,11 +13,11 @@ other format that produces html. The code is available here:
use strict;
use IkiWiki 2.00;
- sub import { #{{{
+ sub import {
hook(type => "sanitize", id => "siterel2pagerel", call => \&siterel2pagerel);
- } # }}}
+ }
- sub siterel2pagerel (@) { #{{{
+ sub siterel2pagerel (@) {
my %params=@_;
my $baseurl=IkiWiki::baseurl($params{page});
my $content=$params{content};
@@ -25,6 +25,6 @@ other format that produces html. The code is available here:
$content=~s/(<img(?:\s+(?:class|id|width|height)\s*="?\w+"?)*)\s+src=\s*"\/([^"]*)"/$1 src="$baseurl$2"/mig;
# FIXME: do <script and everything else that can have URLs in it
return $content;
- } # }}}
+ }
1
diff --git a/doc/plugins/contrib/unixauth.mdwn b/doc/plugins/contrib/unixauth.mdwn
index d91ed45f1..76a847744 100644
--- a/doc/plugins/contrib/unixauth.mdwn
+++ b/doc/plugins/contrib/unixauth.mdwn
@@ -22,7 +22,7 @@ __Security__: [As with passwordauth](/security/#index14h2), be wary of sending u
--- Wrapper.pm.orig 2008-07-29 00:09:10.000000000 -0400
+++ Wrapper.pm
- @@ -28,7 +28,7 @@ sub gen_wrapper () { #{{{
+ @@ -28,7 +28,7 @@ sub gen_wrapper () {
my @envsave;
push @envsave, qw{REMOTE_ADDR QUERY_STRING REQUEST_METHOD REQUEST_URI
CONTENT_TYPE CONTENT_LENGTH GATEWAY_INTERFACE
@@ -46,16 +46,16 @@ __Security__: [As with passwordauth](/security/#index14h2), be wary of sending u
use strict;
use IkiWiki 2.00;
- sub import { #{{{
+ sub import {
hook(type => "getsetup", id => "unixauth", call => \&getsetup);
hook(type => "formbuilder_setup", id => "unixauth",
call => \&formbuilder_setup);
hook(type => "formbuilder", id => "unixauth",
call => \&formbuilder);
hook(type => "sessioncgi", id => "unixauth", call => \&sessioncgi);
- } # }}}
+ }
- sub getsetup () { #{{{
+ sub getsetup () {
return
unixauth_type => {
type => "string",
@@ -83,10 +83,10 @@ __Security__: [As with passwordauth](/security/#index14h2), be wary of sending u
safe => 0,
rebuild => 1,
},
- } #}}}
+ }
# Checks if a string matches a user's password, and returns true or false.
- sub checkpassword ($$;$) { #{{{
+ sub checkpassword ($$;$) {
my $user=shift;
my $password=shift;
my $field=shift || "password";
@@ -131,9 +131,9 @@ __Security__: [As with passwordauth](/security/#index14h2), be wary of sending u
}
return $ret;
- } #}}}
+ }
- sub formbuilder_setup (@) { #{{{
+ sub formbuilder_setup (@) {
my %params=@_;
my $form=$params{form};
@@ -204,7 +204,7 @@ __Security__: [As with passwordauth](/security/#index14h2), be wary of sending u
}
}
- sub formbuilder (@) { #{{{
+ sub formbuilder (@) {
my %params=@_;
my $form=$params{form};
@@ -225,12 +225,12 @@ __Security__: [As with passwordauth](/security/#index14h2), be wary of sending u
my $user_name=$form->field('name');
}
}
- } #}}}
+ }
- sub sessioncgi ($$) { #{{{
+ sub sessioncgi ($$) {
my $q=shift;
my $session=shift;
- } #}}}
+ }
1
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;
+