diff options
author | Joey Hess <joey@gnu.kitenet.net> | 2009-04-04 17:27:48 -0400 |
---|---|---|
committer | Joey Hess <joey@gnu.kitenet.net> | 2009-04-04 17:27:48 -0400 |
commit | 8e92468eae9ac0ab8161a0c71ff6c6a0a8aef07a (patch) | |
tree | 9e26465e0ca98a5f3cbc6c72a0cace4bf83b93db /doc/todo | |
parent | 78a69e5bd632eb86ef8135e9c1d05d2c48b43362 (diff) | |
parent | 08fda4c9d374de1d3de3172a192d4d915d3dc0c1 (diff) |
Merge branch 'master'
Conflicts:
doc/ikiwiki-makerepo.mdwn
Diffstat (limited to 'doc/todo')
99 files changed, 2296 insertions, 550 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_camelcase_exclusions.mdwn b/doc/todo/Add_camelcase_exclusions.mdwn new file mode 100644 index 000000000..6b86132a0 --- /dev/null +++ b/doc/todo/Add_camelcase_exclusions.mdwn @@ -0,0 +1,23 @@ +Camelcase currently looks for any and call camelcase words and turns them into wiki links. This patch adds a config item called <code>camelcase_ignore</code> which is an array of camelcase words to ignore. + +<pre> +--- /usr/share/perl5/IkiWiki/Plugin/camelcase.pm.orig 2008-12-24 11:49:14.000000000 +1300 ++++ /usr/share/perl5/IkiWiki/Plugin/camelcase.pm 2008-12-24 12:02:21.000000000 +1300 +@@ -33,7 +33,11 @@ + my $destpage=$params{destpage}; + + $params{content}=~s{$link_regexp}{ +- htmllink($page, $destpage, IkiWiki::linkpage($1)) ++ if (grep {/$1/} @{ $config{'camelcase_ignore'} }) { ++ $1 ++ } else { ++ htmllink($page, $destpage, IkiWiki::linkpage($1)) ++ } + }eg; + + return $params{content}; +</pre> + +--[[puck]] + +[[done]] diff --git a/doc/todo/Add_showdown_GUI_input__47__edit.mdwn b/doc/todo/Add_showdown_GUI_input__47__edit.mdwn index e864f5351..7e7947fbc 100644 --- a/doc/todo/Add_showdown_GUI_input__47__edit.mdwn +++ b/doc/todo/Add_showdown_GUI_input__47__edit.mdwn @@ -27,3 +27,5 @@ A demo is at <http://www.attacklab.net/showdown-gui.html> >>> be necessary to insert some sort of placeholder, perhaps by outputting >>> the text in monospace form w/ a lighter font to denote that it won't >>> directly be shown in the page... -- [[harningt]] + +>>>>> We have a wmd plugin now. --[[Joey]] 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_disabling_edit_and_preferences_links.mdwn b/doc/todo/Allow_disabling_edit_and_preferences_links.mdwn new file mode 100644 index 000000000..a356c69df --- /dev/null +++ b/doc/todo/Allow_disabling_edit_and_preferences_links.mdwn @@ -0,0 +1,54 @@ +This patch allows disabling the edit and preferences link in the config file. It is backwards compatible (so peoples edit and preferences links won't suddenly vanish). + +To disable edit or prefs respectively, add the following to the config file: + +<pre> + 'edit' => 0, + 'prefs' => 0, +</pre> + +Patch: +<pre> +--- /usr/share/perl5/IkiWiki/Render.pm.orig 2008-12-23 16:49:00.000000000 +1300 ++++ /usr/share/perl5/IkiWiki/Render.pm 2008-12-23 16:55:40.000000000 +1300 +@@ -80,8 +80,10 @@ + my $actions=0; + + if (length $config{cgiurl}) { +- $template->param(editurl => cgiurl(do => "edit", page => $page)); +- $template->param(prefsurl => cgiurl(do => "prefs")); ++ $template->param(editurl => cgiurl(do => "edit", page => $page)) ++ if ! defined $config{edit} || (defined $config{edit} && $config{edit} == 1); ++ $template->param(prefsurl => cgiurl(do => "prefs")) ++ if ! defined $config{prefs} || (defined $config{prefs} && $config{prefs} == 1); + $actions++; + } + +</pre> + +> On irc, you said, "That was to allow the hack to of using wikistatedir to +> allow me to generate two websites, one with inline editting, the other a +> static page for public consumption." +> +> The edit and preferences links can already be disabled by editing +> `page.tmpl`. (Look for PREFSURL and EDITURL). +> +> More to the point though, disabling those links does not disable anyone +> consticting the urls by hand and logging in and editing a page. So you'd +> really want to disable the editpage plugin in the setup file for the +> public, static wiki. Sounds like you might also want to turn off cgi +> entirely for that build. --[[Joey]] + +>> I want to retain the same page.tmpl for both sites (different templates +>> will just increase the maintenance hell), so disabling the links in the +>> config for one public site works better in my case. +>> +>> I do have the editpage plugin disabled for the public static wiki, but +>> the link still appears on the site. I want to keep the cgi on, so that +>> the site is still searchable. --[[puck]] + +>>> For me, disabling the editpage plugin does make the "Edit" link +>>> disappear (this is with 3.03) but as far as I can tell, "Preferences" +>>> is not controlled by any plugin. It would be nice if it were; I am +>>> trying to achieve a configuration where the only action supported +>>> via CGI is blog-style comments. --[Zack](http://zwol.livejournal.com/) 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/Allow_filenames_that_are_all_type.mdwn b/doc/todo/Allow_filenames_that_are_all_type.mdwn new file mode 100644 index 000000000..bebbcafa8 --- /dev/null +++ b/doc/todo/Allow_filenames_that_are_all_type.mdwn @@ -0,0 +1,41 @@ +This is a [[patch]] to allow filenames that are just the type. The best example of this is wanting to +pass a `Makefile` through one of the [[todo/syntax_highlighting/]] plugins. With this patch, +if the plugin can process files of type `.Makefile` then it will also process `Makefile`. + +I put this patch on the [[todo/syntax_highlighting/]] page a while ago, but it seemed to get +lost because it didn't have its own bug to track it. Now it does :). -- [[Will]] + +> This changes `pagename()`, but what about `pagetype()`? +> Many things in ikiwiki check if `pagetype($file)` returns +> true to see if it's a page, etc. --[[Joey]] + +>> I think this patch is complete. It does not change `pagename()`, it +>> changes `pagetype()` (the diff is fairly old - line numbers may have +>> changed). +>> +>> Before this patch, `pagetype()` required a `.` in the page name. With +>> this patch it doesn't, as long as the extension is being kept. This allows +>> the filename to be all extension. `pagename()` relies on `pagetype()` +>> to detect the type. `pagename()` also removes the extension on some +>> pages, but this patch only affects pages where the extension isn't +>> removed. +>> +>> So, yeah, I think this patch is complete. :) -- [[Will]] + +>>> Thanks, [[applied|done]], but I added a noextension parameter, +>>> since having keepextension allow files with no extension didn't make +>>> sense. Also, made it work for pages in subdirs.. --[[Joey]] + + diff --git a/IkiWiki.pm b/IkiWiki.pm + index 8d728c9..1bd46a9 100644 + --- a/IkiWiki.pm + +++ b/IkiWiki.pm + @@ -618,6 +618,8 @@ sub pagetype ($) { + + if ($page =~ /\.([^.]+)$/) { + return $1 if exists $hooks{htmlize}{$1}; + + } elsif ($hooks{htmlize}{$page}{keepextension}) { + + return $page; + } + return; + } 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/Feature_parity_with_Trac.mdwn b/doc/todo/Feature_parity_with_Trac.mdwn index 8693da5e3..b2d9d43ed 100644 --- a/doc/todo/Feature_parity_with_Trac.mdwn +++ b/doc/todo/Feature_parity_with_Trac.mdwn @@ -5,11 +5,12 @@ Features needed: * Wiki, duh. * Source code viewing: This can be handled quite well with a [[shortcut|shortcuts]] to an external source viewer, or by putting - the source in the wiki itself (see the [[todo/automatic_use_of_syntax_plugin_on_source_code_files]] wishlist item) and using the - [[plugins/contrib/highlightcode]] or [[plugins/contrib/sourcehighlight]] plugins. + the source in the wiki itself (see the [[todo/automatic_use_of_syntax_plugin_on_source_code_files]] wishlist item and [[todo/syntax_highlighting]] todo item). * This could be improved with [[todo/source_link]]. * Currently the source highlighting is a little problematic, as there can be two source files with the same wikiname. e.g. a `hello-world.c` and `hello-world.h`. See [[bugs/multiple_pages_with_same_name]] + > That bug was fixed before you linked to the page. :-) + >> I was the one that fixed it... :) -- [[Will]] * Trac 'Timeline' feature: view history of the RCS - the `recentchanges` button. * Trac 'Roadmap' feature: Which TODOs/bugs are needed for which milestones. Use the [[plugins/progress]] directive to show percentage complete for each milestone. * Bug tracking: see [[tips/integrated_issue_tracking_with_ikiwiki]] and [[todo/Updated_bug_tracking_example]]. diff --git a/doc/todo/Gallery.mdwn b/doc/todo/Gallery.mdwn index fbf1802fd..bc1d5bea4 100644 --- a/doc/todo/Gallery.mdwn +++ b/doc/todo/Gallery.mdwn @@ -1,6 +1,6 @@ New Version of gallery is available now. Few more features have been added like support for multiple pages, sorting and resizing of images etc. -SVN repository of plugin is located at http://ned.snow-crash.org:8080/svn/ikiwiki-gallery +Gallery repo is now available at <http://github.com/joeyh/ikiwiki/tree/gallery> --[[arpitjain]] @@ -73,3 +73,9 @@ Additional details are available [here](http://myweb.unomaha.edu/~ajain/ikiwikig > the gallery and put it in a "gallery" branch of my git repository. > > --[[Joey]] + +---- + +See also [[/users/smcv/gallery]] for another implementation of the same sort of +thing. Unfortunately, none of the implementation ideas +I have there seem quite right either... --[[smcv]] 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/Improve_display_of_OpenIDs.mdwn b/doc/todo/Improve_display_of_OpenIDs.mdwn new file mode 100644 index 000000000..e2ba1d90d --- /dev/null +++ b/doc/todo/Improve_display_of_OpenIDs.mdwn @@ -0,0 +1,5 @@ +Some OpenIDs seen in the IkiWiki git history are displayed poorly in [[RecentChanges]], including mine :-) (`http://smcv.pseudorandom.co.uk/`, shown as `smcv.pseudorandom [co.uk]`) + +My `openid` branch on <http://git.pseudorandom.co.uk/> improves on a couple of cases and adds a regression test. --[[smcv]] + +[[!tag patch done]] 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/New_preprocessor_directive_syntax/discussion.mdwn b/doc/todo/New_preprocessor_directive_syntax/discussion.mdwn index dda1ff5e9..f6c0fc0ec 100644 --- a/doc/todo/New_preprocessor_directive_syntax/discussion.mdwn +++ b/doc/todo/New_preprocessor_directive_syntax/discussion.mdwn @@ -1,2 +1,19 @@ Err, is this really fixed in 2.21? I can't find it anywhere in 2.32.3 (debian unstable) + +----- + +I just did a `--dumpsetup` with the current version from the Git repository +and the default option is + + # use '!'-prefixed preprocessor directives? + prefix_directives => 0, + +My impression was that this should be enabled by default now. --[[JasonBlevins]] + +> As stated in `debian/NEWS`: +>> For backward compatibility with existing wikis, +>> refix_directives currently defaults to false. In ikiwiki 3.0, +>> prefix_directives will default to true [...] +> --[[intrigeri]] + diff --git a/doc/todo/Option_to_make_title_an_h1__63__.mdwn b/doc/todo/Option_to_make_title_an_h1__63__.mdwn index efa07ad79..f4023d6dd 100644 --- a/doc/todo/Option_to_make_title_an_h1__63__.mdwn +++ b/doc/todo/Option_to_make_title_an_h1__63__.mdwn @@ -6,3 +6,9 @@ Currently, the page title (either the name of the page or the title specified wi > way, # is reserved for h1 if you choose to use headers in your page. --[[Joey]] [[done]] + +> For anyone interested, I've written a small plugin called [h1title][] that does the +> latter, making `#` (only when on the first line) set the page title, removing it from +> the page body. --[[JasonBlevins]], October 22, 2008 + + [h1title]: http://code.jblevins.org/ikiwiki/plugins.git/plain/h1title.pm diff --git a/doc/todo/RecentChanges_page_links_without_cgi_wrapper.mdwn b/doc/todo/RecentChanges_page_links_without_cgi_wrapper.mdwn new file mode 100644 index 000000000..b37109032 --- /dev/null +++ b/doc/todo/RecentChanges_page_links_without_cgi_wrapper.mdwn @@ -0,0 +1,26 @@ +Links to the changed page on RecentChanges only show up if the cgi wrapper is +enabled. It would be nice if links were also generated on wikis that do not use +the cgi. [[svend]] + +> It would be, but doing so would make updating the recentchanges page for +> each commit a lot slower, or would result in there often being broken +> links there. +> +> The broken links would happen if a page is removed. +> +> The speed issue is that currently each individual change in the +> recentchanges page is built just once, when the change is made, and the +> html for it is reused thereafter. To avoid broken links, it would need to +> regenerate each change's html on each commit. That's 100x the overhead. +> (Perhaps it's possible to be smarter about which need generation tho.) +> +> The best way to approach this that I can see ATM is to use the +> [[plugins/404]] plugin to handle the broken links and then recentchanges +> could avoid explicitly using the CGI. But this doesn't meet your use case +> of having no CGI. +> +> If you're willing to live with broken links to removed pages, I suppose +> that could be made an option.. +> --[[Joey]] + +[[!tag wishlist]] 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/Untrusted_push_in_Monotone.mdwn b/doc/todo/Untrusted_push_in_Monotone.mdwn new file mode 100644 index 000000000..a8b1cd7c4 --- /dev/null +++ b/doc/todo/Untrusted_push_in_Monotone.mdwn @@ -0,0 +1,28 @@ +As noted in [[tips/untrusted_git_push]] an untrusted push capability was added recently, but only implemented in git. +(See also [[todo/rcs_updates_needed]]) + +This note describes (but does not implement) an approach for this with the [[rcs/monotone]] rcs backend. + +---- + +Monotone behaves a little differently to git in its networking. Git allows anyone to try to push, and then +check whether it is ok before finally accepting it. Monotone has no way to accept or reject revisions +in this way. However, monotone does have the ability to mark revisions, and to ignore unmarked revisions. + +This marking capability can be used to achieve a somewhat similar effect to what happens with git. The +problem with this is that anyone could put anything into the monotone database, and while this wouldn't +affect ikiwiki, it seems bad to leave open, untrusted storage on the web. + +The Plan +===== + +In the `note_netsync_revision_received` hook in the monotone server, have the server check to make sure +that either a) the revision is signed by someone trusted or, b) the revision is checked using the same +hook that git uses in `pre-receive`. If the revision passes the ikiwiki `pre-receive` check then the +monotone hook signs the revision. This gives that revision the 'ikiwiki seal of approval'. + +You'll also want to update the monotone trust hooks to only trust revisions signed by trusted people, or +ikiwiki. + +Now anyone can upload a revision, but only those signed by a trusted person, or which pass the ikiwiki +check and so get signed by the ikiwiki key, will be seen by ikiwiki. 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/allow_disabling_backlinks.mdwn b/doc/todo/allow_disabling_backlinks.mdwn new file mode 100644 index 000000000..5dd4876e8 --- /dev/null +++ b/doc/todo/allow_disabling_backlinks.mdwn @@ -0,0 +1,18 @@ +This patch allows disabling the backlinks in the config file by setting nobacklinks to 0. + +It is backwards compatible, and by default enables backlinks in the generated pages. + +<pre> +--- IkiWiki/Render.pm.orig2 2009-01-06 14:54:01.000000000 +1300 ++++ IkiWiki/Render.pm 2009-01-06 14:55:08.000000000 +1300 +@@ -107,7 +107,8 @@ + $template->param(have_actions => 1); + } + +- my @backlinks=sort { $a->{page} cmp $b->{page} } backlinks($page); ++ my @backlinks=sort { $a->{page} cmp $b->{page} } backlinks($page) ++ unless defined $config{nobacklinks} && $config{nobacklinks} == 0; + my ($backlinks, $more_backlinks); + if (@backlinks <= $config{numbacklinks} || ! $config{numbacklinks}) { + $backlinks=\@backlinks; +</pre> diff --git a/doc/todo/anti-spam_protection.mdwn b/doc/todo/anti-spam_protection.mdwn index cb45faee5..b0524be5f 100644 --- a/doc/todo/anti-spam_protection.mdwn +++ b/doc/todo/anti-spam_protection.mdwn @@ -17,3 +17,14 @@ Cheers, You might look at the Wikipedia page on "Spam\_in\_blogs" for more ideas. In particular, would it be possible to force a subset of the pages (by regex, but you'd choose the regex to match those pages which are publicly writable) to use rel="nofollow" in all links. > I just wanted to leave a link here to the [[todo/require_CAPTCHA_to_edit]] plugin patch. Unfortunately that plugin currently interacts badly with the openid plugin. -- [[Will]] + + +--- + +Ikiwiki now has a checkcontent hook that plugins can use to see content +that is being entered and check it for spam/whatever. + +There is a blogspam plugin that uses the blogspam.org service +to check for common spam signatures. --[[Joey]] + +[[done]] diff --git a/doc/todo/apache_404_ErrorDocument_handler.mdwn b/doc/todo/apache_404_ErrorDocument_handler.mdwn new file mode 100644 index 000000000..4ae1d1a79 --- /dev/null +++ b/doc/todo/apache_404_ErrorDocument_handler.mdwn @@ -0,0 +1,25 @@ +Apache's ErrorDocument directive lets you write a CGI script that will be invoked for all 404s. +IkiWiki could offer one as an optional wrapper; it would do much the same thing that the +existing recentchanges_link (or [[generic___39__do__61__goto__39___for_CGI]]) does when +encountering a nonexistent page. + +I think it'd probably have to be a separate CGI script because the environment with which +404 handlers are invoked is somewhat odd, and because it needs to return a 404 status +(having said that, it might make sense for `recentchanges_link` to return 404 rather than +200 anyway if the page doesn't exist). + +> This turns out to be untrue, as long as the wrapper lets a couple of extra +> environment variables through. --[[smcv]] + +This would give IkiWiki the behaviour of many other wikis, where visiting a page that +does not yet exist prompts you to create it, without having to invoke the CGI for +successful requests. + +Due to [a well-known MSIE misfeature](http://support.microsoft.com/default.aspx?scid=kb;en-us;Q294807), +error output needs to be at least 512 bytes long, so some padding might also be required. + +Implemented in the 'goto' branch in my git repository. You can see this +feature in action [on my blog](http://smcv.pseudorandom.co.uk/no/such/page/). +--[[smcv]] + +[[done]] diff --git a/doc/todo/applydiff_plugin.mdwn b/doc/todo/applydiff_plugin.mdwn index d3eb9793b..d26b0dfe9 100644 --- a/doc/todo/applydiff_plugin.mdwn +++ b/doc/todo/applydiff_plugin.mdwn @@ -1,4 +1,4 @@ -[[!tag wishlist]] +[[!tag wishlist done]] [[!toc ]] @@ -54,3 +54,57 @@ modify only *one* page may be easier. Implementation ============== + +Also see [[joey]]'s idea on [[users/xma/discussion]], to allow (filtered) anonymous push to this wiki's repository. + +> Ideally the filtering should apply the same constraints on what's pushed +> as are applied to web edits. So locked pages can't be changed, etc. +> +> That could be accomplished by making the git pre-receive hook be a +> ikiwiki wrapper. A new `git_receive_wrapper` config setting could cause +> the wrapper to be generated, with `$config{receive}` set to true. +> +> When run that way, ikiwiki would call `rcs_receive`. In the case of git, +> that would look at the received changes as fed into the hook on stdin, +> and use `parse_diff_tree` to get a list of the files changed. Then it +> could determine if the changes were allowed. +> +> To do that, it should first look at what unix user received the +> commit. That could be mapped directly to an ikiwiki user. This would +> typically be an unprivelidged user (that was set up just to allow +> anonymous pushes), but you might also want to set up +> separate users who have fewer limits on what they can push. And, of +> course, pushes from the main user, who owns the wiki, would not be +> checked at all. So, let's say `$config{usermap}` is a hash, something +> like `{usera => "wikiusera", userb => "wikiuserb"}`, and pushes from +> users not in the hash are not checked. +> +> Then it seems like it would want to call `check_canedit` to test if an +> edit to each changed page is allowed. Might also want to call +> `check_canattach` and `check_canremove` if the attach and remove plugins +> are enabled. All three expect to be passed a CGI and a CGI::Session +> object, which is a bit problimatic here. So dummy the objects up? (To call +> `check_canattach` the changed attachment would need to be extracted to a +> temp file for it to check..) +> +> If a change is disallowed, it would print out what was disallowed, and +> exit nonzero. I think that git then discards the pushed objects (or maybe +> they remain in the database until `git-gc` .. if so, that could be used +> to DOS by uploading junk, so need to check this point). +> +> Also, I've not verified that the objects have been recieved already when +> whe pre-receive hook is called. Although the docs seem to say that is the +> case. --[[Joey]] + +>> Update: The git pre-receive hook stuff is written, and seems to work. +>> I think it makes more sense than using diffs, and so think this todo +>> could probably be closed. +>> --[[Joey]] + +>>> I agree, closing this. I really prefer this solution to the one I was +>>> initially proposing. +>>> Is this pre-receive hook already enabled on ikiwiki.info? +>>> If not, do you plan to enable it at some point? +>>> --[[intrigeri]] + +>>>> [[news/git_push_to_this_wiki]] gave me the answer. Well done! --[[intrigeri]] diff --git a/doc/todo/auto-create_tag_pages_according_to_a_template.mdwn b/doc/todo/auto-create_tag_pages_according_to_a_template.mdwn index bfb4a863b..ab9263556 100644 --- a/doc/todo/auto-create_tag_pages_according_to_a_template.mdwn +++ b/doc/todo/auto-create_tag_pages_according_to_a_template.mdwn @@ -7,3 +7,102 @@ Also see: <http://madduck.net/blog/2008.01.06:new-blog/> and <http://users.itk.p [[!tag wishlist]] I would love to see this as well. -- dato + +--- + +I have create a patch to tag.pm for add the option for auto create tag pages. +A new setting is used to enable or disable auto-create tag pages, `tag_autocreate`. +The new tag file is created during the preprocess phase. +The new tag file is then complied during the change phase. + +_tag.pm from version 3.01_ + + + --- tag.pm 2009-02-06 10:26:03.000000000 -0700 + +++ tag_new.pm 2009-02-06 12:17:19.000000000 -0700 + @@ -14,6 +14,7 @@ + hook(type => "preprocess", id => "tag", call => \&preprocess_tag, scan => 1); + hook(type => "preprocess", id => "taglink", call => \&preprocess_taglink, scan => 1); + hook(type => "pagetemplate", id => "tag", call => \&pagetemplate); + + hook(type => "change", id => "tag", call => \&change); + } + + sub getopt () { + @@ -36,6 +37,36 @@ + safe => 1, + rebuild => 1, + }, + + tag_autocreate => { + + type => "boolean", + + example => 0, + + description => "Auto-create the new tag pages, uses autotagpage.tmpl ", + + safe => 1, + + rebulid => 1, + + }, + +} + + + +my $autocreated_page = 0; + + + +sub gen_tag_page($) { + + my $tag=shift; + + + + my $tag_file=$tag.'.'.$config{default_pageext}; + + return if (-f $config{srcdir}.$tag_file); + + + + my $template=template("autotagpage.tmpl"); + + $template->param(tag => $tag); + + writefile($tag_file, $config{srcdir}, $template->output); + + $autocreated_page = 1; + + + + if ($config{rcs}) { + + IkiWiki::disable_commit_hook(); + + IkiWiki::rcs_add($tag_file); + + IkiWiki::rcs_commit_staged( + + gettext("Automatic tag page generation"), + + undef, undef); + + IkiWiki::enable_commit_hook(); + + } + } + + sub tagpage ($) { + @@ -47,6 +78,10 @@ + $tag=~y#/#/#s; # squash dups + } + + + if (defined $config{tag_autocreate} && $config{tag_autocreate} ) { + + gen_tag_page($tag); + + } + + + return $tag; + } + + @@ -125,4 +160,18 @@ + } + } + + +sub change(@) { + + return unless($autocreated_page); + + $autocreated_page = 0; + + + + # This refresh/saveindex is to complie the autocreated tag pages + + IkiWiki::refresh(); + + IkiWiki::saveindex(); + + + + # This refresh/saveindex is to fix the Tags link + + # With out this additional refresh/saveindex the tag link displays ?tag + + IkiWiki::refresh(); + + IkiWiki::saveindex(); + +} + + + + +This uses a template called `autotagpage.tmpl`, here is my template file: + + \[[!inline pages="link(<TMPL_VAR TAG>)" archive="yes"]] + + +A quirk I have not figured out is during the `sub change`, see my comments in the code. +I am not sure if that is the best way to handle it. + +[[!tag patch]] +-- Jeremy Schultz <jeremy.schultz@uleth.ca> 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 2fad9f19a..8bc75420d 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 @@ -1,13 +1,66 @@ Here is another [[patch]] for this. It is more up to date than either of the patches linked on the previous page. It is most similar to [[plugins/contrib/sourcehighlight]]. -Note that if this is being used with `c` or `c++` then you'll probably want to wait until [[bugs/multiple_pages_with_same_name]] is fixed. +Updated to use fix noted in [[bugs/multiple_pages_with_same_name]]. -- [[Will]] ---- +I was trying to replace sourcehighlight with sourcecode. I had to modify the +htmlize call slightly so that it would work in a format directive. +([modified version](http://pivot.cs.unb.ca/git/?p=ikiplugins.git;a=blob_plain;f=IkiWiki/Plugin/sourcecode.pm;hb=21fc57091edb9)) + +> I haven't tested them, but those changes look sensible to me. -- [[Will]] + +I hit a wall the following example (the last commit in the above repo). + + \[[!meta title="Solutions to assignment 1"]] + + - [[!format cc """ + test + """]] + + +> I haven't actually tested this to see what the problem is. How does this fail? +> Does source-highlight barf on the non-c++ content? Is there a wiki URL that shows the failure? -- [[Will]] +>> Here is the content div from the output page +>> [[DavidBremner]] + + <div id="content"> + <p><ul> + <li><div id="sourcecode"></li> + </ul> + 2beb4fd7289998159f61976143f66bb6</p> + + <p></div></p> + + </div> + +>>> That is quite strange. I tested your version of the plugin. I had to revert one your changes to get it to +>>> work: the linenumber argument should not have a space at the end of it. Once I made that change, +>>> everything worked as expected. The output I get for your example is below: + + <div id="content"> + <ul> + <li><div id="sourcecode"></li> + </ul> + + <pre><tt><span class="linenum">00001:</span> <span class="normal">test</span></tt></pre> + + <p></div></p> + + </div> + +>>> I don't know what is going wrong for you... source-highlight, Markdown or something else. +>>> I do find it interesting the way the sourcecode `div` and the list get interleaved. That +>>> just looks like a Markdown thing though. +>>> In any case, I've updated the patch below to include most of your changes. -- [[Will]] + +---- #!/usr/bin/perl # markup source files + # Originally by Will Uther + # With modifications by David Bremner package IkiWiki::Plugin::sourcecode; use warnings; @@ -17,143 +70,145 @@ Note that if this is being used with `c` or `c++` then you'll probably want to w my %metaheaders; - 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 () { #{{{ - return - plugin => { - safe => 1, - rebuild => 1, # format plugin - }, - sourcecode_command => { - type => "string", - example => "/usr/bin/source-highlight", - description => "The command to execute to run source-highlight", - safe => 0, - rebuild => 1, - }, - sourcecode_lang => { - type => "string", - example => "c,cpp,h,java", - description => "Comma separated list of suffixes to recognise as source code", - safe => 1, - rebuild => 1, - }, - sourcecode_linenumbers => { - type => "boolean", - example => 1, - description => "Should we add line numbers to the source code", - safe => 1, - rebuild => 1, - }, - sourcecode_css => { - type => "string", - example => "sourcecode_style", - description => "page to use as css file for source", - safe => 1, - rebuild => 1, - }, - } #}}} - - sub checkconfig () { #{{{ - if (! $config{sourcecode_lang}) { - error("The sourcecode plugin requires a list of suffixes in the 'sourcecode_lang' config option"); - } - - if (! $config{sourcecode_command}) { - $config{sourcecode_command} = "source-highlight"; - } - - if (! length `which $config{sourcecode_command} 2>/dev/null`) { - error("The sourcecode plugin is unable to find the $config{sourcecode_command} command"); - } - - if (! $config{sourcecode_css}) { - $config{sourcecode_css} = "sourcecode_style"; - } - - if (! defined $config{sourcecode_linenumbers}) { - $config{sourcecode_linenumbers} = 1; - } - - my %langs = (); - - open(LANGS, "$config{sourcecode_command} --lang-list|"); - while (<LANGS>) { - if ($_ =~ /(\w+) = .+\.lang/) { - $langs{$1} = 1; - } - } - close(LANGS); - - foreach my $lang (split(/[, ]+/, $config{sourcecode_lang})) { - if ($langs{$lang}) { - hook(type => "htmlize", id => $lang, call => \&htmlize); - } else { - error("Your installation of source-highlight cannot handle sourcecode language $lang!"); - } - } - } #}}} - - sub htmlize (@) { #{{{ - my %params=@_; - - my $page = $params{page}; - - eval q{use FileHandle}; - error($@) if $@; - eval q{use IPC::Open2}; - error($@) if $@; - - local(*SPS_IN, *SPS_OUT); # Create local handles - - my @args; - - if ($config{sourcecode_linenumbers}) { - push @args, '--line-number= '; - } - - my $pid = open2(*SPS_IN, *SPS_OUT, $config{sourcecode_command}, - '-s', IkiWiki::pagetype($pagesources{$page}), - '-c', $config{sourcecode_css}, '--no-doc', - '-f', 'xhtml', - @args); - - error("Unable to open $config{sourcecode_command}") unless $pid; - - print SPS_OUT $params{content}; - close SPS_OUT; - - my @html = <SPS_IN>; - close SPS_IN; - - waitpid $pid, 0; - - my $stylesheet=bestlink($page, $config{sourcecode_css}.".css"); - if (length $stylesheet) { - push @{$metaheaders{$page}}, '<link href="'.urlto($stylesheet, $page).'"'. - ' rel="stylesheet"'. - ' type="text/css" />'; - } - - return '<div id="sourcecode">'."\r\n".join("\r\n",@html)."\r\n</div>\n"; - } # }}} - - sub pagetemplate (@) { #{{{ - my %params=@_; - - my $page=$params{page}; - my $template=$params{template}; - - if (exists $metaheaders{$page} && $template->query(name => "meta")) { - # avoid duplicate meta lines - my %seen; - $template->param(meta => join("\n", grep { (! $seen{$_}) && ($seen{$_}=1) } @{$metaheaders{$page}})); - } - } # }}} + 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 () { + return + plugin => { + safe => 1, + rebuild => 1, # format plugin + }, + sourcecode_command => { + type => "string", + example => "/usr/bin/source-highlight", + description => "The command to execute to run source-highlight", + safe => 0, + rebuild => 1, + }, + sourcecode_lang => { + type => "string", + example => "c,cpp,h,java", + description => "Comma separated list of suffixes to recognise as source code", + safe => 1, + rebuild => 1, + }, + sourcecode_linenumbers => { + type => "boolean", + example => 1, + description => "Should we add line numbers to the source code", + safe => 1, + rebuild => 1, + }, + sourcecode_css => { + type => "string", + example => "sourcecode_style", + description => "page to use as css file for source", + safe => 1, + rebuild => 1, + }, + } + + sub checkconfig () { + if (! $config{sourcecode_lang}) { + error("The sourcecode plugin requires a list of suffixes in the 'sourcecode_lang' config option"); + } + + if (! $config{sourcecode_command}) { + $config{sourcecode_command} = "source-highlight"; + } + + if (! length `which $config{sourcecode_command} 2>/dev/null`) { + error("The sourcecode plugin is unable to find the $config{sourcecode_command} command"); + } + + if (! $config{sourcecode_css}) { + $config{sourcecode_css} = "sourcecode_style"; + } + + if (! defined $config{sourcecode_linenumbers}) { + $config{sourcecode_linenumbers} = 1; + } + + my %langs = (); + + open(LANGS, "$config{sourcecode_command} --lang-list|"); + while (<LANGS>) { + if ($_ =~ /(\w+) = .+\.lang/) { + $langs{$1} = 1; + } + } + close(LANGS); + + foreach my $lang (split(/[, ]+/, $config{sourcecode_lang})) { + if ($langs{$lang}) { + hook(type => "htmlize", id => $lang, no_override=>1, + call => sub { htmlize(lang=>$lang, @_) }, + keepextension => 1); + } else { + error("Your installation of source-highlight cannot handle sourcecode language $lang!"); + } + } + } + + sub htmlize (@) { + my %params=@_; + + my $page = $params{page}; + + eval q{use FileHandle}; + error($@) if $@; + eval q{use IPC::Open2}; + error($@) if $@; + + local(*SPS_IN, *SPS_OUT); # Create local handles + + my @args; + + if ($config{sourcecode_linenumbers}) { + push @args, '--line-number'; + } + + my $pid = open2(*SPS_IN, *SPS_OUT, $config{sourcecode_command}, + '-s', $params{lang}, + '-c', $config{sourcecode_css}, '--no-doc', + '-f', 'xhtml', + @args); + + error("Unable to open $config{sourcecode_command}") unless $pid; + + print SPS_OUT $params{content}; + close SPS_OUT; + + my @html = <SPS_IN>; + close SPS_IN; + + waitpid $pid, 0; + + my $stylesheet=bestlink($page, $config{sourcecode_css}.".css"); + if (length $stylesheet) { + push @{$metaheaders{$page}}, '<link href="'.urlto($stylesheet, $page).'"'. + ' rel="stylesheet"'. + ' type="text/css" />'; + } + + return '<div id="sourcecode">'."\r\n".join("",@html)."\r\n</div>\r\n"; + } + + sub pagetemplate (@) { + my %params=@_; + + my $page=$params{page}; + my $template=$params{template}; + + if (exists $metaheaders{$page} && $template->query(name => "meta")) { + # avoid duplicate meta lines + my %seen; + $template->param(meta => join("\n", grep { (! $seen{$_}) && ($seen{$_}=1) } @{$metaheaders{$page}})); + } + } 1 diff --git a/doc/todo/avatar.mdwn b/doc/todo/avatar.mdwn new file mode 100644 index 000000000..b8aa2327f --- /dev/null +++ b/doc/todo/avatar.mdwn @@ -0,0 +1,47 @@ +[[!tag wishlist]] + +It would be nice if ikiwiki, particularly [[plugins/comments]] +supported user avatar icons. I was considering adding a directive for this, +as designed below. + +However, there is no *good* service for mapping openids to avatars -- +openavatar has many issues, including not supporting delegated openids, and +after trying it, I don't trust it to push users toward. +Perhaps instead ikiwiki could get the email address from the openid +provider, though I think the perl openid modules don't support the openid +2.x feature that allows that. + +At the moment, working on this doesn't feel like a good use of my time. +--[[Joey]] + +Hmm.. unless is just always used a single provider (gravatar) and hashed +the openid. Then wavatars could be used to get a unique avatar per openid +at least. --[[Joey]] + +---- + +The directive displays a small avatar image for a user. Pass it the +email address, openid, or wiki username of the user. + + \[[!avatar user@example.com]] + \[[!avatar http://joey.kitenet.net/]] + \[[!avatar user]] + +The avatars are provided by various sites. For email addresses, it uses a +[gravatar](http://gravatar.com/). For openid, +[openavatar](http://www.openvatar.com/) is used. For a wiki username, the +user's email address is looked up and the gravatar for that user is +displayed. (Of course, the user has to have filled in their email address +on their Preferences page for that to work.) + +An optional second parameter can be included, containing additional +options to pass in the +[gravatar url](http://en.gravatar.com/site/implement/url). +For example, this asks for a smaller gravatar, and if a user does +not have a gravatar, uses a cute auto-generated "wavatar" avatar. + + \[[!gravatar user@example.com "size=40&default=wavatar"]] + +The `gravitar_options` setting in the setup file can be used to +specify additional options to pass. So for example if you want +to use wavatars everywhere, set it to "default=wavatar". diff --git a/doc/todo/avoid_thrashing.mdwn b/doc/todo/avoid_thrashing.mdwn new file mode 100644 index 000000000..45b11d872 --- /dev/null +++ b/doc/todo/avoid_thrashing.mdwn @@ -0,0 +1,22 @@ +Problem: Suppose a server has 256 mb ram. Each ikiwiki process needs about +15 mb, before it's loaded the index. (And maybe 25 after, but only one such +process runs at any time). That allows for about 16 ikiwiki processes to +run concurrently on a server, before it starts to swap. Of course, anything +else that runs on the server and eats memory will affect this. + +One could just set `MaxClients 16` in the apache config, but then it's also +limited to 16 clients serving static pages, which is silly. Also, 16 is +optimistic -- 8 might be a saner choice. And then, what if something on the +server decides to eat a lot of memory? Ikiwiki can again overflow memory +and thrash. + +It occurred to me that the ikiwiki cgi wrapper could instead do locking of +its own (say of `.ikiwiki/cgilock`). The wrapper only needs a few kb to +run, and it starts *fast*. So hundreds could be running waiting for a lock +with no ill effects. Crank `MaxClients` up to 256? No problem.. + +And there's no real reason to allow more than one ikiwiki cgi to run at a +time. Since almost all uses of the CGI lock the index, only one can really +be doing anything at a time. --[[Joey]] + +[[done]] 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/clear_page_to_delete.mdwn b/doc/todo/clear_page_to_delete.mdwn new file mode 100644 index 000000000..6bab6ef27 --- /dev/null +++ b/doc/todo/clear_page_to_delete.mdwn @@ -0,0 +1,33 @@ +Would it make sense to automatically delete a page if it's edited and +cleared to be entirely empty (or only have whitespace)? Discuss. --[[Joey]] + + I'd say so; yes. A method of deleting pages via the web would be great; I +can't think of a use of keeping blank pages around. What about vandalism -- +if someone blanks a page and deletes it and someone else wishes to restore +it; or is undoing edits via the web a bigger issue? -- [[users/Jon]] + +Of course there's already a way to delete pages (remove plugin). So the +question is really: + +* Does it make sense to have a second way to do it, by clearing the page? +* Should it be enabled even if the full remove plugin isn't? + +Re vandalism in general, I am generally happy using git-revert to kill the +offending change. --[[Joey]] + +I don't think we need a second way to delete pages, which would probably be +used by the only few people who will learn it's possible by random +documentation reading, find it useful, *and* remember it. -- [[intrigeri]] + +On the other hand, clearing the page's whole content essentially means deleting +the page. That's what the user intended to do in this case. The information +content of an empty vs. a deleted page is essentially the same, I'd say. But +having ikiwiki remove those stale pages would save some (minimal, admittedly) +time needed for manual clean-up. --[[tschwinge]] + +On EmacsWiki, a page is marked for deletion when it contains just the DeletedPage +keyword and if there were no page editions since XX days. Here, I use pages that +can be empty everyday and filled all day long. It does not make sense to me to +delete these pages :). --[[xma]] + +I was not aware of [[plugins/remove]]. I don't think another method is necessary -- [[users/Jon]] 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/comments.mdwn b/doc/todo/comments.mdwn new file mode 100644 index 000000000..7a113bee3 --- /dev/null +++ b/doc/todo/comments.mdwn @@ -0,0 +1,170 @@ +# Known issues with the [[plugins/comments]] plugin + +## Unimplemented + +* Instead of just a link to add a comment, it could have a form to enter + the title, similar to the form for adding a new blog post. + + > I'm not sure this is so useful? On Livejournal titles are allowed on + > comments, but very rarely used (and indeed usually not very useful); + > it's hard enough to get some people to title their blog posts :-) + > --[[smcv]] + +## Won't fix + +* Because IkiWiki generates static HTML, we can't have a form inlined in + page.tmpl where the user fills in an entire comment and can submit it in + a single button-press, without being vulnerable to cross-site request forgery. + So I'll put this in as wontfix. --[[smcv]] + + > Surely there's a way around that? + > A web 2.0 way comes to mind: The user clicks on a link + > to open the comment post form. While the nasty web 2.0 javascript :) + > is manipulating the page to add the form to it, it looks at the cookie + > and uses that to insert a sid field. + > + > Or, it could have a mandatory preview page and do the CSRF check then. + > --[[Joey]] + +* It would be useful to have a pagespec that always matches all comments on + pages matching a glob. Something like `comment(blog/*)`. + Perhaps postcomment could also be folded into this? Then the pagespec + would match both existing comments, as well as new comments that are + being posted. + + > Please see [[plugins/comments/discussion]]. If I've convinced you that + > internal pages are the way forward, then sure, we can do that, because + > people who can comment still won't be able to edit others' comments + > (one of my goals is that commenters can't put words into each other's + > mouths :-) ) + > + > On the other hand, if you still want me to switch this plugin to "real" + > pages, or if internal pages might become editable in future, then + > configuring lockedit/anonok so a user X can add comments to blog pages + > would also let X edit/delete comments on blog pages (including those + > written by others) in arbitrary ways, which doesn't seem good. --[[smcv]] + + > I had a look at implementing comment() and fell afoul of + > some optimisations that assume only internal() will be used to match + > internal pages. So probably this isn't worth doing. --[[Joey]] + +## Done + +* There is some common code cargo-culted from other plugins (notably inline and editpage) which + should probably be shared + + > Actually, there's less of this now than there used to be - a lot of simple + > things that were shared have become unshareable as they became more + > complex. --[[smcv]] + + > There's still goto. You have a branch for that. --[[Joey]] + + >> Now merged --[[smcv]] + +* The default template should have a (?) icon next to unauthenticated users (with the IP address + as title) and an OpenID icon next to OpenIDs + + > Done in my comments git branch, at least as a mockup (using the (?), + > {x} and {*} smileys for anonymous, OpenID and login respectively). + > --[[smcv]] + + >> I've improved this to use independent icons from the wikiicons + >> directory (untested!) --[[smcv]] + + >>> The new code produces links like /wikiisons/openid.png, which + >>> fail if ikiwiki is not at the root of the web server. --[[Joey]] + + >>>> Sorry, I should have spotted that (the assumption failed on my demo + >>>> site, but the push to that site was when I was on the way out, so I + >>>> didn't have time to investigate). As a note for other ikiwiki hackers, + >>>> I should have used + >>>> `<img src="<TMPL_VAR NAME=BASEURL>wikiicons/openid.png" />`. --[[smcv]] + + >>> I got to wondering if the icons are needed. On my comments branch + >>> (not master), I've dropped the icons and info can be seen by hovering + >>> over the author's name. Idea being that you probably don't care how + >>> they authenticated unless something is weird, and in that case you + >>> can hover to check. Does that make sense, should I merge it? + >>> --[[Joey]] + + >>>> Yeah, go ahead. I preferred my layout with the author before the + >>>> comment - perhaps that's Livejournal's influence :-) - but I can always + >>>> edit the templates for my own site. As long as the default is something + >>>> reasonable and both layouts are possible, I don't really mind. + >>>> Minimizing the number of "resource" files in the basewiki also seems + >>>> a good goal. --[[smcv]] + +* Previews always say "unknown IP address" + + > Fixed in my comments branch by commits bc66a00b and 95b3bbbf --[[smcv]] + +* The Comments link in the "toolbar" is to `index.html#comments`, not the + desired `./#comments` + + > Fixed in my comments branch by commit 0844bd0b; commits 5b1cf21a + > and c42f174e fix another `beautify_urlpath` bug and add a regression test + > --[[smcv]] + + +* Now that inline has some comments-specific functionality anyway, it would + be good to output `<link rel="comments">` in Atom and the equivalent in RSS. + + > Fixed in my comments branch by d0d598e4, 3feebe31, 9e5f504e --[[smcv]] + + +* Add `COMMENTOPENID`: the authenticated/verified user name, if and only if it was an OpenID + + > Done in my comments git branch --[[smcv]] + + > Not seeing it there, which branch? --[[Joey]] + + >> Bah, git push --all is not the default... 'comments' branch now (I've also rebased it). + >> Sorry, I'm on mobile Internet at the moment... --[[smcv]] + + >>> merged by [[Joey]] in commit 0f03af38 --[[smcv]] + +* Should the comments be visually set off more from the page above? + Rather than just a horizontal rule, I'm thinking put the comments + in a box like is used for inlined pages. + + > I did put them in a box in the CSS... I agree the default template + > could do with visual improvement though. --[[smcv]] + + >> I'll consider this solved by [[Joey]]'s changes. --[[smcv]] + +* One can use inline to set up a feed of all comments posted to any page. + Using template=comment they are displayed right. Only problem + is there is no indication in that template of what page each comment in the + feed is a comment on. So, if a comment is inlined into a different page, + I think it should show a link back to the page commented on. + (BTW, the rss feed in this situation seems ok; there the link element + points back to the parent page. + + > done --[[Joey]] + +* One of Joey's commit messages says "Not ideal, it would be nicer to jump to + the actual comment posted, but no anchor is available". In fact there is + an anchor - the `\[[_comment]]` preprocessing wraps the comment in a `<div>` + with id="comment_123" or something. I'll fix this, unless Joey gets there + first. --[[smcv]] + + > done --[[Joey]] + +* If a spammer posts a comment, it is either impossible or hard to clean + up via the web. Would be nice to have some kind of link on the comment + that allows trusted users to remove it (using the remove plugin of + course). + + > Won't the remove plugin refuse to remove internal pages? This would be + > a good feature to have, though. --[[smcv]] + + > Here, FWIW, is the first ikiwiki comment spam I've seen: + > <http://waldeneffect.org/blog/Snake_bite_information/#blog/Snake_bite_information/comment_1> + > So that took about 10 days... + > --[[Joey]] + + >> Implemented in my 'comments' branch, please review. It turns out + >> [[plugins/remove]] is happy to remove internal pages, so it was quite + >> easy to do. --[[smcv]] + + >>> done --[[Joey]] diff --git a/doc/todo/configurable_timezones.mdwn b/doc/todo/configurable_timezones.mdwn index 3ed50503a..f8b1dbbab 100644 --- a/doc/todo/configurable_timezones.mdwn +++ b/doc/todo/configurable_timezones.mdwn @@ -3,3 +3,8 @@ It would be nice if the sure could set the timezone of the wiki, and have ikiwik This is nice for shared hosting, and other situation where the user doesn't have control over the server timezone. > [[done]] via the ENV setting in the setup file. --[[Joey]] + + +Example (ikiwiki.setup): + + ENV => { TZ => "Europe/Sofia" } diff --git a/doc/todo/darcs.mdwn b/doc/todo/darcs.mdwn index b8ddfd485..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 @@ -546,4 +546,6 @@ Regarding the repository layout: There are two darcs repositories. One is the `s >> `rcs_commit_staged`. For some revision control systems, which >> automatically commit modifications, it would be a no-op. --[[Joey]] +>>> Done. --pesco + [[!tag patch]] 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 => \&getopt); - hook(type => "checkconfig", id => "hyperestraier", @@ -142,14 +142,14 @@ Index: IkiWiki/Plugin/search.pm call => \&change); - hook(type => "cgi", id => "hyperestraier", - call => \&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/discussion_page_as_blog.mdwn b/doc/todo/discussion_page_as_blog.mdwn index c7a3d6ac9..990b7ddb3 100644 --- a/doc/todo/discussion_page_as_blog.mdwn +++ b/doc/todo/discussion_page_as_blog.mdwn @@ -30,4 +30,4 @@ I don't think that the nesting is very clear, I found it confusing.. Would each page be its own individual blog? Or its own blog post? To me it seems like an entire wiki can be viewed as a blog, with threaded or unthreaded comments underneath. -[[!tag soc]] +[[!tag soc done]] diff --git a/doc/todo/dynamic_rootpage.mdwn b/doc/todo/dynamic_rootpage.mdwn index fa0e23254..5cf80b0a8 100644 --- a/doc/todo/dynamic_rootpage.mdwn +++ b/doc/todo/dynamic_rootpage.mdwn @@ -23,3 +23,10 @@ What's your opinion, Joey? I hope it's also useful for another ikiwiki lovers :) >>> Seems like a job for good ol' string interpolation. rootpage="post/$current_year/$current_month/$current_day" >>> Ikiwiki could provide some vars, and it would be nice to write plugins to also provide vars. Sort of like templates. >>> Does that feel OK? --[[sabr]] + +> I want the exact same thing. My compromise was to create a `datedblog` module which overrides `inline`'s `sessioncgi` hook +> with something that sets the new page name to `%Y-%m-%d.$page` and sets up a meta directive at the beginning of +> the content, with the title you wanted. Now if you use the `datedblog` module, you get dated blog entries. But I'd +> like to have traditional `inline` functionality too. This would work great if there were a way to change the `do` +> parameter in the `blogpost` template's form; if I could change it to `datedblog` instead of `blog` then I could hook +> my datedblog module in nicely, without having to override anything. What would be the right way to do that? --[[neale]] 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/firm_up_plugin_interface.mdwn b/doc/todo/firm_up_plugin_interface.mdwn index b0e92e65c..c7553f7dd 100644 --- a/doc/todo/firm_up_plugin_interface.mdwn +++ b/doc/todo/firm_up_plugin_interface.mdwn @@ -41,7 +41,7 @@ Another problimatic thing is plugins often define functions named 'preprocess', 6 IkiWiki::titlepage These go together; linkpage is needed by all link plugins, and the others are used widely. -All should be exported. +All should be exported. (Done) 7 IkiWiki::saveindex 5 IkiWiki::loadindex @@ -92,3 +92,5 @@ Probably needs to evolve more and be more widely used before being exported. * %IkiWiki::pagecase (aggregate) * %IkiWiki::backlinks (pagestats) + +[[done]] (until 4.0).. 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/generic___39__do__61__goto__39___for_CGI.mdwn b/doc/todo/generic___39__do__61__goto__39___for_CGI.mdwn new file mode 100644 index 000000000..26c5202d0 --- /dev/null +++ b/doc/todo/generic___39__do__61__goto__39___for_CGI.mdwn @@ -0,0 +1,35 @@ +The [[plugins/recentchanges]] plugin has a `do=recentchanges_link` feature that will +redirect to a given wiki page, or an error page with a creation link. + +In the [[plugins/contrib/comments]] plugin I've found that it would be useful to do +the same for users. For now I've just cloned the functionality into the comments +plugin, but perhaps this functionality could be renamed to `do=goto` or +something, and moved to `IkiWiki/CGI.pm`? + +> Now implemented as the 'goto' branch in my git repository, along with +> [[apache_404_ErrorDocument_handler]]. --[[smcv]] + +>> Looks good, the only things I wonder are: +>> * Should it be a separate plugin? In particular `cgi_page_from_404()` is +>> pretty big, and only works if apache is configured so seems somewhat +>> pluginaable. + +>>> I've split out `goto` and `apache404` plugins in the branch. I think +>>> you're right that apache404 should be a plugin. If you think goto is small +>>> and general enough to not be a plugin, just don't merge my most recent +>>> patch! --[[smcv]] + +>> * I wish there were some way to generalize the workaround for the stupid +>> MSIE behavior. Actually, I wish we could ignore the MSIE stupidity, +>> as I tend to do, but perhaps it's too stupid in this case for that to +>> fly.. +>> * Is there any reason to require do=goto before checking for +>> `REDIRECT_STATUS`? Seems that if that code were moved +>> out of the enclosing if block, the apache 404 handler could +>> be set direct to the cgi, which seems simpler to remember. +>> --[[Joey]] + +>>> No, good point - the `REDIRECT_STATUS` check is sufficiently unambiguous +>>> already. Fixed. --[[smcv]] + +[[done]] diff --git a/doc/todo/httpauth_feature_parity_with_passwordauth.mdwn b/doc/todo/httpauth_feature_parity_with_passwordauth.mdwn new file mode 100644 index 000000000..eb71cf840 --- /dev/null +++ b/doc/todo/httpauth_feature_parity_with_passwordauth.mdwn @@ -0,0 +1,28 @@ +The only way to have a private ikiwiki, with a shared user database +for static pages and CGI authentication, is to use +[[plugins/httpauth]]. It would be good for httpauth to be on par with +[[plugins/passwordauth]], i.e. to allow registering users, resetting +passwords, and changing passwords; supporting some kind of +`account_creation_password` configuration option would be nice, too. + +I'll probably propose patches implementing this at some point. +I've not had a single look at the code yet, but it may be nice to factorize +the relevant passwordauth code, instead of rewriting it completely in httpauth. + +-- [[intrigeri]] + +Well, on such a private wiki, one can neither register herself nor +reset his password: the registration page, as any other page, would be +forbidden to non-authenticated users. Admin users should then be +enabled to: + +- register a new user +- reset someone else's password + +In both cases, a brand new random password is sent by e-mail to the +new user. + +An authenticated user should nevertheless be able to change his +own password. -- [[intrigeri]] + +[[wishlist]] 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..3d7424b3f 100644 --- a/doc/todo/inline:_numerical_ordering_by_title.mdwn +++ b/doc/todo/inline:_numerical_ordering_by_title.mdwn @@ -1,6 +1,8 @@ Could you please add numerical ordering by title to [[inline|plugins/inline]] plugin? Now I can do only alphabetical order by title, but sometime it's not enough. +> Implemented, see [[natural_sorting]] [[!tag done]] --[[Joey]] + BTW, it seems that ordering by title is rather ordering by filename of page. For me "title" means title of page I can set using `title` parameter of [[meta|plugins/meta]] plugin :) @@ -155,11 +157,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 +195,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 +230,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/inline_plugin:_ability_to_override_feed_name.mdwn b/doc/todo/inline_plugin:_ability_to_override_feed_name.mdwn new file mode 100644 index 000000000..df5bf9194 --- /dev/null +++ b/doc/todo/inline_plugin:_ability_to_override_feed_name.mdwn @@ -0,0 +1,29 @@ +If RSS and Atom are enabled by default, the [[plugins/contrib/comments]] +plugin generates a feed, perhaps `/sandbox/index.atom` for comments on the +sandbox. If a blog is added to the page, the blog will steal the name +`/sandbox/index.atom` and the comments plugin's feed will change to +`/sandbox/index.atom2`. + +If `\[[!inline]]` gained a parameter `feedname` or something, the comments +plugin could use `feedname=comments` to produce `/sandbox/comments.atom` +instead (this would just require minor enhancements to rsspage(), +atompage() and targetpage()). + +As a side benefit, [my blog](http://smcv.pseudorandom.co.uk/) could go back +to its historical Atom feed URL of `.../feed.atom` (which is currently a +symlink to `index.atom` :-) ) + +On sites not using `usedirs` the current feed is `/sandbox.atom`, and we +could perhaps change it to `/sandbox-comments.atom` or +`/sandbox/comments.atom` if `feedname=comments` is given. + +--[[smcv]] + +> This is slightly hard to do, because you have to worry about +> conflicting pages setting feedname, which could cause ikiwiki to blow up. +> +> Particularly for the non-usedirs case, where a page `sandbox/comments` +> would produce the same feed as sandbox with `feedname=comments`. +> --[[Joey]] + +> [[done]] as feedfile option --[[Joey]] diff --git a/doc/todo/inline_plugin:_hide_feed_buttons_if_empty.mdwn b/doc/todo/inline_plugin:_hide_feed_buttons_if_empty.mdwn new file mode 100644 index 000000000..d046c0cd0 --- /dev/null +++ b/doc/todo/inline_plugin:_hide_feed_buttons_if_empty.mdwn @@ -0,0 +1,7 @@ + < joeyh> 03:49:19> also, I think it may be less visually confusing to + drop the rss/atom buttons for comments when there are none yet + +This seems to me like something that applies to the [[plugins/inline]] plugin in general, rather than the [[plugins/contrib/comments]] plugin specifically. --[[smcv]] + +>> [[done]] as emptyfeeds option, not on by default for inline, but I think +>> it should be for comments --[[Joey]] diff --git a/doc/todo/inline_postform_autotitles.mdwn b/doc/todo/inline_postform_autotitles.mdwn new file mode 100644 index 000000000..5005208be --- /dev/null +++ b/doc/todo/inline_postform_autotitles.mdwn @@ -0,0 +1,52 @@ +[[!tag wishlist]] +[[!tag patch]] + +for postforms in inlines of pages which follow a certain scheme, it might not +be required to set the title for each individual post, but to automatically set +the title and show no input box prompting for it. +this can either be based on timestamp formatting, or use the already existing +munging mechanism, which appends numbers to page titles in case that page +already exists. + +two patches ([1], [2]) set inline up for that, adding an additional `autotitle` +parameter. if that is given, the regular input of the inline postform will be +replaced with a hidden input of that text. in addition, the empty title is +permitted (both for autotitle and regular titles, as they go in the same GET +parameter, `title`). as the empty page title is illegal, munging is used, +resulting in ascending numeric page titles to be created. + +the second patch is actually a one-liner, filtering the title through strftime. + +### potential user interaction issues + +this has two side effects which have to be considered: first, the empty page +title is accepted also in normal postforms (previously, this resulted in a "bad +page name" error); second, entering a percent sign in that field might result +in unexpexted strftime substitution (strftime might not even substitute for +common uses of percent as in "reach 10% market share", but might in others as +in "the 10%-rule"). + +both can be circumvented by using another GET parameter for autotexts, as +implemented in [3]. +> this patch still does not work perfectly; especially, it should make a +> distinction between "autotitle is set but equal ''" (in which case it +> should create a page named `1.mdwn`, and "autotitle is not set, and title is +> equal ''" (in which case it should display the old error message) --[[chrysn]] + +### potential security issues + +* the autotitle's value is directly output through the template (but that's + done in other places as well, so i assume it's safe) +* i don't know if anything bad can happen if unfiltered content is passed to + POSIX::strftime. + +### further extension + +having a pre-filled input field instead of an unchangable hidden input might be +cool (eg for creating an entry with yesterday's date), but would be a bit of a +problem with static pages. javascript could help with the date part, but name +munging would be yet another thing. + +[1]: http://github.com/github076986099/ikiwiki/commit/b568eb257a3ef5ff49a84ac00a3a7465b643c1e1 +[2]: http://github.com/github076986099/ikiwiki/commit/34bc82f232be141edf036d35e8ef5aa289415072 +[3]: http://github.com/github076986099/ikiwiki/commit/40dc10a4ec7809e401b4497c2abccfba30f7a2af 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/latex.mdwn b/doc/todo/latex.mdwn index eb53538b4..604c5e87f 100644 --- a/doc/todo/latex.mdwn +++ b/doc/todo/latex.mdwn @@ -31,6 +31,9 @@ Conversely, how about adding a plugin to support exporting to LaTeX? a latex plugin. Examples [here](http://ng.l4x.org/latex/). Currently without image support for hevea. And the latex2html output has the wrong charset and no command line switch to change that. Dreamland. +As this link is not working, I setted a mirror here: <a href="http://satangoss.sarava.org/ikiwiki/latex.pm">http://satangoss.sarava.org/ikiwiki/latex.pm</a>. + + ---- Okay, now is the time for a mid term report i think. diff --git a/doc/todo/location_of_external_plugins.mdwn b/doc/todo/location_of_external_plugins.mdwn new file mode 100644 index 000000000..c28003e74 --- /dev/null +++ b/doc/todo/location_of_external_plugins.mdwn @@ -0,0 +1,24 @@ +Would it be possible to make the installation location for the external +plugins (those talked to via xmlrpc) configurable? Currently, they are +installed into (and later expected to be in) /usr/lib/ikiwiki/plugins. For +the Fedora package (which I maintain), I move them to +/usr/libexec/ikiwiki/plugins. While not covered by the FHS, this seems to +be a more appropriate place, see: +https://fedoraproject.org/wiki/Packaging/Guidelines#Libexecdir. + +> This would need to be a build time configuration setting so the directory +> is built into ikiwiki for use at runtime. --[[Joey]] + +As a side note, the accompanying proxy.py might better be placed into some directory on the python path. + +> If someone can show how to do so without needing a Setup.py and all the +> pain that using one entails.. --[[Joey]] + +>> At the very least I don't think proxy.py should be on the `sys.path` +>> under its current name. If it was renamed to ikiwiki_proxy or some such, +>> possibly; but I think it's more appropriate to have it in an +>> ikiwiki-specific directory (a "private module") since it's not useful for +>> anything outside ikiwiki, and putting it in the same directory as the +>> external plugins means it's automatically in their `sys.path` without +>> needing special configuration. --[[smcv]] +>> (a mostly-inactive member of Debian's Python modules packaging team) diff --git a/doc/todo/location_of_ikiwiki-w3m.cgi.mdwn b/doc/todo/location_of_ikiwiki-w3m.cgi.mdwn new file mode 100644 index 000000000..8ca925bee --- /dev/null +++ b/doc/todo/location_of_ikiwiki-w3m.cgi.mdwn @@ -0,0 +1,3 @@ +The `ikiwiki-w3m.cgi` script is installed (hard-coded) into `/usr/lib/w3m/cgi-bin`. On Fedora however, the w3m package expects it in `/usr/libexec/w3m/cgi-bin`. So, it would be nice if the destination for this script could be configured. + +> You can use `W3M_CGI_BIN now`. [[done]] --[[Joey]] diff --git a/doc/todo/mbox.mdwn b/doc/todo/mbox.mdwn index 081d51200..f7744563c 100644 --- a/doc/todo/mbox.mdwn +++ b/doc/todo/mbox.mdwn @@ -14,3 +14,6 @@ I'd like to be able to drop an unmodified RFC2822 email message into ikiwiki, an >>> to page foo). I'm not sure if this is possible and worthwhile to fix. >> It is certainly workable >>> to use a \[[!mailbox ]] directive. -- [[DavidBremner]] + +> Your gitweb doesn't tell me where I can git pull this from, which I'd +> like to do ... --[[Joey]] diff --git a/doc/todo/mdwn_preview.mdwn b/doc/todo/mdwn_preview.mdwn new file mode 100644 index 000000000..c20314c28 --- /dev/null +++ b/doc/todo/mdwn_preview.mdwn @@ -0,0 +1,305 @@ +The [StackOverflow](http://stackoverflow.com/) site uses markdown for markup. +It has a fancy javascript thing for showing a real-time preview of what the user +is editing. It would be nice if ikiwiki could support this, too. The thing they +use on StackOverflow is supposed to be free software, so it should be easy to +add to ikiwiki. + +> See [[wikiwyg]]. Note that I do not have a copy of the code for that, or +> it'd be in ikiwiki already. --[[Joey]] + +>> I just had a brief look at the [[wikiwyg]] page and the link to the plugin was +>> broken. The StackOverflow site uses the [WMD](http://wmd-editor.com/) editor, +>> which seems to be related to the [ShowDown](http://attacklab.net/showdown/) +>> javascript port of Markdown. Interestingly, [WMD source](http://wmd.googlecode.com/) +>> is now available under an MIT license, though it is supposedly undergoing heavy +>> refactoring. It looks like there was previous discussion ( [[todo/Add_showdown_GUI_input__47__edit]] ) +>> about a showdown plugin. Maybe a WMD plugin would be worthwhile. I might +>> look into it if I have time on the weekend. -- [[Will]] + +[[!tag wishlist]] + +>>> Below is a simple plugin/[[patch]] to make use of the WMD editor. + +>>>> Now added to ikiwiki, thanks! --[[Joey]] + +>>> Turns out it isn't hard at all to +>>> get a basic version going (which doesn't handle directives at all, nor does it swtich itself off when you're +>>> editing something other than Markdown source). I've +>>> removed the done tag so this is visible as a patch. -- [[Will]] + +>>>> Hmm, it would be good if it turned off for !mdwn. Although this could +>>>> be difficult for a new page, since there is a dropdown selector to +>>>> choose the markup language then. But it should be doable for editing an +>>>> existing page. + +>>>>> I agree. I'm working on this for for both new pages and existing pages. +>>>>> It shouldn't be hard once I get WMD going through the javascript API. +>>>>> At the moment that is inexplicably failing, and I haven't had time to have a good look at why. +>>>>> I may not get a chance to look at this again for a few weeks. + +>>>> Can I get a license statement (ie, GPL-2+) ffrom you for the plugin? +>>>> --[[Joey]] + +>>>>> Certainly. You're free to use the code I posted below under the GPL-2+ license. You'll note +>>>>> however that I haven't said anything about the WMD code itself. The WMD web page says: + +>>>>>> "I'm refactoring the code, and will be releasing WMD under the MIT license soon. For now you can download the most recent release (wmd-1.0.1.zip) and use it freely." + +>>>>> It might be best to contact <support@attacklab.net> to for an explicit license on that if you want to include it. +>>>>> -- [[Will]] + +> So, I wonder if I should add a copy of the WMD source to ikiwiki, or rely +> on the user or distribution providing it. It does not seem to be packaged +> for Debian yet. Hmm, I also can't find any copyright or license info in +> the zip file. --[[Joey]] + +>> This is a good question. My thought is that it will probably not be packaged any time soon, +>> so you're better off adding it to IkiWiki. I'd contact the author of WMD and ask them. They +>> may have more insight. -- [[Will]] + +Note that the WMD plugin does **not** handle directives. For this reason the normal `preview` button +remains. Some CSS to clean up the display of the live WMD preview would be good. + +> Can you elucidate the CSS comment -- or will it be obvious what you mean +> when I try it? Is it what's needed for the live preview? --[[Joey]] + +>> In the version of the plugin below, a new `div` is added just below the form. WMD +>> populates this div with the HTML it generates from the Markdown source. This is not very +>> pretty at the moment - it appears in the same place as the preview used to, but with no +>> header or anything. Any standard IkiWiki preview will appear below the WMD live preview. +>> I recommend having a look at <http://wmd-editor.com/examples/splitscreen> +>> for what a little CSS could achieve. -- [[Will]] + +> Hmm, now that I've tried it, I notice that it does live preview by +> default, below the edit window. Which is nice, but then if I hit the +> preview button, I get two previews.. which is confusing. (Also, minor, +> but: the live preview is missing the "Page Preview:" header.) --[[Joey]] + +> I wonder how annoying it would be to add some kind of simplistic wikilink +> support to wmd's preview? And/or a wikilink button? While not supporting +> directies is fine, not supporting wikilinks in a wiki seems a bit +> lacking. It may also entice novide users to not use wikilinks and instead +> use the hyperlinks that wmd does support. --[[Joey]] + +> Bug: When I preview, all the text in the edit field seems to be +> converted from mdwn to html. I think that wmd is converting the mdwn +> into html when the form is posted, so it would also save like that. +> I assume that is designed for websites that do not use markdown +> internally. Doesn't it have a setting to leave it as markdown? +>> Found setting, fixed. --[[Joey]] + +>>> As I noted above, I've been working on the non-markdown page issue. +>>> Below is my a new javascript file that I'm using, and below that a patch +>>> to enable it. This patch makes the normal usage prettier - you get +>>> a side panel with the live preview in it. It also adds a new config +>>> option, `wmd_use101api`, which turns on code that tries to use the +>>> wmd api. At the moment this code doesn't seem to work - moreover the +>>> code that uses the new API dies early, so any code after that point is +>>> completely untested. I will not +>>> get a chance to look at this again soon though, so I thought I'd post +>>> my progress so far. -- [[Will]] + + +Place the following file in `underlays/wmd/wmd-ikiwiki.js`. + +---- + + // This is some code to interface the WMD interface 1.0.1 with IkiWiki + // The WMD interface is planned to change, so this file will likely need + // updating in future. + + if (useWMDinterface) { + wmd_options = { autostart: false, output: "Markdown" }; + var instance = null; + + hook("onload", initwmd); + } else { + var typeSelector = document.getElementById("type"); + + var currentType = getType(typeSelector); + + if (currentType == "mdwn") { + wmd_options = { output: "Markdown" }; + document.getElementById("wmd-preview-container").style.display = 'none'; + } else { + wmd_options = { autostart: false }; + document.getElementById("wmd-preview-container").style.display = 'block'; + } + } + + function initwmd() { + if (!Attacklab || !Attacklab.wmd) { + alert("WMD hasn't finished loading!"); + return; + } + + var typeSelector = document.getElementById("type"); + + var currentType = getType(typeSelector); + + if (currentType == "mdwn") { + window.setTimeout(enableWMD,10); + } + + typeSelector.onchange=function() { + var docType=getType(this); + + if (docType=="mdwn") { + enableWMD(); + } else { + disableWMD(); + } + } + } + + function getType(typeSelector) + { + if (typeSelector.nodeName.toLowerCase() == 'input') { + return typeSelector.getAttribute('value'); + } else if (typeSelector.nodeName.toLowerCase() == 'select') { + return typeSelector.value; + // return typeSelector.options[typeSelector.selectedIndex].innerText; + } + return ""; + } + + function enableWMD() + { + var editContent = document.getElementById("editcontent"); + var previewDiv = document.getElementById("wmd-preview"); + var previewDivContainer = document.getElementById("wmd-preview-container"); + + previewDivContainer.style.display = 'block'; + // editContent.style.width = previewDivContainer.style.width; + + /***** build the preview manager *****/ + var panes = {input:editContent, preview:previewDiv, output:null}; + var previewManager = new Attacklab.wmd.previewManager(panes); + + /***** build the editor and tell it to refresh the preview after commands *****/ + var editor = new Attacklab.wmd.editor(editContent,previewManager.refresh); + + // save everything so we can destroy it all later + instance = {ta:editContent, div:previewDiv, ed:editor, pm:previewManager}; + } + + function disableWMD() + { + document.getElementById("wmd-preview-container").style.display = 'none'; + + if (instance != null) { + instance.pm.destroy(); + instance.ed.destroy(); + // inst.ta.style.width='100%' + } + instance = null; + } + + +---- + + diff --git a/IkiWiki/Plugin/wmd.pm b/IkiWiki/Plugin/wmd.pm + index 9ddd237..743a0b8 100644 + --- a/IkiWiki/Plugin/wmd.pm + +++ b/IkiWiki/Plugin/wmd.pm + @@ -17,6 +17,13 @@ sub getsetup () { + return + plugin => { + safe => 1, + + rebuild => 1, + + }, + + wmd_use101api => { + + type => "boolean", + + description => "Use the advanced, but unstable, WMD api for markdown preview.", + + safe => 0, + + rebuild => 0, + }, + } + + @@ -24,29 +31,25 @@ sub formbuilder_setup (@) { + my %params=@_; + my $form=$params{form}; + + - return if ! defined $form->field("do"); + + return unless defined $form->field("do"); + + return unless $form->field("do") eq "edit" || + - $form->field("do") eq "create" || + - $form->field("do") eq "comment"; + - + - $form->tmpl_param("wmd_preview", "<div class=\"wmd-preview\"></div>\n". + - include_javascript(undef, 1)); + -} + - + -sub include_javascript ($;$) { + - my $page=shift; + - my $absolute=shift; + - + - my $wmdjs=urlto("wmd/wmd.js", $page, $absolute); + - return <<"EOF" + -<script type="text/javascript"> + -wmd_options = { + - output: "Markdown" + -}; + -</script> + -<script src="$wmdjs" type="text/javascript"></script> + -EOF + + $form->field("do") eq "create" || + + $form->field("do") eq "comment"; + + + + my $useAPI = $config{wmd_use101api}?'true':'false'; + + my $ikiwikijs = urlto("ikiwiki.js", undef, 1); + + my $wmdIkiwikijs = urlto("wmd-ikiwiki.js", undef, 1); + + my $wmdjs = urlto("wmd.js", undef, 1); + + + + my $previewScripts = <<"EOS"; + + <script type="text/javascript">useWMDinterface=$useAPI;</script> + + <script src="$ikiwikijs" type="text/javascript"></script> + + <script src="$wmdIkiwikijs" type="text/javascript"></script> + + <script src="$wmdjs" type="text/javascript"></script> + +EOS + + + + $form->tmpl_param("wmd_preview", $previewScripts); + } + + 1 + diff --git a/doc/style.css b/doc/style.css + index a6e6734..36c2b13 + --- a/doc/style.css + +++ b/doc/style.css + @@ -76,9 +76,16 @@ div.tags { + float: right; + } + + +/* + #editcontent { + width: 100%; + } + +*/ + + + +#wmd-preview-container { + + width: 49%; + + float: right; + +} + + img { + border-style: none; + diff --git a/templates/editpage.tmpl b/templates/editpage.tmpl + index b1cf015..1d2f080 100644 + --- a/templates/editpage.tmpl + +++ b/templates/editpage.tmpl + @@ -15,6 +15,14 @@ Page type: <TMPL_VAR FIELD-TYPE> + <TMPL_VAR FIELD-PAGE> + <TMPL_VAR FIELD-TYPE> + </TMPL_IF> + +<TMPL_IF NAME="WMD_PREVIEW"> + +<div id="wmd-preview-container"> + +<div class="header"> + +<span>Live preview:</span> + +</div> + +<div class="wmd-preview" id="wmd-preview"></div> + +</div> + +</TMPL_IF> + <TMPL_VAR FIELD-EDITCONTENT><br /> + <TMPL_IF NAME="CAN_COMMIT"> + Optional comment about this change:<br /> diff --git a/doc/todo/mercurial.mdwn b/doc/todo/mercurial.mdwn index f0dbf9806..e71c8106a 100644 --- a/doc/todo/mercurial.mdwn +++ b/doc/todo/mercurial.mdwn @@ -14,6 +14,10 @@ It seems that with the current mercurial commit code, it will always blindly overwrite the current file with the web edited version, losing any other changes. +* `rcs_commit_staged`, `rcs_rename`, `rcs_remove`, and `rcs_diff` are not + implemented for mercurial, and so attachments, remove and rename plugins + and recentchangesdiff cannot be used with it. (These should be fairly + easy to add..) Posthook: in `$srcdir/.hg/hgrc`, I have the following @@ -29,6 +33,62 @@ This should update the working directory and run ikiwiki every time a change is > It can deadlock if the post-commit hook runs with --refresh in the > former case. --[[Joey]] +The problem with --post-commit is that if you delete some pages in $SRC, ikiwiki --setup setupfile --post-commit will not delete them in $DEST. --[[users/weakish]] + +> You should really be using a setup file that has `mercurial_wrapper` +> set, and running the wrapper generated by that from your hook. +> That will work. I think that the `--setup --post-commit` on the command +> line is currently broken and does the same expensive rebuild process as --setup +> alone (which doesn't delete files from $DEST either). Will fix that. +> (fixed) +> --[[Joey]] + +>> Mercurial doesn't support put hooks in .hg/hooks/* (like git). In Mercurial, the only way to run +>> your own hooks is specifying them in the hgrc file. (Or write a new extension.) +>> I guess use a very long command will work. +>> (e.g. ikiwiki --post-commit --a-lot-of-switches --set var=value $SRC $DEST) +>> (Fortunately ikiwiki supports --set var=value so without --setup works.) +>> +>> Alternative is always editing via cgi or pushing. Never work on the $SRC/repo directly. +>> --[[users/weakish]] + +>>> I don't see anything preventing you from using a setup file with +>>> `mercurial_wrapper => ".hg/ikiwiki-hook",` and then modifying the hgrc +>>> to run that wrapper. --[[Joey]] + +>> Thanks for pointing out this. I have some stupid misunderstanding on the +>> usage of mercurial_wrapper before. The wrapper works nicely! --[[weakish]] + +I add the following to .hg/hgrc:(I use changegroup since I don't think we need refresh per changeset, please point out if I am wrong.) + + [hooks] + changegroup = hg update >&2 && ikiwiki --setup path.to.setup.file --refresh + post-commit = path.to.the.mercurial.wrapper + +----- + +I have no idea when the deadlock will happen. --[[users/weakish]] + +> For the deadlock to occur, a edit has to be made via the web. +> +> Ikiwiki, +> running as a CGI, takes a lock on the wiki, and commits the edit, +> continuing to run in the background, with the lock still held. +> When the edit is committed, the hg hook runs, running `ikwiki --refresh`. +> Nearly the first thing that process does it try to lock the wiki.. +> which is already locked. This lock is taken in a blocking manner, +> thus the deadlock -- the cgi is waiting for the commit to finish before +> dropping the lock, and the commit is blocked waiting for the lock to be +> released. +> +> --post-commit avoids this problem by checking if the cgi is running +> and avoiding doing anything in that case. (While still handing the +> refresh if the commit was not made by the CGI.) +> So in that case, the commit finishes w/o ikiwiki doing anything, +> and the ikiwiki CGI handles the wiki refresh. +> --[[Joey]] + + *** I have a few notes on mercurial usage after trying it out for a while: 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..a13c8b62f 100644 --- a/doc/todo/modify_page_filename_in_plugin.mdwn +++ b/doc/todo/modify_page_filename_in_plugin.mdwn @@ -6,11 +6,13 @@ The problem is that I occasionally have xxx.c and xxx.h in the same directory an My solution is to allow plugins to provide a hook that sets the pagename. --[[/users/bstpierre]] +> You might also find the solution to [[bugs/multiple_pages_with_same_name]] helps you. That patch is already applied. -- [[Will]] + --- /usr/share/perl5/IkiWiki.pm.ORIG 2008-10-03 14:12:50.000000000 -0400 +++ /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 +29,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/natural_sorting.mdwn b/doc/todo/natural_sorting.mdwn new file mode 100644 index 000000000..5df17e95b --- /dev/null +++ b/doc/todo/natural_sorting.mdwn @@ -0,0 +1,21 @@ +[[!tag wishlist]] +[[!tag patch]] + +the inline plugin's sorting is plain lexical, thich may not be appropriate for +page titles if they have numeric components. the +[Sort::Naturally](http://search.cpan.org/dist/Sort-Naturally/) perl module +provides an algorithm for that. + +there is a +[patch](http://git.ikiwiki.info/?p=ikiwiki;a=commit;h=55b83cb7bd1cd7c60bb45dc22c3745dd80a63fed) +attached that makes the [[plugins/inline]] plugin use Sort::Naturally if sort +is set to "title_natural". + +the current patch uses `require Sort::Naturally`, so +[libsort-naturally-perl](http://packages.debian.org/libsort-naturally-perl) +does not become a dependency; it might be worth suggesting, though. + +> See also: [[inline:_numerical_ordering_by_title]] (I probably prefer your +> approach..) --[[Joey]] + +> [[applied|done]] diff --git a/doc/todo/need_global_renamepage_hook.mdwn b/doc/todo/need_global_renamepage_hook.mdwn new file mode 100644 index 000000000..b123340af --- /dev/null +++ b/doc/todo/need_global_renamepage_hook.mdwn @@ -0,0 +1,115 @@ +As documented in [[plugins/write]], the current `renamepage` hook is +heavily oriented towards updating links in pages' content: it is run +once per page linking to the renamed page. + +That's fine, but it can't be used to trigger more general actions on +page rename. E.g. it won't be run at all if the page being renamed is +an orphan one. + +This is a real issue for the [[plugins/contrib/po]] development: what +I'm about to achieve is: + +- when a master page is renamed, the plugin takes notice of it (using + the `rename` hook), and later renames the translation pages + accordingly (in the `change` hook) +- when a master page is deleted, the plugin deletes its translations + (using the `delete` hook) + +With the current `renamepage` hook behavior, combining these two goals +has an annoying drawback: a plugin can't notice an orphan master page +has been renamed, so instead of renaming (and preserving) its +translations, it considers the oldpage as deleted, and deletes its +translations. Game over. + +It may seem like a corner case, but I want to be very careful when +deleting files automatically in `srcdir`, which is not always under +version control. + +As a sad workaround, I can still disable any deletion in `srcdir` +when it is not under version control. But I think ikiwiki deserves +a global `renamepage` hook that would be run once per rename +operation. + +My proposal is thus: + +- keep the documented `renamepage` hook as it is +- use something inspired by the trick `preprocess` uses: when `hook` + is passed an optional "global" parameter, set to a true value, the + declared `renamepage` hook is run once per rename operation, and is + passed named parameters: `src`, `srcfile`, `dest` and `destfile`. + +I'm of course volunteering to implement this, or anything related that +would solve my problem. Hmmm? --[[intrigeri]] + +> I think it would be better to have a different hook that is called for +> renames, since the two hook actions are very different (unlike the +> preprocess hook, which does a very similar thing in scan mode). +> +> Just calling it `rename` seems like a reasonable name, by analogy with +> the `delete` and `change` hooks. +> +> It might make sense to rename `renamepage` to `renamelink` to make it +> clearer what it does. (I'm not very worried about this breaking things, at +> this point.) --[[Joey]] + +>> In my `po` branch, I renamed `renamepage` to `renamelink`, and +>> created a `rename` hook that is passed a reference to `@torename`. +>> --[[intrigeri]] + +>>> As Joey highlights it on [[plugins/contrib/po]], it's too late to +>>> merge such a change, as the 3.x plugin API is released and should +>>> not be broken. I will thus keep the existing `renamepage` as it +>>> is, and call `rename` the global hook I need. --[[intrigeri]] + +>>>> Done in my `po` branch. --[[intrigeri]] + +I think I see a problem in the rename hook. The hook is called +before the plugin adds any subpages to the set of pages to rename. +So, if the user choses to rename subpages, po will not notice +they are moving, and will not move their po files. + +Perhaps the hooks should be moved to come after subpages are added. +This would, though, mean that if the hook somehow decides to add +entirely other pages to the list, their subpages would not be +automatically added. + +I also have some qualms about the design of the hook. In particular, +passing the mutable array reference probably makes it impossible +to use from external plugins. Instead it could return any additional +rename hashes it wants to add. Or, if the ability to modify existing +hashes is desired, it could return the full set of hashes. + +--[[Joey]] + +> I fixed the last part, i.e. a rename hook function now returns the +> full set of hashes. As I also converted it to take named parameters, +> such a function still is passed a reference to the original array, +> though, because one can't build a hash containing an array of hashes +> as a value, without passing this array as a reference. +> +>> Sure. +> +> I'm not entirely sure about your first concern. Calling the hook +> before or after the subpages addition both have their own problems. +> +> What about running the hook before *and* after the subpages +> addition, with an additional `when` named parameter, so that +> a given hook function can choose to act only before or after, or both? +> +> --[[intrigeri]] +>> +>> Have you thought about making the hook be run once *per* file that is +>> selected to be renamed? This would even handle the case where two +>> plugins use the hook; plugin A would see when plugin B adds a new file +>> to be renamed. And the subpage renaming stuff could probably be moved +>> into the rename hook too. --[[Joey]] +>>> +>>> I've implemented this nice solution in my po branch, please review. +>>> I'm slowly coming back to do the last bits needed to get my po and +>>> meta branch merged. --[[intrigeri]] + +>>>> It looks good. I made some small changes to it in my own po branch. +>>>> Nothing significant really. If this were not tied up in the po branch, +>>>> I've have merged it to master already. --[[Joey]] + +>>>> Thanks, this is great :) --[[intrigeri]] diff --git a/doc/todo/overriding_displayed_modification_time.mdwn b/doc/todo/overriding_displayed_modification_time.mdwn new file mode 100644 index 000000000..160d31519 --- /dev/null +++ b/doc/todo/overriding_displayed_modification_time.mdwn @@ -0,0 +1,27 @@ +Some aggregators, like Planet, sort by mtime rather than ctime. This +means that posts with modified content come to the top (which seems odd +to me, but is presumably what the aggregator's author or operator +wants), + +> Hah! That's so charitable I hope you can deduct it from your taxes. ;-) +> --[[Joey]] + +but it also means that posts with insignificant edits (like +adding tags) come to the top too. Atom defines `<updated>` to be the date +of the last *significant* change, so it's fine that ikiwiki defaults to +using the mtime, but it would be good to have a way for the author to +say "that edit was insignificant, don't use that mtime". + +> Yes, this is a real limitiation of ikiwiki's atom support. --[[Joey]] + +See smcv's 'updated' branch for a basic implementation, which only affects +the Atom `<updated>` field or the RSS equivalent. + +Other places the updated metadata item could be used (opinions on whether +each should use it or not, please): + +* sorting by mtime in the inline directive +* displaying "last edited" on ordinary pages + +> Tending toward no for both, but willing to be convinced otherwise.. +> [[merged|done]] --[[Joey]] 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/pingback_support.mdwn b/doc/todo/pingback_support.mdwn new file mode 100644 index 000000000..b10366bda --- /dev/null +++ b/doc/todo/pingback_support.mdwn @@ -0,0 +1,39 @@ +A "pingback" is a system whereby URLs you might reference in a blog post are +contacted by the blog publishing software at publishing time (i.e., once) so +that they might update a list of "pingbacks" to the URL. The originating +URL's blog software might then display a list of pingbacks, or an excerpt of +the text from your blog, perhaps interleaved with comments, etc. + +At a technical level, external URLs are extracted from your blog post by the +blogging software, fetched, inspected for information to determine whether the +remote server is configured to support pingbacks (look for link tags, or HTTP +headers) and the relevant pingback URL sent an XML-RPC packet. + +There are other technologies to achieve the same thing: trackbacks predate +pingbacks but are more vulnerable to spam due to design problems. + +The spec for pingbacks is at <http://www.hixie.ch/specs/pingback/pingback>. + +I would like to somehow use pingbacks in conjunction with ikiwiki. I suppose +this could be achieved using a commit hook and some external software in which +case I will consider this done with an entry in [[tips]]; otherwise a +[[plugins|plugin]] to implement pingbacks would be great. + +-- [[Jon]] (Wed Jan 14 13:48:47 GMT 2009) + +> I think it's now possible to implement trackback and pingback receiving +> support in ikiwiki. One easy way to do it would be to hook it into the +> existing [[plugins/comments]] plugin -- each pingback/trackback that +> ikiwiki recieves would result in the creation if a new comment, which +> would be subject to the usual comment filtering (ie, blogspam) and +> moderation and would then show up amoung the other, regular comments on +> the page. +> +> (One wrinkle: would need to guard against duplicate pings. Maybe by +> checking existing comments for any that have the same url?) +> +> As for sending trackbacks and pingbacks, this could fairly easily be +> implemented using a `editcontent` hook. Since this hook is called +> whenever a page is posted or edited, and gets the changed content, it can +> simply scan it for urls (may have to htmlize first?), and send pings to +> all urls found. --[[Joey]] diff --git a/doc/todo/plugin.mdwn b/doc/todo/plugin.mdwn index 132de4480..b3e3a7889 100644 --- a/doc/todo/plugin.mdwn +++ b/doc/todo/plugin.mdwn @@ -70,10 +70,6 @@ Suggestions of ideas for plugins: > web-server-specific code to list all users, and openid can't feasibly do so > at all. --[[JoshTriplett]] -* It would be nice to be able to have a button to show "Differences" (or - "Show Diff") when editing a page. Is that an option that can be enabled? - Using a plugin? - * For PlaceWiki I want to be able to do some custom plugins, including one that links together subpages about the same place created by different users. This seems to call for a plugin that applies to every page w/o any diff --git a/doc/todo/provide_inline_diffs_in_recentchanges.mdwn b/doc/todo/provide_inline_diffs_in_recentchanges.mdwn index 7724576f5..39a35d0c6 100644 --- a/doc/todo/provide_inline_diffs_in_recentchanges.mdwn +++ b/doc/todo/provide_inline_diffs_in_recentchanges.mdwn @@ -1,3 +1,8 @@ It would rock if I could view diffs from the web without going via feeds. I envision toggle-style buttons on the recentchanges page, or just links to the CGI, which then displays the diff... --[[madduck]] +> The diffs are actually there, enabled by the `recentchangesdiff` +> plugin, but they are hidden in the XHTML version by the stylesheet. +> You might try a user stylesheet with `div.diff { display: block }`. +> --[[JasonBlevins]] + [[!tag wishlist]] diff --git a/doc/todo/provide_sha1_for_git_diffurl.mdwn b/doc/todo/provide_sha1_for_git_diffurl.mdwn new file mode 100644 index 000000000..01aa512f8 --- /dev/null +++ b/doc/todo/provide_sha1_for_git_diffurl.mdwn @@ -0,0 +1,26 @@ +This [[patch]] allows for `\[[sha1]]` substitution in the `diffurl` +for git repositories. This is useful for use with [cgit][] which has +diffurls of the following form: + + /project.git/diff/\[[file]]?id=\[[sha1_commit]] + + [cgit]: http://hjemli.net/git/cgit/ + + diff --git a/IkiWiki/Plugin/git.pm b/IkiWiki/Plugin/git.pm + index 5bef928..164210d 100644 + --- a/IkiWiki/Plugin/git.pm + +++ b/IkiWiki/Plugin/git.pm + @@ -518,6 +518,7 @@ sub rcs_recentchanges ($) { + + my $diffurl = defined $config{'diffurl'} ? $config{'diffurl'} : ""; + $diffurl =~ s/\[\[file\]\]/$file/go; + + $diffurl =~ s/\[\[sha1\]\]/$sha1/go; + $diffurl =~ s/\[\[sha1_parent\]\]/$ci->{'parent'}/go; + $diffurl =~ s/\[\[sha1_from\]\]/$detail->{'sha1_from'}/go; + $diffurl =~ s/\[\[sha1_to\]\]/$detail->{'sha1_to'}/go; + +> [[done]], but I called it `sha1_commit` since I think that's what it's +> actually a sha1 of. --[[Joey]] + +>> I was at a loss for something more descriptive...I like that much +>> better :) Thanks! --[[JasonBlevins]] diff --git a/doc/todo/rcs_updates_needed_for_rename_and_remove.mdwn b/doc/todo/rcs_updates_needed.mdwn index 2af659c3b..472a5800f 100644 --- a/doc/todo/rcs_updates_needed_for_rename_and_remove.mdwn +++ b/doc/todo/rcs_updates_needed.mdwn @@ -3,3 +3,8 @@ renaming and removing files using the web interface. The mercurial and tla [[rcs]] backends need implementions of these functions. (The maintainers of these backends have been mailed. --[[Joey]]) + +Also, currently git is the only VCS to have support for +[[untrusted_push|tips/untrusted_git_push]]. It _may_ be possible to +implement it for other DVCS, if they offer a hook that can be used to check +incoming pushes early. diff --git a/doc/todo/redirect_automatically_after_rename.mdwn b/doc/todo/redirect_automatically_after_rename.mdwn new file mode 100644 index 000000000..1cbb824d2 --- /dev/null +++ b/doc/todo/redirect_automatically_after_rename.mdwn @@ -0,0 +1,10 @@ +In some wikis, (e.g. Mediawiki) after [[renaming|plugins/rename]] +a page, the old page still exist but only redirect to the +new page. This is convenient since external sites may +have links pointing to the old url. + +If [[plugins/meta]] plugin is enabled, users can manually edit the +page, and put in '\[[!meta redir=newpage]]', but this is +not very convenient. + + diff --git a/doc/todo/relative_pagespec_deficiency.mdwn b/doc/todo/relative_pagespec_deficiency.mdwn new file mode 100644 index 000000000..4500581c7 --- /dev/null +++ b/doc/todo/relative_pagespec_deficiency.mdwn @@ -0,0 +1,8 @@ +While a relative pagespec like `./posts/*` will work, when used in a page +such as `bdale/blog`, you cannot do +`created_after(./posts/foo)` -- only `glob()` supports relative page +references. + +The other pagespec functions should too, where appropriate. + +[[done]] diff --git a/doc/todo/replace_HTML::Template_with_Template_Toolkit.mdwn b/doc/todo/replace_HTML::Template_with_Template_Toolkit.mdwn index dfeacbabd..c4e78ca0b 100644 --- a/doc/todo/replace_HTML::Template_with_Template_Toolkit.mdwn +++ b/doc/todo/replace_HTML::Template_with_Template_Toolkit.mdwn @@ -54,3 +54,7 @@ the templates. I'd prefer not having to touch Perl though... ----- Yes, Template::Toolkit is very powerful. But I think it's somehow overkill for a wiki. HTML::Template can keep things simple, though. --[weakish](http://weakish.int.eu.org/blog/) + +I'd have to agree that Template::Toolkit is overkill and personally I'm not a fan, but it is very popular (there is even a book) and the new version (3) is alleged to be much more nimble than current version. --[[ajt]] + +HTML::Template's HTML-like markup prevents me from editing templates in KompoZer or other WYSIWYG HTML editors. The editor tries to render the template markup rather than display it verbatim, and large parts of the template become invisible. A markup syntax that doesn't confuse editors (such as Template::Toolkit's "[% FOO %]") may promote template customization. The ability to replace the template engine would be within the spirit of ikiwiki's extensibility. --Rocco 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/rewrite_ikiwiki_in_haskell.mdwn b/doc/todo/rewrite_ikiwiki_in_haskell.mdwn new file mode 100644 index 000000000..204c48cd7 --- /dev/null +++ b/doc/todo/rewrite_ikiwiki_in_haskell.mdwn @@ -0,0 +1,68 @@ +[[!tag wishlist blue-sky]] + +In the long term, I have been considering rewriting ikiwiki in haskell. +It's appealing for a lot of reasons, including: + +* No need to depend on a C compiler and have wrappers. Instead, ikiwiki + binaries could be built on demand to do the things wrappers are used for + now (cgi, post-commit, etc). +* Potentially much faster. One problem with the now very modular ikiwiki is + that it has to load up dozens of perl modules each time it runs, which + means both opening lots of files and evaluating them. A haskell version + could run from one pre-compiled file. Other speed efficienies are also + likely with haskell. For example, pandoc is apparently an order of + magnitude faster than perl markdown implementations. +* Many plugins could be written in pure functional code, with no side + effects. Not all of them, of course. +* It should be much easier to get ikiwiki to support parallel compilation + on multi-core systems using haskell. +* A rewrite would be an opportunity to utterly break compatability and + redo things based on experience. Since the haskell libraries used for + markdown, templates, etc, are unlikely to be very compatable with the perl + versions, and since perl plugins obviously wouldn't work, and perl setup + files wouldn't be practical to keep, a lot of things would unavoidably + change, and at that point changinge everything else I can think of + probably wouldn't hurt (much). + + - Re templates, it would be nice to have a template library that + doesn't use html-ish templating tags, since those are hard for users to + edit in html editors currently. + - This would be a chance to make WikiLinks with link texts read + "the right way round" (ie, vaguely wiki creole compatably). + - The data structures would probably be quite different. + - I might want to drop a lot of the command-line flags, either + requiring a setup file be used for those things, or leaving the + general-purpose `--set var=value` flag. + - Sometimes the current behavior of `--setup` seems confusing; it might + only cause a setup file to be read, and not force rebuild mode. + - Hard to say how the very high level plugin interface design would change, + but at the least some of the names of hooks could stand a rename, and + their parameter passing cleaned up. + +We know that a big, break-the-world rewrite like this can be a very +bad thing for a project to attempt. It would be possible to support +external plugins written in haskell today, without any rewrite; and a few +of the benefits could be obtained by, eg, making the mdwn plugin be a +haskell program that uses pandoc. I doubt that wouod be a good first step +to converting ikiwiki to haskell, because such a program would have very +different data structures and intercommuniucation than a pure haskell +version. + +Some other things to be scared about: + +* By picking perl, I made a lot of people annoyed (and probably turned + several people away from using ikiwiki). But over time there turned out + to be a lot of folks who knew perl already (even if rustily), and made + some *very* useful contributions. I doubt there's as large a pool of haskell + programmers, and it's probably harder for a python user to learn haskell + than perl if they want to contribute to ikiwiki. +* It might be harder for users of hosting services to install a haskell based + ikiwiki than the perl version. Such systems probably don't have ghc and + a bunch of haskell libraries. OTOH, it might be possible to build a + static binary at home and upload it, thus avoiding a messy installation + procedure entirely. +* I can barely code in haskell yet. I'm probably about 100x faster at + programming in perl. I need to get some more practical experience before + I´m fast and seasoned enough in haskell to attempt such a project. + (And so far, progress at learning has been slow and I have not managed + to write anything serious in haskell.) --[[Joey]] diff --git a/doc/todo/rewrite_ikiwiki_in_haskell/discussion.mdwn b/doc/todo/rewrite_ikiwiki_in_haskell/discussion.mdwn new file mode 100644 index 000000000..1edebe4e8 --- /dev/null +++ b/doc/todo/rewrite_ikiwiki_in_haskell/discussion.mdwn @@ -0,0 +1,14 @@ +Ok, I have to admit, I have no idea if this is an April fool's joke or not. +Congratulations for demonstrating that April fools jokes can still be subtle +(whether intentionally or not!) -- [[Jon]] + +> Having said all that, have you looked at erlang? Have you heard of couchdb? +> I'd strongly recommend looking at that. -- [[Jon]] + +>> I've glanced at couchdb, but don't see how it would tie in with ikiwiki. +>> --[[Joey]] + + +>>> It doesn't really. I recently (re-)read about couchdb and thought that +>>> what it was trying to do had some comparisons with the thinking going on +>>> in [[todo/structured_page_data]]. -- [[Jon]] diff --git a/doc/todo/source_link.mdwn b/doc/todo/source_link.mdwn index 93791c81a..b051361a8 100644 --- a/doc/todo/source_link.mdwn +++ b/doc/todo/source_link.mdwn @@ -1,6 +1,6 @@ How about a direct link from the page header to the source of the latest version, to avoid the need to either use edit or navigate to the current version via the history link? - I'd like this too (and might try to implement it). -- [[jondowland]] + I'd like this too (and might try to implement it). -- [[users/jon]] I just implemented this. There is one [[patch]] to the default page template, and a new plugin. -- [[Will]] @@ -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/support_creole_markup.mdwn b/doc/todo/support_creole_markup.mdwn index b0ebf5b9e..5a1e1286d 100644 --- a/doc/todo/support_creole_markup.mdwn +++ b/doc/todo/support_creole_markup.mdwn @@ -12,7 +12,7 @@ And there is a perl module: Text::WikiCreole Syntax file for vim: http://www.peter-hoffmann.com/code/vim/ (Since a typical ikiwiki user usually use external editors. :)) -> Should be pretty easy to add a plugin to do it using [[cpan +> Should be pretty easy to add a plugin to do it using [[!cpan > Text::WikiCreole]]. --[[Joey]] [[done]] diff --git a/doc/todo/supporting_comments_via_disussion_pages.mdwn b/doc/todo/supporting_comments_via_disussion_pages.mdwn index e0495c8c2..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; @@ -213,3 +213,8 @@ do you think so far? Known issues include: un-wikiish). --[[smcv]] + +I've updated smcvpostcomment and publicised it as [[plugins/contrib/comments]]. --[[smcv]] + +> While there is still room for improvement and entirely other approaches, +> I am calling this done since smcv's comments plugin is ready. --[[Joey]] diff --git a/doc/todo/syntax_highlighting.mdwn b/doc/todo/syntax_highlighting.mdwn new file mode 100644 index 000000000..b5d083ba5 --- /dev/null +++ b/doc/todo/syntax_highlighting.mdwn @@ -0,0 +1,133 @@ +There's been a lot of work on contrib syntax highlighting plugins. One should be +picked and added to ikiwiki core. + +Ideally, it should support both converting whole source files into wiki +pages, as well as doing syntax highlighting as a preprocessor directive +(which is either passed the text, or reads it from a file). + +## The big list of possibilities + +* [[plugins/contrib/highlightcode]] uses [[!cpan Syntax::Highlight::Engine::Kate]], + operates on whole source files only, has a few bugs (see + [here](http://u32.net/Highlight_Code_Plugin/), and needs to be updated to + support [[bugs/multiple_pages_with_same_name]]. +* [[!cpan IkiWiki-Plugin-syntax]] only operates as a directive. + Interestingly, it supports multiple highlighting backends, including Kate + and Vim. +* [[plugins/contrib/syntax]] only operates as a directive + ([[not_on_source_code_files|automatic_use_of_syntax_plugin_on_source_code_files]]), + and uses [[!cpan Text::VimColor]]. +* [[plugins/contrib/sourcehighlight]] uses src-highlight, and operates on + whole source files only. Needs to be updated to + support [[bugs/multiple_pages_with_same_name]]. +* [[sourcecode|todo/automatic_use_of_syntax_plugin_on_source_code_files/discussion]] + also uses src-highlight, and operates on whole source files. + Updated to work with the fix for [[bugs/multiple_pages_with_same_name]]. Untested with files with no extension, e.g. `Makefile`. +* [[users/jasonblevins]]'s code plugin uses src-highlight, and supports both + while file and directive use. + +* [hlsimple](http://pivot.cs.unb.ca/git/?p=ikiplugins.git;a=blob_plain;f=IkiWiki/Plugin/hlsimple.pm;hb=HEAD) is a wrapper for the the perl module Syntax::Highlight::Engine::Simple. This is pure perl, pretty simple, uses css. It ought to be pretty fast (according to the author, and just because it is not external). +On the other hand, there are not many predefined languages yet. Defining language syntaxes is about as much +work as source-highlight, but in perl. I plan to package the base module for debian. Perhaps after the author +releases the 5 or 6 language definitions he has running on his web site, it might be suitable for inclusion in ikiwiki. [[DavidBremner]] + +## General problems + +* Using non-perl syntax highlighting backends is slow. I'd prefer either + using a perl module, or a multiple-backend solution that can use a perl + module as one option. (Or, if there's a great highlighter python module, + we could use an external plugin..) +* Currently no single plugin supports both modes of operation (directive + and whole source file to page). + + > This is now fixed by the [[ikiwiki/directive/format]] directive for all + > whole-source-file plugins, right? + +* Nothing seems to support + [[wiki-formatted_comments|wiki-formatted_comments_with_syntax_plugin]] + inside source files. Doing this probably means post-processing the + results of the highlighting engine, to find places where it's highlighted + comments, and then running them through the ikiwiki rendering pipeline. + This seems fairly doable with [[!cpan Syntax::Highlight::Engine::Kate]], + at least. +* The whole-file plugins tend to have a problem that things that look like + wikilinks in the source code get munged into links by ikiwiki, which can + have confusing results. Similar problem with preprocessor directives. + One approach that's also been requested for eg, + [[plugins/contrib/mediawiki]] is to allow controlling which linkification + types a page type can have on it. + + > The previous two points seem to be related. One thought: instead of + > getting the source from the `content` parameter, the plugin could + > re-load the page source. That would stop directives/links from + > being processed in the source. As noted above, comments + > could then be parsed for directives/links later. + > + > Would it be worth adding a `nodirectives` option when registering + > an htmlize hook that switches off directive and link processing before + > generating the html for a page? + +* The whole-file plugins all get confused if there is a `foo.c` and a `foo.h`. + This is trivially fixable now by passing the keepextension option when + registering the htmlize hooks, though. +* Whole-file plugins register a bunch of htmlize hooks. The wacky thing + about it is that, when creating a new page, you can then pick "c" or + "h" or "pl" etc from the dropdown that normally has "mdwn" etc in it. + Is this a bug, or a feature? (Even if a feature, plugins with many + extensions make the dropdown unusable.. One way to deal with that is have + a config setting that lists what extensions to offer highlighting for. + Most people won't need/want the dozens some engines support.) +* The per page highlighters can't handle creating wiki pages from + "Makefile", or other files without a significant extension. + Not clear how to fix this, as ikiwiki is very oriented toward file + extensions. The workaround is to use a directive on a wiki page, pulling + in the Makefile. + + > I wonder how hard it would be to make a patch whereby a file with + > no `.` in the name, and a name that matches a filetype, and where + > that filetype was registered `keepextension`, then the file is just + > chosen as the appropriate type. This would allow `Makefile` to + > work. + +like this: + + diff --git a/IkiWiki.pm b/IkiWiki.pm + index 8d728c9..1bd46a9 100644 + --- a/IkiWiki.pm + +++ b/IkiWiki.pm + @@ -618,6 +618,8 @@ sub pagetype ($) { + + if ($page =~ /\.([^.]+)$/) { + return $1 if exists $hooks{htmlize}{$1}; + + } elsif ($hooks{htmlize}{$page}{keepextension}) { + + return $page; + } + return; + } + +## format directive + +Rather than making syntax highlight plugins have to provide a preprocessor +directive as well as handling whole source files, perhaps a generic format +directive could be used: + + \[[!format pl """..."""]] + +That would run the text through the pl htmlizer, from the syntax hightligh +plugin. OTOH, if "rst" were given, it would run the text through the rst +htmlizer. So, more generic, allows mixing different types of markup on one +page, as well as syntax highlighting. Does require specifying the type of +format, instead of allowing it to be guessed (which some syntax highlighters +can do). (This directive is now implemented..) + +Hmm, this would also allow comments inside source files to have mdwn +embedded in them, without making the use of mdwn a special case, or needing +to postprocess the syntax highlighter output to find comments. + + /* \[[!format mdwn """ + + This is a comment in my C file. You can use mdwn in here. + + """]] */ + +Note that this assumes that directives are expanded in source files. diff --git a/doc/todo/syntax_highlighting/discussion.mdwn b/doc/todo/syntax_highlighting/discussion.mdwn new file mode 100644 index 000000000..7a4095c65 --- /dev/null +++ b/doc/todo/syntax_highlighting/discussion.mdwn @@ -0,0 +1,26 @@ +sourcehighlight is annoyingly slow, but it does support wiki directives +in comments. See [here](http://www.cs.unb.ca/~bremner/teaching/java_examples/snippet/ListMerge/) +for an example (tags). + +> I think that is just a result of it expanding directives, and wikilinks, +> everywhere in the file, which is generally a possible problem.. +> --[[Joey]] + +* * * * * + +I think having the option to choose source code page types from the +dropdown list is definitely a feature. This gives users an easy way +to contribute programs (say `.pl` files) or code snippets (like, for +example, the Elisp area of the EmacsWiki). Actually, would there any +other way to create a `.pl` file without write access to the +repository? --[[JasonBlevins]] + +> Well, you can upload them as an attachment if the wiki is configured to +> allow it. Having them in the drop down becomes a problem when there are +> so many wacky extensions in there that you can't find anything. +> --[[Joey]] + +>> I should just note that the +>> [[sourcecode|todo/automatic_use_of_syntax_plugin_on_source_code_files/discussion]] +>> plugin only adds the file extensions listed in the config. This shouldn't cause +>> massive drop-down menu pollution. -- [[Will]] diff --git a/doc/todo/tag_pagespec_function.mdwn b/doc/todo/tag_pagespec_function.mdwn new file mode 100644 index 000000000..681a1f661 --- /dev/null +++ b/doc/todo/tag_pagespec_function.mdwn @@ -0,0 +1,34 @@ +Implementing tags in terms of links is clever, but it would be nice if it was +opaque in both directions: tagging and matching tags. Writing pagespecs to +find out which pages are tagged with a given name means that the pagespec is +tied to whatever the tagbase is. + +This patch adds a pagespec function 'tag' which lets you write pagespecs to +match tagged pages independent of whatever the tagbase is set to. + + -- [[users/Jon]] 2009/02/17 + +> So, this looks good, appreciate the patch. +> +> The only problem I see is it could be confusing if `tag(foo)` matched +> a page that just linked to the tag via a wikilink, w/o actually tagging it. +> +> One other thing, perhaps it should be called `tagged()`? --[[Joey]] + +[[!tag patch done]] + + --- a/plugins/IkiWiki/Plugin/tag.pm 2009-02-16 11:30:11.000000000 +0000 + +++ b/plugins/IkiWiki/Plugin/tag.pm 2009-02-17 15:40:03.000000000 +0000 + @@ -125,4 +125,12 @@ + } + } + + +package IkiWiki::PageSpec; + + + +sub match_tag ($$;@) { + + my $page = shift; + + my $glob = shift; + + return match_link($page, IkiWiki::Plugin::tag::tagpage($glob)); + +} + + + 1 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/tla.mdwn b/doc/todo/tla.mdwn index 6ef8453f1..b6b082cfe 100644 --- a/doc/todo/tla.mdwn +++ b/doc/todo/tla.mdwn @@ -1,4 +1,7 @@ * Need to get post commit hook code working. * Need some example urls for web based diffs. +* `rcs_commit_staged`, `rcs_rename`, `rcs_remove`, are not + implemented for tla, and so attachments, remove and rename plugins + cannot be used with it. (These should be fairly easy to add..) [[!tag rcs/tla]] 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/toc_plugin:_set_a_header_ceiling___40__opposite_of_levels__61____41__.mdwn b/doc/todo/toc_plugin:_set_a_header_ceiling___40__opposite_of_levels__61____41__.mdwn new file mode 100644 index 000000000..547c7a80a --- /dev/null +++ b/doc/todo/toc_plugin:_set_a_header_ceiling___40__opposite_of_levels__61____41__.mdwn @@ -0,0 +1,3 @@ +It would be nice if the [[plugins/toc]] plugin let you specify a header level "ceiling" above which (or above and including which) the headers would not be incorporated into the toc. + +Currently, the levels=X parameter lets you tweak how deep it will go for small headers, but I'd like to chop off the h1's (as I use them for my page title) -- [[Jon]] 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 deleted file mode 100644 index 651b7fa0f..000000000 --- a/doc/todo/using_meta_titles_for_parentlinks.html +++ /dev/null @@ -1,116 +0,0 @@ -It is possible to set a Page-Title in the meta-plugin, but that one isn't -reused in parentlinks. This [[patch]] may fix it. - -<ul> -<li> I give pagetitle the full path to a page. -<li> I redefine the 'pagetitle'-sub to deal with it. -<li> to maintain compatibility for IkiWikis without the meta-plugin, i added a 'basename' to the Original-pagetitle. -</ul> - -<pre> -diff -c /usr/share/perl5/IkiWiki/Render.pm.distrib /usr/share/perl5/IkiWiki/Render.pm -*** /usr/share/perl5/IkiWiki/Render.pm.distrib Wed Aug 6 07:34:55 2008 ---- /usr/share/perl5/IkiWiki/Render.pm Tue Aug 26 23:29:32 2008 -*************** -*** 102,108 **** - $template->param( - title => $page eq 'index' - ? $config{wikiname} -! : pagetitle(basename($page)), - wikiname => $config{wikiname}, - content => $content, - backlinks => $backlinks, ---- 102,108 ---- - $template->param( - title => $page eq 'index' - ? $config{wikiname} -! : pagetitle($page), - wikiname => $config{wikiname}, - content => $content, - backlinks => $backlinks, - -diff -c /usr/share/perl5/IkiWiki/Plugin/parentlinks.pm.distrib /usr/share/perl5/IkiWiki/Plugin/parentlinks.pm -*** /usr/share/perl5/IkiWiki/Plugin/parentlinks.pm.distrib Wed Aug 6 07:34:55 2008 ---- /usr/share/perl5/IkiWiki/Plugin/parentlinks.pm Tue Aug 26 23:19:43 2008 -*************** -*** 44,50 **** - "height_$height" => 1, - }; - $path.="/".$dir; -! $title=IkiWiki::pagetitle($dir); - $i++; - } - return @ret; ---- 44,50 ---- - "height_$height" => 1, - }; - $path.="/".$dir; -! $title=IkiWiki::pagetitle($path); - $i++; - } - return @ret; - -diff -c /usr/share/perl5/IkiWiki.pm.distrib /usr/share/perl5/IkiWiki.pm -*** /usr/share/perl5/IkiWiki.pm.distrib Wed Aug 6 07:48:34 2008 ---- /usr/share/perl5/IkiWiki.pm Tue Aug 26 23:47:30 2008 -*************** -*** 792,797 **** ---- 792,799 ---- - my $page=shift; - my $unescaped=shift; - -+ $page=basename($page); -+ - if ($unescaped) { - $page=~s/(__(\d+)__|_)/$1 eq '_' ? ' ' : chr($2)/eg; - } - -diff -c /usr/share/perl5/IkiWiki/Plugin/meta.pm.distrib /usr/share/perl5/IkiWiki/Plugin/meta.pm -*** /usr/share/perl5/IkiWiki/Plugin/meta.pm.distrib Wed Aug 6 07:34:55 2008 ---- /usr/share/perl5/IkiWiki/Plugin/meta.pm Tue Aug 26 23:30:58 2008 -*************** -*** 3,8 **** ---- 3,9 ---- - package IkiWiki::Plugin::meta; - - use warnings; -+ no warnings 'redefine'; - use strict; - use IkiWiki 2.00; - -*************** -*** 289,294 **** ---- 290,319 ---- - } - } #}}} - -+ sub IkiWiki::pagetitle ($;$) { #{{{ -+ my $page=shift; -+ my $unescaped=shift; -+ -+ if ($page =~ m#/#) { -+ $page =~ s#^/##; -+ $page =~ s#/index$##; -+ if ($pagestate{"$page/index"}{meta}{title}) { -+ $page = $pagestate{"$page/index"}{meta}{title}; -+ } else { -+ $page = IkiWiki::basename($page); -+ } -+ } -+ -+ if ($unescaped) { -+ $page=~s/(__(\d+)__|_)/$1 eq '_' ? ' ' : chr($2)/eg; -+ } -+ else { -+ $page=~s/(__(\d+)__|_)/$1 eq '_' ? ' ' : "&#$2;"/eg; -+ } -+ -+ return $page; -+ } #}}} -+ - package IkiWiki::PageSpec; - - 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; + diff --git a/doc/todo/wiki-formatted_comments_with_syntax_plugin.mdwn b/doc/todo/wiki-formatted_comments_with_syntax_plugin.mdwn index 08ca61b0c..a5244c9ef 100644 --- a/doc/todo/wiki-formatted_comments_with_syntax_plugin.mdwn +++ b/doc/todo/wiki-formatted_comments_with_syntax_plugin.mdwn @@ -1 +1,4 @@ -[[Wishlist]] item: I'd love to see the ability to optionally switch back to wiki syntax within the comments of code pretty-printed with the [[plugins/contrib/syntax]] plugin. This would allow the use of links and formatting in comments. +[[Wishlist]] item: I'd love to see the ability to optionally switch back to +wiki syntax within the comments of code pretty-printed with the +[[plugins/contrib/syntax]] plugin. This would allow the use of links and +formatting in comments. diff --git a/doc/todo/wikiwyg.mdwn b/doc/todo/wikiwyg.mdwn index e3d1b3927..839986c7b 100644 --- a/doc/todo/wikiwyg.mdwn +++ b/doc/todo/wikiwyg.mdwn @@ -57,3 +57,8 @@ The plugin can be downloaded from <http://ikiwiki.xbaud.com/wikiwyg-1.6.tar.gz> * Personalized settings [Wikiwyg]: http://www.wikiwyg.net/ + +> As noted in [[discussion]], the url above doesn't work, and I stupidly +> lost my copy of this before merging it. I hope that this plugin will turn +> back up. In the meantime, there is a wmd plugin that accomplishes the +> same basic task of WSYWIG markdown editing. --[[Joey]] |