From 67ba074ba8809a2f849ee51770e3d4695311647c Mon Sep 17 00:00:00 2001 From: intrigeri Date: Mon, 26 Jan 2009 23:47:34 +0100 Subject: need_global_renamepage_hook: s/suggest/will Signed-off-by: intrigeri --- doc/todo/need_global_renamepage_hook.mdwn | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'doc/todo') diff --git a/doc/todo/need_global_renamepage_hook.mdwn b/doc/todo/need_global_renamepage_hook.mdwn index aa543a64c..c5b2b1096 100644 --- a/doc/todo/need_global_renamepage_hook.mdwn +++ b/doc/todo/need_global_renamepage_hook.mdwn @@ -58,6 +58,5 @@ would solve my problem. Hmmm? --[[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'm thus proposing to keep the existing ->>> `renamepage` as it is, and call `rename` the global hook I need. ->>> --[[intrigeri]] +>>> not be broken. I will thus keep the existing `renamepage` as it +>>> is, and call `rename` the global hook I need. --[[intrigeri]] -- cgit v1.2.3 From 183f03aa968882c9d0e8e70b33e8a482aa16726a Mon Sep 17 00:00:00 2001 From: intrigeri Date: Tue, 27 Jan 2009 00:02:15 +0100 Subject: the rename hooks names waltz seems over Another set of hooks would not endure such heavy renaming, but the rename* hooks actually do ;) Signed-off-by: intrigeri --- doc/plugins/contrib/po.mdwn | 4 +--- doc/todo/need_global_renamepage_hook.mdwn | 2 ++ 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'doc/todo') diff --git a/doc/plugins/contrib/po.mdwn b/doc/plugins/contrib/po.mdwn index 70f5aa5a2..1751a6f7f 100644 --- a/doc/plugins/contrib/po.mdwn +++ b/doc/plugins/contrib/po.mdwn @@ -215,9 +215,7 @@ finish it at some point in the first quarter of 2009. --[[intrigeri]] > somehow. (Sorry, I guess I dropped the ball on not getting this > API change in before cutting 3.0..) >> ->> I'm discussing the solutions we now have on ->> [[todo/need_global_renamepage_hook]], as the solution I implemented ->> was initially agreed on there. +>> Fixed, see [[todo/need_global_renamepage_hook]]. >> > * I don't understand the parentlinks code change and need to figure it > out. Can you explain what is going on there? diff --git a/doc/todo/need_global_renamepage_hook.mdwn b/doc/todo/need_global_renamepage_hook.mdwn index c5b2b1096..7af2bdc56 100644 --- a/doc/todo/need_global_renamepage_hook.mdwn +++ b/doc/todo/need_global_renamepage_hook.mdwn @@ -60,3 +60,5 @@ would solve my problem. Hmmm? --[[intrigeri]] >>> 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]] -- cgit v1.2.3 From 16ff246d4112fd208189a05f7b64a6d0dbe53132 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 26 Jan 2009 19:41:35 -0500 Subject: rename hook issues --- doc/todo/need_global_renamepage_hook.mdwn | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'doc/todo') diff --git a/doc/todo/need_global_renamepage_hook.mdwn b/doc/todo/need_global_renamepage_hook.mdwn index 7af2bdc56..62e91eee4 100644 --- a/doc/todo/need_global_renamepage_hook.mdwn +++ b/doc/todo/need_global_renamepage_hook.mdwn @@ -62,3 +62,21 @@ would solve my problem. Hmmm? --[[intrigeri]] >>> 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]] -- cgit v1.2.3 From 9b4040992d69829b914d141551422722b84fca0e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 26 Jan 2009 20:11:33 -0500 Subject: meta: New "updated" metadata specifies a fake modification time for a page, to be output into RSS and Atom feeds. (smcv) --- debian/changelog | 2 ++ doc/todo/overriding_displayed_modification_time.mdwn | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'doc/todo') diff --git a/debian/changelog b/debian/changelog index 6c1710fe1..7f72a672a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,6 +10,8 @@ ikiwiki (3.03) UNRELEASED; urgency=low (in .ikiwiki/comments_pending) for moderator review. * comments: Add a moderation web interface. * git: Fix malformed utf8 recieved from git. + * meta: New "updated" metadata specifies a fake modification time for a + page, to be output into RSS and Atom feeds. (smcv) -- Joey Hess Sun, 18 Jan 2009 14:50:57 -0500 diff --git a/doc/todo/overriding_displayed_modification_time.mdwn b/doc/todo/overriding_displayed_modification_time.mdwn index b015b3730..160d31519 100644 --- a/doc/todo/overriding_displayed_modification_time.mdwn +++ b/doc/todo/overriding_displayed_modification_time.mdwn @@ -1,12 +1,19 @@ 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), but it also means that posts with insignificant edits (like +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 `` 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 `` field or the RSS equivalent. @@ -15,3 +22,6 @@ 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]] -- cgit v1.2.3 From c8ce3ed4404d37d7c2361f30466c7961f4e1418b Mon Sep 17 00:00:00 2001 From: intrigeri Date: Tue, 27 Jan 2009 17:22:38 +0100 Subject: rename hook: fixed half, added proposal for the other half Signed-off-by: intrigeri --- doc/todo/need_global_renamepage_hook.mdwn | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'doc/todo') diff --git a/doc/todo/need_global_renamepage_hook.mdwn b/doc/todo/need_global_renamepage_hook.mdwn index 62e91eee4..906bf1220 100644 --- a/doc/todo/need_global_renamepage_hook.mdwn +++ b/doc/todo/need_global_renamepage_hook.mdwn @@ -80,3 +80,18 @@ 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. +> +> 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]] -- cgit v1.2.3 From 94c932ee3d13924e3d916e859c2c9efa8e07ae31 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 27 Jan 2009 13:14:53 -0500 Subject: thought --- debian/changelog | 6 ++---- doc/todo/need_global_renamepage_hook.mdwn | 8 ++++++++ 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'doc/todo') diff --git a/debian/changelog b/debian/changelog index 6a64a0c49..785681ff4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,11 +1,9 @@ ikiwiki (3.03) UNRELEASED; urgency=low - * Avoid feeding decoded unicode to Term::ReadLine. - Closes: 512169 + * Avoid feeding decoded unicode to Term::ReadLine. Closes: 512169 * blogspam: Log spam info on failure in debug mode. * Remove nonstandard css. Closes: #512378 - * blogspam: Fix use of blogspam_options and blogspam_server - config settings. + * blogspam: Fix use of blogspam_options and blogspam_server config settings. * comments: If comment content checks fail, store the comment (in .ikiwiki/comments_pending) for moderator review. * comments: Add a moderation web interface, which admins can diff --git a/doc/todo/need_global_renamepage_hook.mdwn b/doc/todo/need_global_renamepage_hook.mdwn index 906bf1220..9c987aac4 100644 --- a/doc/todo/need_global_renamepage_hook.mdwn +++ b/doc/todo/need_global_renamepage_hook.mdwn @@ -87,6 +87,8 @@ hashes is desired, it could return the full set of hashes. > 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. > @@ -95,3 +97,9 @@ hashes is desired, it could return the full set of hashes. > 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]] -- cgit v1.2.3 From deea2f42aabf7e2e2bf8f2c9ec552caebd52f03d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 28 Jan 2009 16:51:19 -0500 Subject: close this, we have comments now --- doc/todo/discussion_page_as_blog.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/todo') 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]] -- cgit v1.2.3 From 0d58f263214183b4667987da48077d5e8e8a41c1 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 30 Jan 2009 14:07:03 -0500 Subject: merge dups --- ...itle_function_does_not_respect_meta_titles.mdwn | 123 ++++++++++++++++++++- doc/todo/using_meta_titles_for_parentlinks.html | 122 -------------------- 2 files changed, 121 insertions(+), 124 deletions(-) delete mode 100644 doc/todo/using_meta_titles_for_parentlinks.html (limited to 'doc/todo') diff --git a/doc/bugs/pagetitle_function_does_not_respect_meta_titles.mdwn b/doc/bugs/pagetitle_function_does_not_respect_meta_titles.mdwn index cccd53d05..11735f770 100644 --- a/doc/bugs/pagetitle_function_does_not_respect_meta_titles.mdwn +++ b/doc/bugs/pagetitle_function_does_not_respect_meta_titles.mdwn @@ -2,8 +2,127 @@ The `IkiWiki::pagetitle` function does not respect title changes via `meta.title --[[madduck]] -> Agreed. [[todo/using_meta_titles_for_parentlinks]] contains a beginning of -> solution. A few quick notes about it: +---- + +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. + +
    +
  • I give pagetitle the full path to a page. +
  • I redefine the 'pagetitle'-sub to deal with it. +
  • to maintain compatibility for IkiWikis without the meta-plugin, i added a 'basename' to the Original-pagetitle. +
+ +
+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 ($$;@) {
+
+
+ +-- + +> A few quick notes about it: > - Using inline would avoid the redefinition + code duplication. > - A few plugins would need to be upgraded. 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 6da40a415..000000000 --- a/doc/todo/using_meta_titles_for_parentlinks.html +++ /dev/null @@ -1,122 +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. - -
    -
  • I give pagetitle the full path to a page. -
  • I redefine the 'pagetitle'-sub to deal with it. -
  • to maintain compatibility for IkiWikis without the meta-plugin, i added a 'basename' to the Original-pagetitle. -
- -
-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 ($$;@) {
-
-
-
- -

-This is actually a duplicate for -[[bugs/pagetitle_function_does_not_respect_meta_titles]], where I'm -following up a bit. --[[intrigeri]] -

\ No newline at end of file -- cgit v1.2.3 From ef3f93b6f668381abb8cebe7ca116e5bf8997069 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Sat, 31 Jan 2009 18:37:48 +0000 Subject: Request review of my 'goto' branch --- doc/todo/apache_404_ErrorDocument_handler.mdwn | 2 +- doc/todo/generic___39__do__61__goto__39___for_CGI.mdwn | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'doc/todo') diff --git a/doc/todo/apache_404_ErrorDocument_handler.mdwn b/doc/todo/apache_404_ErrorDocument_handler.mdwn index b200ff3b2..e3dd7c345 100644 --- a/doc/todo/apache_404_ErrorDocument_handler.mdwn +++ b/doc/todo/apache_404_ErrorDocument_handler.mdwn @@ -15,4 +15,4 @@ 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. -I'm happy to write such a script if there is interest. --[[smcv]] +Implemented in the 'goto' branch in my git repository. --[[smcv]] 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 index 1828f0a7b..1276c8e6a 100644 --- a/doc/todo/generic___39__do__61__goto__39___for_CGI.mdwn +++ b/doc/todo/generic___39__do__61__goto__39___for_CGI.mdwn @@ -6,4 +6,5 @@ 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`? -If there's general approval I'm happy to write a patch. --[[smcv]] +> Now implemented as the 'goto' branch in my git repository, along with +> [[apache_404_ErrorDocument_handler]]. --[[smcv]] -- cgit v1.2.3 From f4dd02f00ae5255641b49d60e971f6f298f6a98f Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Sat, 31 Jan 2009 18:57:12 +0000 Subject: Clarify behaviour of 404 handler and link an example --- doc/todo/apache_404_ErrorDocument_handler.mdwn | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'doc/todo') diff --git a/doc/todo/apache_404_ErrorDocument_handler.mdwn b/doc/todo/apache_404_ErrorDocument_handler.mdwn index e3dd7c345..b580294ca 100644 --- a/doc/todo/apache_404_ErrorDocument_handler.mdwn +++ b/doc/todo/apache_404_ErrorDocument_handler.mdwn @@ -8,6 +8,9 @@ I think it'd probably have to be a separate CGI script because the environment w (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. @@ -15,4 +18,6 @@ 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. --[[smcv]] +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]] -- cgit v1.2.3 From 2524903dc60d678cca7496a58cecd5cd97a72ad2 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 31 Jan 2009 14:55:14 -0500 Subject: comments --- doc/todo/generic___39__do__61__goto__39___for_CGI.mdwn | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'doc/todo') 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 index 1276c8e6a..2c308d086 100644 --- a/doc/todo/generic___39__do__61__goto__39___for_CGI.mdwn +++ b/doc/todo/generic___39__do__61__goto__39___for_CGI.mdwn @@ -8,3 +8,13 @@ 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 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.. +>> --[[Joey]] -- cgit v1.2.3 From 7cdbe0da864f6c322c6b25238609b3ba62a61ad8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 31 Jan 2009 15:05:06 -0500 Subject: one other thought --- doc/todo/generic___39__do__61__goto__39___for_CGI.mdwn | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'doc/todo') 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 index 2c308d086..f48702bfa 100644 --- a/doc/todo/generic___39__do__61__goto__39___for_CGI.mdwn +++ b/doc/todo/generic___39__do__61__goto__39___for_CGI.mdwn @@ -17,4 +17,8 @@ something, and moved to `IkiWiki/CGI.pm`? >> 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]] -- cgit v1.2.3 From 0fe92602496210294e71c28ba459f06277a8c2ac Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Sat, 31 Jan 2009 23:08:48 +0000 Subject: Respond with updated goto branch --- doc/todo/generic___39__do__61__goto__39___for_CGI.mdwn | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'doc/todo') 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 index f48702bfa..4bf3fb449 100644 --- a/doc/todo/generic___39__do__61__goto__39___for_CGI.mdwn +++ b/doc/todo/generic___39__do__61__goto__39___for_CGI.mdwn @@ -13,6 +13,12 @@ something, and moved to `IkiWiki/CGI.pm`? >> * 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 @@ -22,3 +28,6 @@ something, and moved to `IkiWiki/CGI.pm`? >> 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]] -- cgit v1.2.3 From e5c8bc6222712fe9f465d4ac36350fd4ea729787 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 31 Jan 2009 19:10:48 -0500 Subject: doc updates for goto branch merge --- debian/changelog | 10 ++++++++++ debian/copyright | 4 ++++ doc/tips/dot_cgi.mdwn | 8 ++++++++ doc/todo/apache_404_ErrorDocument_handler.mdwn | 2 ++ doc/todo/generic___39__do__61__goto__39___for_CGI.mdwn | 2 ++ 5 files changed, 26 insertions(+) (limited to 'doc/todo') diff --git a/debian/changelog b/debian/changelog index 82a23212b..f3927f121 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +ikiwiki (3.04) UNRELEASED; urgency=low + + * apache404: New plugin which lets you use the IkiWiki CGI script as + an Apache 404 handler, to give the behaviour of various other wiki + engines where visiting a nonexistent page provides you with a link + to create it. (smcv) + * Factor out redundant code into goto plugin. (smcv) + + -- Joey Hess Sat, 31 Jan 2009 19:04:45 -0500 + ikiwiki (3.03) unstable; urgency=low * Avoid feeding decoded unicode to Term::ReadLine. Closes: 512169 diff --git a/debian/copyright b/debian/copyright index 71fb47013..bdfbaa573 100644 --- a/debian/copyright +++ b/debian/copyright @@ -118,6 +118,10 @@ Copyright: © 2008 Simon McVittie License: GPL-2+ +Files: apache404.pm +Copyright: © 2009 Simon McVittie +License: GPL-2+ + Files: doc/logo/* Copyright: © 2006 Recai Oktaş License: GPL-2+ diff --git a/doc/tips/dot_cgi.mdwn b/doc/tips/dot_cgi.mdwn index fbc3d8bbc..ffcbf95d4 100644 --- a/doc/tips/dot_cgi.mdwn +++ b/doc/tips/dot_cgi.mdwn @@ -26,6 +26,14 @@ configuration changes should work anywhere. Or, if you've put it in a `~/public_html`, edit `/etc/apache2/mods-available/userdir.conf`. +You may also want to enable the [[plugins/apache404]] +plugin. To make apache use it, the apache config file +will need a further modification to make it use ikiwiki's CGI +as the apache 404 handler. Something like this, with +the path adjusted to where you've put the CGI: + + ErrorDocument 404 /cgi-bin/ikiwiki.cgi + ## lighttpd Here is how to enable cgi on [lighttpd](http://www.lighttpd.net/) and diff --git a/doc/todo/apache_404_ErrorDocument_handler.mdwn b/doc/todo/apache_404_ErrorDocument_handler.mdwn index b580294ca..4ae1d1a79 100644 --- a/doc/todo/apache_404_ErrorDocument_handler.mdwn +++ b/doc/todo/apache_404_ErrorDocument_handler.mdwn @@ -21,3 +21,5 @@ error output needs to be at least 512 bytes long, so some padding might also be 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/generic___39__do__61__goto__39___for_CGI.mdwn b/doc/todo/generic___39__do__61__goto__39___for_CGI.mdwn index 4bf3fb449..26c5202d0 100644 --- a/doc/todo/generic___39__do__61__goto__39___for_CGI.mdwn +++ b/doc/todo/generic___39__do__61__goto__39___for_CGI.mdwn @@ -31,3 +31,5 @@ something, and moved to `IkiWiki/CGI.pm`? >>> No, good point - the `REDIRECT_STATUS` check is sufficiently unambiguous >>> already. Fixed. --[[smcv]] + +[[done]] -- cgit v1.2.3 From 4531e540746749391f1004f601eb78b42b826fd7 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 3 Feb 2009 10:37:24 -0500 Subject: implementing pingback using checkcontent hook and the comments plugin --- doc/todo/pingback_support.mdwn | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'doc/todo') diff --git a/doc/todo/pingback_support.mdwn b/doc/todo/pingback_support.mdwn index 6632cc747..3a7b5a931 100644 --- a/doc/todo/pingback_support.mdwn +++ b/doc/todo/pingback_support.mdwn @@ -20,3 +20,17 @@ 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. +> +> 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]] -- cgit v1.2.3 From 9690356080e995d7f9d3b3370c0030f87f9e8650 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 3 Feb 2009 10:43:27 -0500 Subject: note --- doc/todo/pingback_support.mdwn | 3 +++ 1 file changed, 3 insertions(+) (limited to 'doc/todo') diff --git a/doc/todo/pingback_support.mdwn b/doc/todo/pingback_support.mdwn index 3a7b5a931..b10366bda 100644 --- a/doc/todo/pingback_support.mdwn +++ b/doc/todo/pingback_support.mdwn @@ -28,6 +28,9 @@ case I will consider this done with an entry in [[tips]]; otherwise a > 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 -- cgit v1.2.3 From bc3fb1ceabf7f2139ce42e782e3f9d96e33dce0f Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Tue, 3 Feb 2009 13:33:59 -0500 Subject: Update the to-do list for comments, and explain why we can't have a form for the whole comment --- doc/todo/comments.mdwn | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'doc/todo') diff --git a/doc/todo/comments.mdwn b/doc/todo/comments.mdwn index c74ded8f6..8da640f26 100644 --- a/doc/todo/comments.mdwn +++ b/doc/todo/comments.mdwn @@ -10,19 +10,13 @@ > it's hard enough to get some people to title their blog posts :-) > --[[smcv]] -## Patches pending merge - -* 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]] - ## 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]] + * 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 @@ -47,6 +41,17 @@ ## 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 @@ -91,6 +96,7 @@ > 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 `` in Atom and the equivalent in RSS. -- cgit v1.2.3 From 1b3dbe0b91d7646096229fb531a3527df3b3587a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 3 Feb 2009 13:51:10 -0500 Subject: not so fast --- doc/todo/comments.mdwn | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'doc/todo') diff --git a/doc/todo/comments.mdwn b/doc/todo/comments.mdwn index 8da640f26..7a113bee3 100644 --- a/doc/todo/comments.mdwn +++ b/doc/todo/comments.mdwn @@ -17,6 +17,15 @@ 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 -- cgit v1.2.3 From 9640681c27c4f4353f56d544bcdd8f9ac7abb98a Mon Sep 17 00:00:00 2001 From: bremner Date: Thu, 5 Feb 2009 08:03:19 -0500 Subject: add "bug report" for sourcecode plugin --- .../discussion.mdwn | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'doc/todo') 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 dc6c0001e..59c1a245b 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 @@ -4,6 +4,19 @@ 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 hit a wall the following example (the last commit in the above repo). + + \[[!meta title="Solutions to assignment 1"]] + + - [[!format cc """ + test + """]] + + ---- #!/usr/bin/perl -- cgit v1.2.3 From 3dd796e6377d20cd3ecd63ee486aa4933fa1baee Mon Sep 17 00:00:00 2001 From: Svend Sorensen Date: Thu, 5 Feb 2009 13:03:32 -0800 Subject: Add wishlist --- doc/todo/RecentChanges_page_links_without_cgi_wrapper.mdwn | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 doc/todo/RecentChanges_page_links_without_cgi_wrapper.mdwn (limited to 'doc/todo') 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..164d12f12 --- /dev/null +++ b/doc/todo/RecentChanges_page_links_without_cgi_wrapper.mdwn @@ -0,0 +1,5 @@ +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]] + +[[!tag wishlist]] -- cgit v1.2.3 From c8ca79a403bbab14fe19b01b8a2526f187a9abc6 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 5 Feb 2009 16:10:30 -0500 Subject: response --- ...ecentChanges_page_links_without_cgi_wrapper.mdwn | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'doc/todo') diff --git a/doc/todo/RecentChanges_page_links_without_cgi_wrapper.mdwn b/doc/todo/RecentChanges_page_links_without_cgi_wrapper.mdwn index 164d12f12..b37109032 100644 --- a/doc/todo/RecentChanges_page_links_without_cgi_wrapper.mdwn +++ b/doc/todo/RecentChanges_page_links_without_cgi_wrapper.mdwn @@ -2,4 +2,25 @@ 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]] -- cgit v1.2.3 From 9ad4065633a7ecab8c9b62edb0d0e3f5cd3813e0 Mon Sep 17 00:00:00 2001 From: "http://www.cse.unsw.edu.au/~willu/" Date: Sat, 7 Feb 2009 05:56:18 -0500 Subject: Ask for more detail with issue --- .../discussion.mdwn | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'doc/todo') 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 59c1a245b..a998afa77 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 @@ -8,6 +8,9 @@ Updated to use fix noted in [[bugs/multiple_pages_with_same_name]]. 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"]] @@ -17,6 +20,9 @@ I hit a wall the following example (the last commit in the above repo). """]] +> 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]] + ---- #!/usr/bin/perl -- cgit v1.2.3 From 3aab99fae5f7681154a35a3e75d8e225424e2d8b Mon Sep 17 00:00:00 2001 From: "http://weakish.int.eu.org/" Date: Sat, 7 Feb 2009 14:19:28 -0500 Subject: --post-commit won't delete pages and --refresh seems no deadlock --- doc/todo/mercurial.mdwn | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'doc/todo') diff --git a/doc/todo/mercurial.mdwn b/doc/todo/mercurial.mdwn index f0dbf9806..c0af10719 100644 --- a/doc/todo/mercurial.mdwn +++ b/doc/todo/mercurial.mdwn @@ -29,6 +29,25 @@ 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. + +I add the following to .hg/hgrc: + + [hooks] + changegroup = hg update >&2 && ikiwiki --setup path.to.setup.file --refresh + post-commit = ikiwiki --setup path.to.setup.file --refresh + +I tried the follwing commands in $SRC: + + touch deadlocktest.mdwn + hg add + hg ci + +No deadlock happens. (Also I push to the $SRC from another machine, again, no deadlock.) + +Of course these tests are too simple. The problem is I have no idea when the deadlock will happen. If someone is kind enough to point out, I will run more test. + + *** I have a few notes on mercurial usage after trying it out for a while: -- cgit v1.2.3 From 2cc6a07f5492912f35d103bcc57753f21ee09ecf Mon Sep 17 00:00:00 2001 From: "http://weakish.int.eu.org/" Date: Sat, 7 Feb 2009 14:22:01 -0500 Subject: (tiny) markdown syntax --- doc/todo/mercurial.mdwn | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'doc/todo') diff --git a/doc/todo/mercurial.mdwn b/doc/todo/mercurial.mdwn index c0af10719..26888131e 100644 --- a/doc/todo/mercurial.mdwn +++ b/doc/todo/mercurial.mdwn @@ -33,15 +33,15 @@ The problem with --post-commit is that if you delete some pages in $SRC, ikiwiki I add the following to .hg/hgrc: - [hooks] - changegroup = hg update >&2 && ikiwiki --setup path.to.setup.file --refresh - post-commit = ikiwiki --setup path.to.setup.file --refresh + [hooks] + changegroup = hg update >&2 && ikiwiki --setup path.to.setup.file --refresh + post-commit = ikiwiki --setup path.to.setup.file --refresh I tried the follwing commands in $SRC: - touch deadlocktest.mdwn - hg add - hg ci + touch deadlocktest.mdwn + hg add + hg ci No deadlock happens. (Also I push to the $SRC from another machine, again, no deadlock.) -- cgit v1.2.3 From dc0409b4a717da9926e618341cbd96ab1c4cb763 Mon Sep 17 00:00:00 2001 From: "http://weakish.int.eu.org/" Date: Sat, 7 Feb 2009 14:49:06 -0500 Subject: I guess changegroup is better than incoming --- doc/todo/mercurial.mdwn | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'doc/todo') diff --git a/doc/todo/mercurial.mdwn b/doc/todo/mercurial.mdwn index 26888131e..9635b6880 100644 --- a/doc/todo/mercurial.mdwn +++ b/doc/todo/mercurial.mdwn @@ -31,7 +31,7 @@ This should update the working directory and run ikiwiki every time a change is 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. -I add the following to .hg/hgrc: +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 @@ -43,7 +43,9 @@ I tried the follwing commands in $SRC: hg add hg ci -No deadlock happens. (Also I push to the $SRC from another machine, again, no deadlock.) +No deadlock happens. (Also I push to the $SRC from another machine, again, no deadlock. If there is conflicts between $SRC and my own repo, hg pull will abort. You have to pull, merge and push again.) + + Of course these tests are too simple. The problem is I have no idea when the deadlock will happen. If someone is kind enough to point out, I will run more test. -- cgit v1.2.3 From 6605764c523787141272fe83c3d46a65aea7649d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 9 Feb 2009 14:58:10 -0500 Subject: Fix unusual --setup --post-commit command line option combo. --- debian/changelog | 1 + doc/todo/mercurial.mdwn | 25 +++++++++++++++++++++++++ ikiwiki.in | 6 ++++-- 3 files changed, 30 insertions(+), 2 deletions(-) (limited to 'doc/todo') diff --git a/debian/changelog b/debian/changelog index c9878c719..d2b701db7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,7 @@ ikiwiki (3.04) UNRELEASED; urgency=low * Work around XML::Atom strangeness that results in double-encoded posts. (smcv) * Updated German translation (Kai Wasserbäch). Closes: #514251 + * Fix unusual --setup --post-commit command line option combo. -- Joey Hess Sat, 31 Jan 2009 19:04:45 -0500 diff --git a/doc/todo/mercurial.mdwn b/doc/todo/mercurial.mdwn index 9635b6880..e45629102 100644 --- a/doc/todo/mercurial.mdwn +++ b/doc/todo/mercurial.mdwn @@ -31,6 +31,13 @@ This should update the working directory and run ikiwiki every time a change is 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. +> 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. +> --[[Joey]] + 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] @@ -49,6 +56,24 @@ No deadlock happens. (Also I push to the $SRC from another machine, again, no d Of course these tests are too simple. The problem is I have no idea when the deadlock will happen. If someone is kind enough to point out, I will run more test. +> 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]] *** diff --git a/ikiwiki.in b/ikiwiki.in index 32a24af84..c79a2bfef 100755 --- a/ikiwiki.in +++ b/ikiwiki.in @@ -135,7 +135,8 @@ sub main () { if (@{$config{wrappers}} && ! $config{render} && ! $config{dumpsetup} && - (! $config{refresh} || $config{genwrappers})) { + ((! $config{refresh} && ! $config{post_commit}) + || $config{genwrappers})) { debug(gettext("generating wrappers..")); require IkiWiki::Wrapper; my %origconfig=(%config); @@ -157,7 +158,8 @@ sub main () { } # setup implies a wiki rebuild by default - if (! $config{refresh} && ! $config{render}) { + if (! $config{refresh} && ! $config{render} && + ! $config{post_commit}) { $config{rebuild}=1; } } -- cgit v1.2.3 From ff5d52b0d2dc025cedadb3b9d06f46e8954d7a38 Mon Sep 17 00:00:00 2001 From: "http://weakish.int.eu.org/" Date: Tue, 10 Feb 2009 04:38:14 -0500 Subject: del wrong hook & ikiwiki --post-commit --a-lot-of-switches --- doc/todo/mercurial.mdwn | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'doc/todo') diff --git a/doc/todo/mercurial.mdwn b/doc/todo/mercurial.mdwn index e45629102..2f844db03 100644 --- a/doc/todo/mercurial.mdwn +++ b/doc/todo/mercurial.mdwn @@ -29,7 +29,7 @@ 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. +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. --[[weakish]] > You should really be using a setup file that has `mercurial_wrapper` > set, and running the wrapper generated by that from your hook. @@ -38,23 +38,23 @@ The problem with --post-commit is that if you delete some pages in $SRC, ikiwiki > alone (which doesn't delete files from $DEST either). Will fix that. > --[[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. +>> --[[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 = ikiwiki --setup path.to.setup.file --refresh - -I tried the follwing commands in $SRC: - - touch deadlocktest.mdwn - hg add - hg ci -No deadlock happens. (Also I push to the $SRC from another machine, again, no deadlock. If there is conflicts between $SRC and my own repo, hg pull will abort. You have to pull, merge and push again.) +

post-commit = ikiwiki --setup path.to.setup.file --refreshThis will cause deadlock! See bleow!

- - -Of course these tests are too simple. The problem is I have no idea when the deadlock will happen. If someone is kind enough to point out, I will run more test. +I have no idea when the deadlock will happen. --[[weakish]] > For the deadlock to occur, a edit has to be made via the web. > @@ -75,6 +75,7 @@ Of course these tests are too simple. The problem is I have no idea when the de > and the ikiwiki CGI handles the wiki refresh. > --[[Joey]] + *** I have a few notes on mercurial usage after trying it out for a while: -- cgit v1.2.3 From 4004959dc21939cd6acbf21d317a201190bc15ed Mon Sep 17 00:00:00 2001 From: "http://weakish.int.eu.org/" Date: Tue, 10 Feb 2009 04:40:37 -0500 Subject: add a email. --- doc/todo/weakish.mdwn | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/todo/weakish.mdwn (limited to 'doc/todo') diff --git a/doc/todo/weakish.mdwn b/doc/todo/weakish.mdwn new file mode 100644 index 000000000..ccd5665ad --- /dev/null +++ b/doc/todo/weakish.mdwn @@ -0,0 +1 @@ +email: weakish@gmail.com -- cgit v1.2.3 From b96bab0449d6f326a7e847fba3488100ad84bead Mon Sep 17 00:00:00 2001 From: "http://weakish.int.eu.org/" Date: Tue, 10 Feb 2009 04:42:02 -0500 Subject: rename todo/weakish.mdwn to users/weakish.mdwn --- doc/todo/weakish.mdwn | 1 - doc/users/weakish.mdwn | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 doc/todo/weakish.mdwn create mode 100644 doc/users/weakish.mdwn (limited to 'doc/todo') diff --git a/doc/todo/weakish.mdwn b/doc/todo/weakish.mdwn deleted file mode 100644 index ccd5665ad..000000000 --- a/doc/todo/weakish.mdwn +++ /dev/null @@ -1 +0,0 @@ -email: weakish@gmail.com diff --git a/doc/users/weakish.mdwn b/doc/users/weakish.mdwn new file mode 100644 index 000000000..ccd5665ad --- /dev/null +++ b/doc/users/weakish.mdwn @@ -0,0 +1 @@ +email: weakish@gmail.com -- cgit v1.2.3 From 12a72e758382c8efb9cdd6c66e06d9de094a4b29 Mon Sep 17 00:00:00 2001 From: "http://weakish.int.eu.org/" Date: Tue, 10 Feb 2009 04:42:03 -0500 Subject: update for rename of todo/weakish.mdwn to users/weakish.mdwn --- doc/todo/mercurial.mdwn | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'doc/todo') diff --git a/doc/todo/mercurial.mdwn b/doc/todo/mercurial.mdwn index 2f844db03..89f5337ab 100644 --- a/doc/todo/mercurial.mdwn +++ b/doc/todo/mercurial.mdwn @@ -29,7 +29,7 @@ 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. --[[weakish]] +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. @@ -45,7 +45,7 @@ The problem with --post-commit is that if you delete some pages in $SRC, ikiwiki >> (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. ->> --[[weakish]] +>> --[[users/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.) @@ -54,7 +54,7 @@ I add the following to .hg/hgrc:(I use changegroup since I don't think we need r

post-commit = ikiwiki --setup path.to.setup.file --refreshThis will cause deadlock! See bleow!

-I have no idea when the deadlock will happen. --[[weakish]] +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. > -- cgit v1.2.3 From 1998b3c2d666461985131e6d24212035daee88eb Mon Sep 17 00:00:00 2001 From: "http://weakish.int.eu.org/" Date: Wed, 11 Feb 2009 05:14:06 -0500 Subject: redirect automatically after rename --- doc/todo/redirect_automatically_after_rename.mdwn | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 doc/todo/redirect_automatically_after_rename.mdwn (limited to 'doc/todo') diff --git a/doc/todo/redirect_automatically_after_rename.mdwn b/doc/todo/redirect_automatically_after_rename.mdwn new file mode 100644 index 000000000..6a6d4f05f --- /dev/null +++ b/doc/todo/redirect_automatically_after_rename.mdwn @@ -0,0 +1,10 @@ +In some wikis, (e.g. Mediawiki) after [[renaming|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 [[meta]] plugin is enabled, users can manually edit the +page, and put in '\[[!meta redir=newpage]]', but this is +not very convenient. + + -- cgit v1.2.3 From 011a45229a52bd63426a0d2d056bfec874a81a2a Mon Sep 17 00:00:00 2001 From: "http://weakish.int.eu.org/" Date: Wed, 11 Feb 2009 05:15:33 -0500 Subject: fix broken links --- doc/todo/redirect_automatically_after_rename.mdwn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'doc/todo') diff --git a/doc/todo/redirect_automatically_after_rename.mdwn b/doc/todo/redirect_automatically_after_rename.mdwn index 6a6d4f05f..1cbb824d2 100644 --- a/doc/todo/redirect_automatically_after_rename.mdwn +++ b/doc/todo/redirect_automatically_after_rename.mdwn @@ -1,9 +1,9 @@ -In some wikis, (e.g. Mediawiki) after [[renaming|rename]] +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 [[meta]] plugin is enabled, users can manually edit the +If [[plugins/meta]] plugin is enabled, users can manually edit the page, and put in '\[[!meta redir=newpage]]', but this is not very convenient. -- cgit v1.2.3 From c0405e0f20e49c382b656bf9c83c4dd1aa0fc187 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 12 Feb 2009 13:18:54 -0500 Subject: response --- doc/todo/mercurial.mdwn | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'doc/todo') diff --git a/doc/todo/mercurial.mdwn b/doc/todo/mercurial.mdwn index 89f5337ab..414aaa807 100644 --- a/doc/todo/mercurial.mdwn +++ b/doc/todo/mercurial.mdwn @@ -36,6 +36,7 @@ The problem with --post-commit is that if you delete some pages in $SRC, ikiwiki > 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 @@ -47,6 +48,10 @@ The problem with --post-commit is that if you delete some pages in $SRC, ikiwiki >> 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 +>>> `mercurual_wrapper => ".hg/ikiwiki-hook",` and then modifying the hgrc +>>> to run that wrapper. --[[Joey]] + 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] -- cgit v1.2.3 From 442f3ab0aba88b61abecf23c6f9539ea494e9537 Mon Sep 17 00:00:00 2001 From: bremner Date: Thu, 12 Feb 2009 20:51:38 -0500 Subject: strange output from sourcecode plugin --- .../discussion.mdwn | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'doc/todo') 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 a998afa77..8953a055e 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 @@ -22,6 +22,18 @@ I hit a wall the following example (the last commit in the above repo). > 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]] + +
+

    +
  • +
+ 2beb4fd7289998159f61976143f66bb6

+ +

+ + ---- -- cgit v1.2.3 From 257cbbcb7e151053641bde409253a1ea792e9569 Mon Sep 17 00:00:00 2001 From: "http://weakish.int.eu.org/" Date: Fri, 13 Feb 2009 05:05:09 -0500 Subject: The wrapper works nicely! --- doc/todo/mercurial.mdwn | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'doc/todo') diff --git a/doc/todo/mercurial.mdwn b/doc/todo/mercurial.mdwn index 414aaa807..2f148498e 100644 --- a/doc/todo/mercurial.mdwn +++ b/doc/todo/mercurial.mdwn @@ -49,15 +49,19 @@ The problem with --post-commit is that if you delete some pages in $SRC, ikiwiki >> --[[users/weakish]] >>> I don't see anything preventing you from using a setup file with ->>> `mercurual_wrapper => ".hg/ikiwiki-hook",` and then modifying the hgrc +>>> `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 -

post-commit = ikiwiki --setup path.to.setup.file --refreshThis will cause deadlock! See bleow!

+----- I have no idea when the deadlock will happen. --[[users/weakish]] -- cgit v1.2.3 From 7599de6e436fd141a8027ad65d5a2b0b03ea6f98 Mon Sep 17 00:00:00 2001 From: "http://www.cse.unsw.edu.au/~willu/" Date: Fri, 13 Feb 2009 06:16:18 -0500 Subject: Add a new bug to track simple patch --- doc/todo/Allow_filenames_that_are_all_type.mdwn | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 doc/todo/Allow_filenames_that_are_all_type.mdwn (limited to 'doc/todo') 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..55e29b645 --- /dev/null +++ b/doc/todo/Allow_filenames_that_are_all_type.mdwn @@ -0,0 +1,20 @@ +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]] + + 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; + } -- cgit v1.2.3 From 8b4f45e1e09b85cc4eb987ed96f9b3707cd49f15 Mon Sep 17 00:00:00 2001 From: "http://www.cse.unsw.edu.au/~willu/" Date: Fri, 13 Feb 2009 06:49:22 -0500 Subject: Update patch and reply to bug report. --- .../discussion.mdwn | 246 +++++++++++---------- 1 file changed, 135 insertions(+), 111 deletions(-) (limited to 'doc/todo') 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 8953a055e..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 @@ -35,10 +35,32 @@ I hit a wall the following example (the last commit in the above repo). +>>> 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: + +
+
    +
  • +
+ +
00001: test
+ +

+ + + +>>> 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; @@ -49,142 +71,144 @@ I hit a wall the following example (the last commit in the above repo). 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); + 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, - }, + 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 () { - 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, keepextension => 1); - } else { - error("Your installation of source-highlight cannot handle sourcecode language $lang!"); - } - } + 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 () { + 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 %params=@_; + + my $page = $params{page}; - my $page = $params{page}; + eval q{use FileHandle}; + error($@) if $@; + eval q{use IPC::Open2}; + error($@) if $@; - eval q{use FileHandle}; - error($@) if $@; - eval q{use IPC::Open2}; - error($@) if $@; + local(*SPS_IN, *SPS_OUT); # Create local handles - local(*SPS_IN, *SPS_OUT); # Create local handles + my @args; - my @args; + if ($config{sourcecode_linenumbers}) { + push @args, '--line-number'; + } - 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); - 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; - error("Unable to open $config{sourcecode_command}") unless $pid; + print SPS_OUT $params{content}; + close SPS_OUT; - print SPS_OUT $params{content}; - close SPS_OUT; + my @html = ; + close SPS_IN; - my @html = ; - close SPS_IN; - - waitpid $pid, 0; + waitpid $pid, 0; - my $stylesheet=bestlink($page, $config{sourcecode_css}.".css"); - if (length $stylesheet) { - push @{$metaheaders{$page}}, ''; - } + my $stylesheet=bestlink($page, $config{sourcecode_css}.".css"); + if (length $stylesheet) { + push @{$metaheaders{$page}}, ''; + } - return '
'."\r\n".join("\r\n",@html)."\r\n
\n"; + return '
'."\r\n".join("",@html)."\r\n
\r\n"; } sub pagetemplate (@) { - my %params=@_; + my %params=@_; - my $page=$params{page}; - my $template=$params{template}; + 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}})); - } + 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 -- cgit v1.2.3 From e159545ba720ab0ed37f5e71c7fd04e9befcbfc0 Mon Sep 17 00:00:00 2001 From: bremner Date: Sat, 14 Feb 2009 08:36:28 -0500 Subject: Throw another source highlighting option into the ring --- doc/todo/syntax_highlighting.mdwn | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'doc/todo') diff --git a/doc/todo/syntax_highlighting.mdwn b/doc/todo/syntax_highlighting.mdwn index d9a791c6f..ca701e0d0 100644 --- a/doc/todo/syntax_highlighting.mdwn +++ b/doc/todo/syntax_highlighting.mdwn @@ -26,6 +26,11 @@ pages, as well as doing syntax highlighting as a preprocessor directive * [[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=795f888a2c1b17f6d90a8f01f74b09395f0738d5) 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 -- cgit v1.2.3 From 02b1929445c20ddc838c3b9a2a61db912beef676 Mon Sep 17 00:00:00 2001 From: bremner Date: Sat, 14 Feb 2009 08:39:01 -0500 Subject: link to HEAD instead of today's sha1 of hlsimple.pm --- doc/todo/syntax_highlighting.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/todo') diff --git a/doc/todo/syntax_highlighting.mdwn b/doc/todo/syntax_highlighting.mdwn index ca701e0d0..b5d083ba5 100644 --- a/doc/todo/syntax_highlighting.mdwn +++ b/doc/todo/syntax_highlighting.mdwn @@ -26,7 +26,7 @@ pages, as well as doing syntax highlighting as a preprocessor directive * [[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=795f888a2c1b17f6d90a8f01f74b09395f0738d5) 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). +* [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]] -- cgit v1.2.3 From 87210fc19e79c766976dabcd5ce6824d7fc2a5ef Mon Sep 17 00:00:00 2001 From: Jon Dowland Date: Mon, 16 Feb 2009 11:31:46 +0000 Subject: fix link to h1title plugin --- doc/todo/Option_to_make_title_an_h1__63__.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/todo') 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 8676bec48..f4023d6dd 100644 --- a/doc/todo/Option_to_make_title_an_h1__63__.mdwn +++ b/doc/todo/Option_to_make_title_an_h1__63__.mdwn @@ -11,4 +11,4 @@ Currently, the page title (either the name of the page or the title specified wi > 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/h1title.pm + [h1title]: http://code.jblevins.org/ikiwiki/plugins.git/plain/h1title.pm -- cgit v1.2.3 From 1611abd99a35a4ffcc6a0e779845733578406b2a Mon Sep 17 00:00:00 2001 From: rafael2k Date: Mon, 16 Feb 2009 08:46:57 -0500 Subject: --- doc/todo/latex.mdwn | 3 +++ 1 file changed, 3 insertions(+) (limited to 'doc/todo') 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: http://satangoss.sarava.org/ikiwiki/latex.pm. + + ---- Okay, now is the time for a mid term report i think. -- cgit v1.2.3 From 64000366bde6dbd3a329e4665b0712ceac0993ac Mon Sep 17 00:00:00 2001 From: Jon Dowland Date: Tue, 17 Feb 2009 15:44:48 +0000 Subject: patch to add tag() pagespec --- doc/todo/tag_pagespec_function.mdwn | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 doc/todo/tag_pagespec_function.mdwn (limited to 'doc/todo') diff --git a/doc/todo/tag_pagespec_function.mdwn b/doc/todo/tag_pagespec_function.mdwn new file mode 100644 index 000000000..0a51c7220 --- /dev/null +++ b/doc/todo/tag_pagespec_function.mdwn @@ -0,0 +1,27 @@ +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 + +[[!tag patch]] + + --- 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 -- cgit v1.2.3 From bb8b8787ef9477c027b9e5d8b7b5e1addfd1ca32 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 17 Feb 2009 13:25:06 -0500 Subject: comments --- IkiWiki/Plugin/template.pm | 3 ++- debian/changelog | 4 ++++ doc/bugs/cannot_reliably_use_meta_in_template.mdwn | 2 ++ doc/bugs/tags__44___backlinks_and_3.x.mdwn | 2 ++ doc/todo/tag_pagespec_function.mdwn | 7 +++++++ 5 files changed, 17 insertions(+), 1 deletion(-) (limited to 'doc/todo') diff --git a/IkiWiki/Plugin/template.pm b/IkiWiki/Plugin/template.pm index 57bff20ff..b872f0962 100644 --- a/IkiWiki/Plugin/template.pm +++ b/IkiWiki/Plugin/template.pm @@ -10,7 +10,8 @@ use Encode; sub import { hook(type => "getsetup", id => "template", call => \&getsetup); - hook(type => "preprocess", id => "template", call => \&preprocess); + hook(type => "preprocess", id => "template", call => \&preprocess, + scan => 1); } sub getsetup () { diff --git a/debian/changelog b/debian/changelog index 62374d2dc..c28d36c84 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,10 @@ ikiwiki (3.05) UNRELEASED; urgency=low * debhelper v7.2; rules file minimisation. + * template: Load templates in scan mode. + This is potentially expensive, but is necessary so that meta and tag + directives, and other links on templates affect the page using the + template reliably. -- Joey Hess Sun, 15 Feb 2009 20:11:57 -0500 diff --git a/doc/bugs/cannot_reliably_use_meta_in_template.mdwn b/doc/bugs/cannot_reliably_use_meta_in_template.mdwn index 48288a2b3..de6c227f6 100644 --- a/doc/bugs/cannot_reliably_use_meta_in_template.mdwn +++ b/doc/bugs/cannot_reliably_use_meta_in_template.mdwn @@ -14,3 +14,5 @@ scan pass, every page containing a template will cause the template to be loaded and filled out. This can be some serious additional overhead. --[[Joey]] + +[[done]] diff --git a/doc/bugs/tags__44___backlinks_and_3.x.mdwn b/doc/bugs/tags__44___backlinks_and_3.x.mdwn index ea0eecc80..4fe9a4723 100644 --- a/doc/bugs/tags__44___backlinks_and_3.x.mdwn +++ b/doc/bugs/tags__44___backlinks_and_3.x.mdwn @@ -30,3 +30,5 @@ time, so went ahead and migrated live, spamming planet debian in the process > [[cannot_reliably_use_meta_in_template]]. AFAIK, this has never worked > reliably, although the linked page has a simple, though potentially > expensive fix. --[[Joey]] + +> fix made, [[done]] --[[Joey]] diff --git a/doc/todo/tag_pagespec_function.mdwn b/doc/todo/tag_pagespec_function.mdwn index 0a51c7220..060368179 100644 --- a/doc/todo/tag_pagespec_function.mdwn +++ b/doc/todo/tag_pagespec_function.mdwn @@ -8,6 +8,13 @@ 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]] --- a/plugins/IkiWiki/Plugin/tag.pm 2009-02-16 11:30:11.000000000 +0000 -- cgit v1.2.3 From a4497591f958f3d2fb28ef597c7870bfc4db72e3 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 17 Feb 2009 13:29:08 -0500 Subject: Revert "comments" (stupid commit) This reverts commit bb8b8787ef9477c027b9e5d8b7b5e1addfd1ca32. --- IkiWiki/Plugin/template.pm | 3 +-- debian/changelog | 4 ---- doc/bugs/cannot_reliably_use_meta_in_template.mdwn | 2 -- doc/bugs/tags__44___backlinks_and_3.x.mdwn | 2 -- doc/todo/tag_pagespec_function.mdwn | 7 ------- 5 files changed, 1 insertion(+), 17 deletions(-) (limited to 'doc/todo') diff --git a/IkiWiki/Plugin/template.pm b/IkiWiki/Plugin/template.pm index b872f0962..57bff20ff 100644 --- a/IkiWiki/Plugin/template.pm +++ b/IkiWiki/Plugin/template.pm @@ -10,8 +10,7 @@ use Encode; sub import { hook(type => "getsetup", id => "template", call => \&getsetup); - hook(type => "preprocess", id => "template", call => \&preprocess, - scan => 1); + hook(type => "preprocess", id => "template", call => \&preprocess); } sub getsetup () { diff --git a/debian/changelog b/debian/changelog index c28d36c84..62374d2dc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,6 @@ ikiwiki (3.05) UNRELEASED; urgency=low * debhelper v7.2; rules file minimisation. - * template: Load templates in scan mode. - This is potentially expensive, but is necessary so that meta and tag - directives, and other links on templates affect the page using the - template reliably. -- Joey Hess Sun, 15 Feb 2009 20:11:57 -0500 diff --git a/doc/bugs/cannot_reliably_use_meta_in_template.mdwn b/doc/bugs/cannot_reliably_use_meta_in_template.mdwn index de6c227f6..48288a2b3 100644 --- a/doc/bugs/cannot_reliably_use_meta_in_template.mdwn +++ b/doc/bugs/cannot_reliably_use_meta_in_template.mdwn @@ -14,5 +14,3 @@ scan pass, every page containing a template will cause the template to be loaded and filled out. This can be some serious additional overhead. --[[Joey]] - -[[done]] diff --git a/doc/bugs/tags__44___backlinks_and_3.x.mdwn b/doc/bugs/tags__44___backlinks_and_3.x.mdwn index 4fe9a4723..ea0eecc80 100644 --- a/doc/bugs/tags__44___backlinks_and_3.x.mdwn +++ b/doc/bugs/tags__44___backlinks_and_3.x.mdwn @@ -30,5 +30,3 @@ time, so went ahead and migrated live, spamming planet debian in the process > [[cannot_reliably_use_meta_in_template]]. AFAIK, this has never worked > reliably, although the linked page has a simple, though potentially > expensive fix. --[[Joey]] - -> fix made, [[done]] --[[Joey]] diff --git a/doc/todo/tag_pagespec_function.mdwn b/doc/todo/tag_pagespec_function.mdwn index 060368179..0a51c7220 100644 --- a/doc/todo/tag_pagespec_function.mdwn +++ b/doc/todo/tag_pagespec_function.mdwn @@ -8,13 +8,6 @@ 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]] --- a/plugins/IkiWiki/Plugin/tag.pm 2009-02-16 11:30:11.000000000 +0000 -- cgit v1.2.3 From 84b48681c630c1c2dab21ad6c260be3a5b5fff0e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 17 Feb 2009 13:29:37 -0500 Subject: re-add actual comments --- doc/todo/tag_pagespec_function.mdwn | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'doc/todo') diff --git a/doc/todo/tag_pagespec_function.mdwn b/doc/todo/tag_pagespec_function.mdwn index 0a51c7220..060368179 100644 --- a/doc/todo/tag_pagespec_function.mdwn +++ b/doc/todo/tag_pagespec_function.mdwn @@ -8,6 +8,13 @@ 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]] --- a/plugins/IkiWiki/Plugin/tag.pm 2009-02-16 11:30:11.000000000 +0000 -- cgit v1.2.3 From 2d220da53c6ebcaf962045fdf5db947074cc0e7c Mon Sep 17 00:00:00 2001 From: "http://arpitjain11.myopenid.com/" Date: Tue, 17 Feb 2009 18:47:47 -0500 Subject: --- doc/todo/Gallery.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/todo') diff --git a/doc/todo/Gallery.mdwn b/doc/todo/Gallery.mdwn index fbf1802fd..89676c457 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 --[[arpitjain]] -- cgit v1.2.3 From d522dfadd1ff0041c62a46460e1524eb0db89cb6 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 17 Feb 2009 22:37:20 -0500 Subject: is this patch complete? --- doc/todo/Allow_filenames_that_are_all_type.mdwn | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'doc/todo') diff --git a/doc/todo/Allow_filenames_that_are_all_type.mdwn b/doc/todo/Allow_filenames_that_are_all_type.mdwn index 55e29b645..b8b136aeb 100644 --- a/doc/todo/Allow_filenames_that_are_all_type.mdwn +++ b/doc/todo/Allow_filenames_that_are_all_type.mdwn @@ -5,6 +5,10 @@ if the plugin can process files of type `.Makefile` then it will also process `M 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]] + diff --git a/IkiWiki.pm b/IkiWiki.pm index 8d728c9..1bd46a9 100644 --- a/IkiWiki.pm -- cgit v1.2.3 From c1b051600036291f20bc179d7149410379832e37 Mon Sep 17 00:00:00 2001 From: "http://www.cse.unsw.edu.au/~willu/" Date: Thu, 19 Feb 2009 06:45:40 -0500 Subject: Yes, the patch is complete. --- doc/todo/Allow_filenames_that_are_all_type.mdwn | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'doc/todo') diff --git a/doc/todo/Allow_filenames_that_are_all_type.mdwn b/doc/todo/Allow_filenames_that_are_all_type.mdwn index b8b136aeb..e165da7dc 100644 --- a/doc/todo/Allow_filenames_that_are_all_type.mdwn +++ b/doc/todo/Allow_filenames_that_are_all_type.mdwn @@ -9,6 +9,19 @@ lost because it didn't have its own bug to track it. Now it does :). -- [[Will > 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]] + diff --git a/IkiWiki.pm b/IkiWiki.pm index 8d728c9..1bd46a9 100644 --- a/IkiWiki.pm -- cgit v1.2.3 From 66dc253437e7ce2e3e8984513b3ecf96603d6670 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 19 Feb 2009 18:38:45 -0500 Subject: Add noextension parameter to htmlize hooks to support, eg, Makefile. --- IkiWiki.pm | 23 ++++++++++++++--------- debian/changelog | 1 + doc/plugins/write.mdwn | 7 ++++++- doc/todo/Allow_filenames_that_are_all_type.mdwn | 4 ++++ t/pagename.t | 23 ++++++++++++++++++----- t/pagetype.t | 15 --------------- 6 files changed, 43 insertions(+), 30 deletions(-) delete mode 100755 t/pagetype.t (limited to 'doc/todo') diff --git a/IkiWiki.pm b/IkiWiki.pm index ce1ceb351..f580d1f0d 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -627,27 +627,32 @@ sub dirname ($) { return $file; } -sub pagetype ($) { +sub isinternal ($) { my $page=shift; + return exists $pagesources{$page} && + $pagesources{$page} =~ /\._([^.]+)$/; +} + +sub pagetype ($) { + my $file=shift; - if ($page =~ /\.([^.]+)$/) { + if ($file =~ /\.([^.]+)$/) { return $1 if exists $hooks{htmlize}{$1}; } + elsif ($hooks{htmlize}{basename($file)}{noextension}) { + return basename($file); + } return; } -sub isinternal ($) { - my $page=shift; - return exists $pagesources{$page} && - $pagesources{$page} =~ /\._([^.]+)$/; -} - sub pagename ($) { my $file=shift; my $type=pagetype($file); my $page=$file; - $page=~s/\Q.$type\E*$// if defined $type && !$hooks{htmlize}{$type}{keepextension}; + $page=~s/\Q.$type\E*$// + if defined $type && !$hooks{htmlize}{$type}{keepextension} + && !$hooks{htmlize}{$type}{noextension}; if ($config{indexpages} && $page=~/(.*)\/index$/) { $page=$1; } diff --git a/debian/changelog b/debian/changelog index b644ac99c..810c59f4e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,7 @@ ikiwiki (3.05) UNRELEASED; urgency=low directives, and other links on templates affect the page using the template reliably. * goto: Fix redirect to comments. + * Add noextension parameter to htmlize hooks to support, eg, Makefile. -- Joey Hess Sun, 15 Feb 2009 20:11:57 -0500 diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 2e907938f..696bc6bc3 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -189,9 +189,14 @@ The function is passed named parameters: "page" and "content" and should return the htmlized content. If `hook` is passed an optional "keepextension" parameter, set to a true -value, then this extension will not be stripped from the source filename when +value, then the extension will not be stripped from the source filename when generating the page. +If `hook` is passed an optional "noextension" parameter, set to a true +value, then the id parameter specifies not a filename extension, but +a whole filename that can be htmlized. This is useful for files +like `Makefile` that have no extension. + ### pagetemplate hook(type => "pagetemplate", id => "foo", call => \&pagetemplate); diff --git a/doc/todo/Allow_filenames_that_are_all_type.mdwn b/doc/todo/Allow_filenames_that_are_all_type.mdwn index e165da7dc..bebbcafa8 100644 --- a/doc/todo/Allow_filenames_that_are_all_type.mdwn +++ b/doc/todo/Allow_filenames_that_are_all_type.mdwn @@ -22,6 +22,10 @@ lost because it didn't have its own bug to track it. Now it does :). -- [[Will >> >> 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 diff --git a/t/pagename.t b/t/pagename.t index 488e341fa..540d10f4c 100755 --- a/t/pagename.t +++ b/t/pagename.t @@ -1,22 +1,35 @@ #!/usr/bin/perl use warnings; use strict; -use Test::More tests => 8; +use Test::More tests => 19; BEGIN { use_ok("IkiWiki"); } -# Used internally. +# define mdwn as an extension $IkiWiki::hooks{htmlize}{mdwn}={}; -$IkiWiki::hooks{htmlize}{txt}={keepextension => 1}; - +is(pagetype("foo.mdwn"), "mdwn"); is(pagename("foo.mdwn"), "foo"); +is(pagetype("foo/bar.mdwn"), "mdwn"); is(pagename("foo/bar.mdwn"), "foo/bar"); -# bare files get the full filename as page name +# bare files get the full filename as page name, undef type +is(pagetype("foo.png"), undef); is(pagename("foo.png"), "foo.png"); +is(pagetype("foo/bar.png"), undef); is(pagename("foo/bar.png"), "foo/bar.png"); +is(pagetype("foo"), undef); is(pagename("foo"), "foo"); # keepextension preserves the extension in the page name +$IkiWiki::hooks{htmlize}{txt}={keepextension => 1}; is(pagename("foo.txt"), "foo.txt"); +is(pagetype("foo.txt"), "txt"); is(pagename("foo/bar.txt"), "foo/bar.txt"); +is(pagetype("foo/bar.txt"), "txt"); + +# noextension makes extensionless files be treated as first-class pages +$IkiWiki::hooks{htmlize}{Makefile}={noextension =>1}; +is(pagetype("Makefile"), "Makefile"); +is(pagename("Makefile"), "Makefile"); +is(pagetype("foo/Makefile"), "Makefile"); +is(pagename("foo/Makefile"), "foo/Makefile"); diff --git a/t/pagetype.t b/t/pagetype.t deleted file mode 100755 index bb06a1568..000000000 --- a/t/pagetype.t +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/perl -use warnings; -use strict; -use Test::More tests => 6; - -BEGIN { use_ok("IkiWiki"); } - -# Used internally. -$IkiWiki::hooks{htmlize}{mdwn}={}; - -is(pagetype("foo.mdwn"), "mdwn"); -is(pagetype("foo/bar.mdwn"), "mdwn"); -is(pagetype("foo.png"), undef); -is(pagetype("foo/bar.png"), undef); -is(pagetype("foo"), undef); -- cgit v1.2.3 From f813b10fef13682c95ada9c9a9ccf05ff602c172 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 19 Feb 2009 18:54:25 -0500 Subject: rename tag() to tagged(); add docs --- IkiWiki/Plugin/tag.pm | 2 +- debian/changelog | 1 + doc/ikiwiki/pagespec.mdwn | 3 ++- doc/plugins/tag.mdwn | 3 +++ doc/todo/tag_pagespec_function.mdwn | 2 +- 5 files changed, 8 insertions(+), 3 deletions(-) (limited to 'doc/todo') diff --git a/IkiWiki/Plugin/tag.pm b/IkiWiki/Plugin/tag.pm index 48c197748..8fe9c6828 100644 --- a/IkiWiki/Plugin/tag.pm +++ b/IkiWiki/Plugin/tag.pm @@ -127,7 +127,7 @@ sub pagetemplate (@) { package IkiWiki::PageSpec; -sub match_tag ($$;@) { +sub match_tagged ($$;@) { my $page = shift; my $glob = shift; return match_link($page, IkiWiki::Plugin::tag::tagpage($glob)); diff --git a/debian/changelog b/debian/changelog index 810c59f4e..80b3c5d8e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,6 +7,7 @@ ikiwiki (3.05) UNRELEASED; urgency=low template reliably. * goto: Fix redirect to comments. * Add noextension parameter to htmlize hooks to support, eg, Makefile. + * Add tagged() PageSpec. -- Joey Hess Sun, 15 Feb 2009 20:11:57 -0500 diff --git a/doc/ikiwiki/pagespec.mdwn b/doc/ikiwiki/pagespec.mdwn index 86abe5745..b476bde1f 100644 --- a/doc/ikiwiki/pagespec.mdwn +++ b/doc/ikiwiki/pagespec.mdwn @@ -25,6 +25,7 @@ match all pages except for Discussion pages and the SandBox: Some more elaborate limits can be added to what matches using these functions: * "`link(page)`" - match only pages that link to a given page (or glob) +* "`tagged(tag)`" - match pages that are tagged or link to the given tag (or glob) * "`backlink(page)`" - match only pages that a given page links to * "`creation_month(month)`" - match only pages created on the given month * "`creation_day(mday)`" - or day of the month @@ -65,7 +66,7 @@ More complex expressions can also be created, by using parentheses for grouping. For example, to match pages in a blog that are tagged with either of two tags, use: - blog/* and (link(tag/foo) or link(tag/bar)) + blog/* and (tagged(foo) or tagged(bar)) Note that page names in PageSpecs are matched against the absolute filenames of the pages in the wiki, so a pagespec "foo" used on page diff --git a/doc/plugins/tag.mdwn b/doc/plugins/tag.mdwn index 17bb086a1..8ff70a069 100644 --- a/doc/plugins/tag.mdwn +++ b/doc/plugins/tag.mdwn @@ -5,6 +5,9 @@ This plugin provides the [[ikiwiki/directive/tag]] and [[ikiwiki/directive/taglink]] [[directives|ikiwiki/directive]]. These directives allow tagging pages. +It also provides the `tagged()` [[ikiwiki/PageSpec]], which can be used to +match pages that are tagged with a specific tag. + [[!if test="enabled(tag)" then=""" This wiki has the tag plugin enabled, so you'll see a note below that this page is tagged with the "tags" tag. diff --git a/doc/todo/tag_pagespec_function.mdwn b/doc/todo/tag_pagespec_function.mdwn index 060368179..681a1f661 100644 --- a/doc/todo/tag_pagespec_function.mdwn +++ b/doc/todo/tag_pagespec_function.mdwn @@ -15,7 +15,7 @@ match tagged pages independent of whatever the tagbase is set to. > > One other thing, perhaps it should be called `tagged()`? --[[Joey]] -[[!tag patch]] +[[!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 -- cgit v1.2.3 From 65c6bc687ee76cdb1cf5810fbaa51a1d5b91beb9 Mon Sep 17 00:00:00 2001 From: "http://taozhyn.myopenid.com/" Date: Fri, 20 Feb 2009 04:58:52 -0500 Subject: Adding patch, moved from plugins/tag/discussion --- ...o-create_tag_pages_according_to_a_template.mdwn | 99 ++++++++++++++++++++++ 1 file changed, 99 insertions(+) (limited to 'doc/todo') 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: and "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()" 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 -- cgit v1.2.3 From 1e9629b8f63e182a32459ae0d901a61f007ea769 Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Fri, 20 Feb 2009 10:25:47 -0500 Subject: Link my version --- doc/todo/Gallery.mdwn | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'doc/todo') diff --git a/doc/todo/Gallery.mdwn b/doc/todo/Gallery.mdwn index 89676c457..bc1d5bea4 100644 --- a/doc/todo/Gallery.mdwn +++ b/doc/todo/Gallery.mdwn @@ -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]] -- cgit v1.2.3 From c2df40c01ba78e0c0631df0a5042980eb1688488 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 26 Feb 2009 14:16:13 -0500 Subject: mercurial and tla are missing implementations of several things --- doc/todo/mercurial.mdwn | 4 ++++ doc/todo/tla.mdwn | 3 +++ 2 files changed, 7 insertions(+) (limited to 'doc/todo') diff --git a/doc/todo/mercurial.mdwn b/doc/todo/mercurial.mdwn index 2f148498e..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 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]] -- cgit v1.2.3 From 2695d224906d972dd21e063f666ff4007ef1b62e Mon Sep 17 00:00:00 2001 From: "http://zwol.livejournal.com/" Date: Fri, 27 Feb 2009 18:56:25 -0500 Subject: --- doc/todo/Allow_disabling_edit_and_preferences_links.mdwn | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'doc/todo') diff --git a/doc/todo/Allow_disabling_edit_and_preferences_links.mdwn b/doc/todo/Allow_disabling_edit_and_preferences_links.mdwn index 1188d1ab2..4c2823cf2 100644 --- a/doc/todo/Allow_disabling_edit_and_preferences_links.mdwn +++ b/doc/todo/Allow_disabling_edit_and_preferences_links.mdwn @@ -46,3 +46,7 @@ Patch: >> 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. --[Zack](http://zwol.livejournal.com/) -- cgit v1.2.3 From 0bd54afd98e57bfcca4360a0751a362e39d3e02a Mon Sep 17 00:00:00 2001 From: "http://zwol.livejournal.com/" Date: Fri, 27 Feb 2009 18:57:48 -0500 Subject: --- doc/todo/Allow_disabling_edit_and_preferences_links.mdwn | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'doc/todo') diff --git a/doc/todo/Allow_disabling_edit_and_preferences_links.mdwn b/doc/todo/Allow_disabling_edit_and_preferences_links.mdwn index 4c2823cf2..a356c69df 100644 --- a/doc/todo/Allow_disabling_edit_and_preferences_links.mdwn +++ b/doc/todo/Allow_disabling_edit_and_preferences_links.mdwn @@ -49,4 +49,6 @@ Patch: >>> 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. --[Zack](http://zwol.livejournal.com/) +>>> 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/) -- cgit v1.2.3 From 2fde5b4a6a7df1c1e0fa5231f2cc60bef5a74c08 Mon Sep 17 00:00:00 2001 From: "http://liw.fi/" Date: Wed, 4 Mar 2009 10:19:09 -0500 Subject: --- doc/todo/mdwn_preview.mdwn | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 doc/todo/mdwn_preview.mdwn (limited to 'doc/todo') diff --git a/doc/todo/mdwn_preview.mdwn b/doc/todo/mdwn_preview.mdwn new file mode 100644 index 000000000..733d62c08 --- /dev/null +++ b/doc/todo/mdwn_preview.mdwn @@ -0,0 +1,7 @@ +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. + +[[!tag wishlist]] -- cgit v1.2.3 From 6a19dacbd7ea36a609717bf71f389e183729b7af Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 4 Mar 2009 13:53:34 -0500 Subject: that's wikiwyg close as dup todo --- doc/todo/mdwn_preview.mdwn | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'doc/todo') diff --git a/doc/todo/mdwn_preview.mdwn b/doc/todo/mdwn_preview.mdwn index 733d62c08..a447299bc 100644 --- a/doc/todo/mdwn_preview.mdwn +++ b/doc/todo/mdwn_preview.mdwn @@ -4,4 +4,7 @@ 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. -[[!tag wishlist]] +> See [[wikiwyg]]. Note that I do not have a copy of the code for that, or +> it'd be in ikiwiki already. --[[Joey]] + +[[!tag wishlist done]] -- cgit v1.2.3 From b7495e752af87a15978ec4ae5427bfea62c6f43a Mon Sep 17 00:00:00 2001 From: "http://www.cse.unsw.edu.au/~willu/" Date: Wed, 4 Mar 2009 17:30:11 -0500 Subject: Notes that the wikiwyg plugin link is broken, and more. --- doc/todo/mdwn_preview.mdwn | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'doc/todo') diff --git a/doc/todo/mdwn_preview.mdwn b/doc/todo/mdwn_preview.mdwn index a447299bc..68558a571 100644 --- a/doc/todo/mdwn_preview.mdwn +++ b/doc/todo/mdwn_preview.mdwn @@ -7,4 +7,13 @@ 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 done]] -- cgit v1.2.3 From cc194fe527261b6a36a79df59c626bd3d7891b84 Mon Sep 17 00:00:00 2001 From: "http://www.cse.unsw.edu.au/~willu/" Date: Fri, 6 Mar 2009 03:40:50 -0500 Subject: Add patch for WMD plugin. This new plugin adds live preview and text controls to ikiwiki edit pages. --- doc/todo/mdwn_preview.mdwn | 83 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 82 insertions(+), 1 deletion(-) (limited to 'doc/todo') diff --git a/doc/todo/mdwn_preview.mdwn b/doc/todo/mdwn_preview.mdwn index 68558a571..4c361052b 100644 --- a/doc/todo/mdwn_preview.mdwn +++ b/doc/todo/mdwn_preview.mdwn @@ -16,4 +16,85 @@ add to ikiwiki. >> 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 done]] +[[!tag wishlist]] + +>>> Below is a simple plugin/[[patch]] to make use of the WMD editor. Turns out it isn't hard at all to +>>> get a basic version going (that don't handle directives at all). I've +>>> removed the done tag so this is visible as a patch. -- [[Will]] + +------ + +### Instructions: + + +Download the [WMD source](http://wmd-editor.com/downloads/wmd-1.0.1.zip). In that zip file you'll +find a few example html files, a readme and `wmd` directory. Move the `wmd` directory into the +ikiwiki `underlays` directory. You should now have an `underlays/wmd/wmd.js` file as well as +some other javascript files and an images directory in the same place. + +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. + +Install the following patch and plugin file. Then enable the 'wmd' plugin. + + + diff --git a/templates/editpage.tmpl b/templates/editpage.tmpl + index 4b54db2..b1cf015 100644 + --- a/templates/editpage.tmpl + +++ b/templates/editpage.tmpl + @@ -37,6 +37,7 @@ Optional comment about this change:
+ + + + + + + +
+ +----- + + #!/usr/bin/perl + package IkiWiki::Plugin::wmd; + + use warnings; + use strict; + use IkiWiki 3.00; + use POSIX; + use Encode; + + sub import { + add_underlay("wmd"); + hook(type => "getsetup", id => "wmd", call => \&getsetup); + hook(type => "formbuilder_setup", id => "wmd", call => \&formbuilder_setup); + } + + sub getsetup () { + return + plugin => { + safe => 1, + rebuild => 1, + }, + } + + sub formbuilder_setup (@) { + my %params=@_; + my $form=$params{form}; + + return if ! defined $form->field("do"); + + return unless (($form->field("do") eq "edit") || + ($form->field("do") eq "create")); + + $form->tmpl_param("wmd_preview", "
\n".include_javascript(undef, 1)); + } + + sub include_javascript ($;$) { + my $page=shift; + my $absolute=shift; + + return ''."\n"; + } + + 1 + -- cgit v1.2.3 From 8333b4bbc3bd907a4fbd5ed1da79625afc9e71aa Mon Sep 17 00:00:00 2001 From: "http://www.cse.unsw.edu.au/~willu/" Date: Fri, 6 Mar 2009 03:47:08 -0500 Subject: Note another issue with the basic plugin. --- doc/todo/mdwn_preview.mdwn | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'doc/todo') diff --git a/doc/todo/mdwn_preview.mdwn b/doc/todo/mdwn_preview.mdwn index 4c361052b..a99f03eed 100644 --- a/doc/todo/mdwn_preview.mdwn +++ b/doc/todo/mdwn_preview.mdwn @@ -19,7 +19,8 @@ add to ikiwiki. [[!tag wishlist]] >>> Below is a simple plugin/[[patch]] to make use of the WMD editor. Turns out it isn't hard at all to ->>> get a basic version going (that don't handle directives at all). I've +>>> 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]] ------ -- cgit v1.2.3 From e6e7e641974d66976cfc13eb0a90785e8fca3b8a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 7 Mar 2009 14:38:48 -0500 Subject: comments --- doc/todo/mdwn_preview.mdwn | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'doc/todo') diff --git a/doc/todo/mdwn_preview.mdwn b/doc/todo/mdwn_preview.mdwn index a99f03eed..2155f0f87 100644 --- a/doc/todo/mdwn_preview.mdwn +++ b/doc/todo/mdwn_preview.mdwn @@ -23,6 +23,14 @@ add to ikiwiki. >>> 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. +>>> +>>> Can I get a license statement (ie, GPL-2+) ffrom you for the plugin? +>>> --[[Joey]] + ------ ### Instructions: @@ -33,9 +41,16 @@ find a few example html files, a readme and `wmd` directory. Move the `wmd` dir ikiwiki `underlays` directory. You should now have an `underlays/wmd/wmd.js` file as well as some other javascript files and an images directory in the same place. +> 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. --[[Joey]] + 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? --[[Joey]] + Install the following patch and plugin file. Then enable the 'wmd' plugin. -- cgit v1.2.3 From 904b6b3e94a4a0d319d81d7d734aa90d3014fe29 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 7 Mar 2009 14:40:49 -0500 Subject: point at wmd plugin --- doc/todo/wikiwyg.mdwn | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'doc/todo') 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 * 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]] -- cgit v1.2.3 From 424b4602c060b95870c707cfc2320d2c4faf5579 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 7 Mar 2009 14:42:16 -0500 Subject: note that a wmd plugin has appeared --- doc/todo/Add_showdown_GUI_input__47__edit.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/todo') 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 >>> 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]] -- cgit v1.2.3 From 08e4472fc469c630ebef93e16a66a5a69d9cb33a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 7 Mar 2009 17:48:17 -0500 Subject: question --- doc/todo/mdwn_preview.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/todo') diff --git a/doc/todo/mdwn_preview.mdwn b/doc/todo/mdwn_preview.mdwn index 2155f0f87..16d7409a0 100644 --- a/doc/todo/mdwn_preview.mdwn +++ b/doc/todo/mdwn_preview.mdwn @@ -49,7 +49,7 @@ Note that the WMD plugin does **not** handle directives. For this reason the no 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? --[[Joey]] +> when I try it? Is it what's needed for the live preview? --[[Joey]] Install the following patch and plugin file. Then enable the 'wmd' plugin. -- cgit v1.2.3