From 8a901ad49c12bb5bde9afb6fe7ce36ab2fb83d13 Mon Sep 17 00:00:00 2001 From: "http://www.cse.unsw.edu.au/~willu/" Date: Sun, 2 Nov 2008 05:23:25 -0500 Subject: Thoughts --- doc/todo/syntax_highlighting.mdwn | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/doc/todo/syntax_highlighting.mdwn b/doc/todo/syntax_highlighting.mdwn index bb1c84f02..645dd56bc 100644 --- a/doc/todo/syntax_highlighting.mdwn +++ b/doc/todo/syntax_highlighting.mdwn @@ -32,6 +32,10 @@ pages, as well as doing syntax highlighting as a preprocessor directive we could use an external plugin..) * Currently no single plugin supports both modes of operation (directive and whole source file to page). + + > This is now fixed by the [[ikiwiki/directive/format]] directive for all + > whole-source-file plugins, right? + * Nothing seems to support [[wiki-formatted_comments|wiki-formatted_comments_with_syntax_plugin]] inside source files. Doing this probably means post-processing the @@ -45,6 +49,17 @@ pages, as well as doing syntax highlighting as a preprocessor directive One approach that's also been requested for eg, [[plugins/contrib/mediawiki]] is to allow controlling which linkification types a page type can have on it. + + > The previous two points seem to be related. One thought: instead of + > getting the source from the `content` parameter, the plugin could + > re-load the page source. That would stop directives/links from + > being processed in the source. As noted above, comments + > could then be parsed for directives/links later. + > + > Would it be worth adding a `nodirectives` option when registering + > an htmlize hook that switches off directive and link processing before + > generating the html for a page? + * The whole-file plugins all get confused if there is a `foo.c` and a `foo.h`. This is trivially fixable now by passing the keepextension option when registering the htmlize hooks, though. @@ -61,6 +76,11 @@ pages, as well as doing syntax highlighting as a preprocessor directive extensions. The workaround is to use a directive on a wiki page, pulling in the Makefile. + > I wonder how hard it would be to make a patch where by a file with + > no `.` in the name, and a name that matches a filetype, and where + > that filetype was registered `keepextension`, then the file is just + > chosen as the appropriate type... + ## format directive Rather than making syntax highlight plugins have to provide a preprocessor -- cgit v1.2.3 From 98a5bd23d3004c36b16ccdcdb968ff50ee35f802 Mon Sep 17 00:00:00 2001 From: "http://www.cse.unsw.edu.au/~willu/" Date: Sun, 2 Nov 2008 05:47:19 -0500 Subject: Add patch --- doc/todo/syntax_highlighting.mdwn | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/doc/todo/syntax_highlighting.mdwn b/doc/todo/syntax_highlighting.mdwn index 645dd56bc..5df185705 100644 --- a/doc/todo/syntax_highlighting.mdwn +++ b/doc/todo/syntax_highlighting.mdwn @@ -76,10 +76,27 @@ pages, as well as doing syntax highlighting as a preprocessor directive extensions. The workaround is to use a directive on a wiki page, pulling in the Makefile. - > I wonder how hard it would be to make a patch where by a file with + > I wonder how hard it would be to make a patch whereby a file with > no `.` in the name, and a name that matches a filetype, and where > that filetype was registered `keepextension`, then the file is just - > chosen as the appropriate type... + > chosen as the appropriate type. This would allow `Makefile` to + > work. + +like this: + + diff --git a/IkiWiki.pm b/IkiWiki.pm + index 8d728c9..1bd46a9 100644 + --- a/IkiWiki.pm + +++ b/IkiWiki.pm + @@ -618,6 +618,8 @@ sub pagetype ($) { #{{{ + + if ($page =~ /\.([^.]+)$/) { + return $1 if exists $hooks{htmlize}{$1}; + + } elsif ($hooks{htmlize}{$page}{keepextension}) { + + return $page; + } + return; + } #}}} ## format directive -- cgit v1.2.3 From d71caffb7b249bded2ab1902953fa321dc90011c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 2 Nov 2008 12:21:15 -0500 Subject: preprocess text before htmlizing it --- IkiWiki/Plugin/format.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/IkiWiki/Plugin/format.pm b/IkiWiki/Plugin/format.pm index a219190e8..1e21a0bdc 100644 --- a/IkiWiki/Plugin/format.pm +++ b/IkiWiki/Plugin/format.pm @@ -23,7 +23,8 @@ sub preprocess (@) { #{{{ error(sprintf(gettext("unsupported page format %s"), $format)); } - return IkiWiki::htmlize($params{page}, $params{destpage}, $format, $text); + return IkiWiki::htmlize($params{page}, $params{destpage}, $format, + IkiWiki::preprocess($params{page}, $params{destpage}, $text)); } #}}} 1 -- cgit v1.2.3 From 8e451ecda4573284467c95a0b66ade3014fd1bd8 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Sun, 2 Nov 2008 20:13:14 +0100 Subject: po: now uses inject --- doc/plugins/contrib/po.mdwn | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/plugins/contrib/po.mdwn b/doc/plugins/contrib/po.mdwn index f60b8fbea..98cc07178 100644 --- a/doc/plugins/contrib/po.mdwn +++ b/doc/plugins/contrib/po.mdwn @@ -52,10 +52,13 @@ Any thoughts on this? >>> [[plugins/write]]. I think you can just inject wrappers about a few ikiwiki >>> functions, rather than adding hooks. The `inject` function is pretty >>> insane^Wlow level, but seems to work great. --[[Joey]] ->> +>>> >>>> Thanks a lot, it seems to be a nice interface for what I was trying to achieve. >>>> I may be forced to wait two long weeks before I have a chance to confirm >>>> this. Stay tuned. --[[intrigeri]] +>>>> +>>>>> I've updated the plugin to use `inject`. It is now fully self-contained, +>>>>> and does not modify the core anymore. --[[intrigeri]] >> >> The Discussion pages issue is something I am not sure about yet. But I will >> probably decide that "slave" pages, being only translations, don't deserve -- cgit v1.2.3 From d93b509eeeeda80e9d6cb985186640a3902aa199 Mon Sep 17 00:00:00 2001 From: Jason Blevins Date: Sun, 2 Nov 2008 18:56:12 -0500 Subject: Note about prefix_directives --- doc/todo/New_preprocessor_directive_syntax/discussion.mdwn | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/doc/todo/New_preprocessor_directive_syntax/discussion.mdwn b/doc/todo/New_preprocessor_directive_syntax/discussion.mdwn index dda1ff5e9..fd104cf6b 100644 --- a/doc/todo/New_preprocessor_directive_syntax/discussion.mdwn +++ b/doc/todo/New_preprocessor_directive_syntax/discussion.mdwn @@ -1,2 +1,12 @@ Err, is this really fixed in 2.21? I can't find it anywhere in 2.32.3 (debian unstable) + +----- + +I just did a `--dumpsetup` with the current version from the Git repository +and the default option is + + # use '!'-prefixed preprocessor directives? + prefix_directives => 0, + +My impression was that this should be enabled by default now. --[[JasonBlevins]] -- cgit v1.2.3 From 1a4c6b5fcf0fa36d0368c8294c7629c850dab676 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Mon, 3 Nov 2008 01:33:33 +0100 Subject: notes and wiki-gardening about pagetitle vs. meta title Signed-off-by: intrigeri --- doc/bugs/pagetitle_function_does_not_respect_meta_titles.mdwn | 9 +++++++++ doc/todo/using_meta_titles_for_parentlinks.html | 6 ++++++ 2 files changed, 15 insertions(+) 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 a30ab0fa3..77c86eba1 100644 --- a/doc/bugs/pagetitle_function_does_not_respect_meta_titles.mdwn +++ b/doc/bugs/pagetitle_function_does_not_respect_meta_titles.mdwn @@ -1,3 +1,12 @@ The `IkiWiki::pagetitle` function does not respect title changes via `meta.title`. It really should, so that links rendered with `htmllink` get the proper title in the link text. --[[madduck]] + +> Agreed. [[todo/using_meta_titles_for_parentlinks]] contains a beginning of +> solution. A few quick notes about it: + +> - Using inline would avoid the redefinition + code duplication. +> - A few plugins would need to be upgraded. +> - It may be necessary to adapt the testsuite in `t/pagetitle.t`, as well. + +> --[[intrigeri]] diff --git a/doc/todo/using_meta_titles_for_parentlinks.html b/doc/todo/using_meta_titles_for_parentlinks.html index 651b7fa0f..d04e5a300 100644 --- a/doc/todo/using_meta_titles_for_parentlinks.html +++ b/doc/todo/using_meta_titles_for_parentlinks.html @@ -114,3 +114,9 @@ diff -c /usr/share/perl5/IkiWiki/Plugin/meta.pm.distrib /usr/share/perl5/IkiWiki + +

+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 75603b4082f43f87802eab8c3739eff92a634453 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Mon, 3 Nov 2008 01:42:44 +0100 Subject: response Signed-off-by: intrigeri --- doc/todo/New_preprocessor_directive_syntax/discussion.mdwn | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/todo/New_preprocessor_directive_syntax/discussion.mdwn b/doc/todo/New_preprocessor_directive_syntax/discussion.mdwn index fd104cf6b..f6c0fc0ec 100644 --- a/doc/todo/New_preprocessor_directive_syntax/discussion.mdwn +++ b/doc/todo/New_preprocessor_directive_syntax/discussion.mdwn @@ -10,3 +10,10 @@ and the default option is prefix_directives => 0, My impression was that this should be enabled by default now. --[[JasonBlevins]] + +> As stated in `debian/NEWS`: +>> For backward compatibility with existing wikis, +>> refix_directives currently defaults to false. In ikiwiki 3.0, +>> prefix_directives will default to true [...] +> --[[intrigeri]] + -- cgit v1.2.3 From 06c23490d9f2fd616da06f0b3c260a61531fe9a7 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Mon, 3 Nov 2008 14:11:44 -0500 Subject: updated repository location --- doc/users/intrigeri.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/users/intrigeri.mdwn b/doc/users/intrigeri.mdwn index f9a216e18..8fa9965a5 100644 --- a/doc/users/intrigeri.mdwn +++ b/doc/users/intrigeri.mdwn @@ -1,4 +1,4 @@ intrigeri AT boum.org, already loving ikiwiki. * [gnupg key](http://gaffer.ptitcanardnoir.org/intrigeri/intrigeri.asc) -* Git repository ([gitweb](http://repo.or.cz/w/ikiwiki/intrigeri.git)) with various ikiwiki {feature, bugfix}-branches : `git://repo.or.cz/ikiwiki/intrigeri.git` +* Git repository with various ikiwiki {feature, bugfix}-branches : `git://gaffer.ptitcanardnoir.org/ikiwiki.git` -- cgit v1.2.3 From 2e00af6096b47cff141acc1965d75178471b1878 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 3 Nov 2008 16:42:06 -0500 Subject: releasing version 2.68 --- debian/changelog | 4 ++-- po/ikiwiki.pot | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index 38701b6db..d04e5ee25 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -ikiwiki (2.68) UNRELEASED; urgency=low +ikiwiki (2.68) unstable; urgency=low * Add support for checking pushes from untrusted git committers. This can be used to set up anonymous git pushes, and other similar things. @@ -43,7 +43,7 @@ ikiwiki (2.68) UNRELEASED; urgency=low * Preserve syslog setting when doing `ikiwiki -setup foo -dumpsetup bar` * Several fixes to --render mode. - -- Joey Hess Fri, 17 Oct 2008 20:11:02 -0400 + -- Joey Hess Mon, 03 Nov 2008 16:31:11 -0500 ikiwiki (2.67) unstable; urgency=low diff --git a/po/ikiwiki.pot b/po/ikiwiki.pot index f3eb0eb55..5db0c51af 100644 --- a/po/ikiwiki.pot +++ b/po/ikiwiki.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2008-10-31 16:38-0400\n" +"POT-Creation-Date: 2008-11-03 16:31-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -246,11 +246,11 @@ msgstr "" msgid "failed to process" msgstr "" -#: ../IkiWiki/Plugin/format.pm:22 +#: ../IkiWiki/Plugin/format.pm:20 msgid "must specify format and text" msgstr "" -#: ../IkiWiki/Plugin/format.pm:25 +#: ../IkiWiki/Plugin/format.pm:23 #, perl-format msgid "unsupported page format %s" msgstr "" -- cgit v1.2.3 From 46b4eac9338c9649807ac2eca500aece9dd1fb27 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 3 Nov 2008 16:42:48 -0500 Subject: add news item for ikiwiki 2.68 --- doc/news/version_2.63.mdwn | 21 --------------------- doc/news/version_2.68.mdwn | 44 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 21 deletions(-) delete mode 100644 doc/news/version_2.63.mdwn create mode 100644 doc/news/version_2.68.mdwn diff --git a/doc/news/version_2.63.mdwn b/doc/news/version_2.63.mdwn deleted file mode 100644 index 165f60ceb..000000000 --- a/doc/news/version_2.63.mdwn +++ /dev/null @@ -1,21 +0,0 @@ -ikiwiki 2.63 released with [[!toggle text="these changes"]] -[[!toggleable text=""" - * Set cookies HttpOnly. - * Typo. Closes: #[497003](http://bugs.debian.org/497003) - * Ignore failure to install files into /etc, in case install is running as - non-root. - * Work around perl $\_ scoping nonsense that caused breakage when loading - external plugins. - * style.css: Add missing semicolon. Closes: #[497176](http://bugs.debian.org/497176) - * filecheck: Fall back to testing for binary or plain text files - if no mime type is detected. - * table: Support header=column to make the table header be the first - column of the data. (AlexandreDupas) - * For fine control over what characters are allowed, unescaped in - source filenames, the wiki\_file\_chars setting is added. For example, - set to "-[:alnum:]+/.\_" to disable colons from being used in source files - (which can cause troubl om Windows). - * po/Makefile: update po files when the pot file has changed. - Closes: #[497951](http://bugs.debian.org/497951) - * editpage: New core plugin factoring out page editing to allow disabling it - if desired."""]] \ No newline at end of file diff --git a/doc/news/version_2.68.mdwn b/doc/news/version_2.68.mdwn new file mode 100644 index 000000000..b7e625026 --- /dev/null +++ b/doc/news/version_2.68.mdwn @@ -0,0 +1,44 @@ +ikiwiki 2.68 released with [[!toggle text="these changes"]] +[[!toggleable text=""" + * Add support for checking pushes from untrusted git committers. This can be + used to set up anonymous git pushes, and other similar things. + * format: New plugin, allows embedding differently formatted text inside a + page (ie, otl inside a mdwn page, or syntax highlighted code inside a + page). + * relativedate: New javascript-alicious plugin that makes all dates display + relative, in a very nice way, if I say so myself. + * Optimise the no-op post-commit hook, to speed up web edits by a fraction + of a second. + * git: Allow [[sha1\_commit]] to be used in the diffurl, to support cgit. + * shortcut: Fix display of shortcuts while previewing. + * Plugins that used to override displaytime should instead override + formattime. displaytime will call that, and may wrap markup around the + formatted time. + * Add an underlay for javascript, and add ikiwiki.js containing some utility + code. + * toggle: Stop embedding the full toggle code on each page using it, and + move it to toggle.js in the javascript underlay. + * recentchanges: Make feed links point back to anchors on the recentchanges + page. (JasonBlevins) + * Fix issue with utf-8 in wikiname breaking session cookies, by + entity-encoding the wikiname in the session cookie. + * Use the pure perl Data::Dumper when generating setup files to ensure that + utf-8 characters are written out as such, and not as the encoded perl + strings the C Data::Dumper produces. + * inline: Only the last feed link was put on the page, fix this to include + all feed links. So rss will be included along with atom, and pages with + multiple feeds will get links added for all feeds. + * tag: When tagpage is set, force the links created by tagging to point at + the toplevel tagpage, and not closer subpages. The html links already went + there, but internally the links were not recorded as absolute, which could + cause confusing backlinks etc. + * Add an inject function, that can be used by plugins that want to + replace one of ikiwiki's functions with their own version. + (This is a scary thing that grubs through the symbol table, and replaces + all exported occurances of a function with the injected version.) + * external: RPC functions can be injected to replace exported functions. + * Updated French translation. Closes: #[502694](http://bugs.debian.org/502694) + * Updated Spanish translation from the ever vigilant Victor Moral. + * Updated Danish translation from Jonas Smedegaard. Closes: #[503117](http://bugs.debian.org/503117) + * Preserve syslog setting when doing `ikiwiki -setup foo -dumpsetup bar` + * Several fixes to --render mode."""]] \ No newline at end of file -- cgit v1.2.3 From b2aa69762d7f1950281d838ad0f13092f62f3962 Mon Sep 17 00:00:00 2001 From: neale Date: Mon, 3 Nov 2008 22:07:58 -0500 Subject: --- doc/plugins/img/discussion.mdwn | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/plugins/img/discussion.mdwn b/doc/plugins/img/discussion.mdwn index 02d46e380..7a70da65f 100644 --- a/doc/plugins/img/discussion.mdwn +++ b/doc/plugins/img/discussion.mdwn @@ -5,3 +5,5 @@ logo link to \[[hurd/logo]] / instead of linking to the PNG image file. --[[tschwinge]] > Done, use link=somepage --[[Joey]] + +It would be handy if the `class` and `id` tags were passed through to the surrounding `table` in the case of `caption` being present. Would this break anything? --[[Nea -- cgit v1.2.3 From 8903776a0938c0bec03b864b1aa63672ed096298 Mon Sep 17 00:00:00 2001 From: neale Date: Mon, 3 Nov 2008 22:08:49 -0500 Subject: trackpad registered a click on save --- doc/plugins/img/discussion.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/plugins/img/discussion.mdwn b/doc/plugins/img/discussion.mdwn index 7a70da65f..5bf340c56 100644 --- a/doc/plugins/img/discussion.mdwn +++ b/doc/plugins/img/discussion.mdwn @@ -6,4 +6,4 @@ instead of linking to the PNG image file. --[[tschwinge]] > Done, use link=somepage --[[Joey]] -It would be handy if the `class` and `id` tags were passed through to the surrounding `table` in the case of `caption` being present. Would this break anything? --[[Nea +It would be handy if the `class` and `id` tags were passed through to the surrounding `table` in the case of `caption` being present. Would this break anything? --[[neale]] -- cgit v1.2.3 From d0c2f1b44d926096beeea0469019eade4d1fb5a2 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Tue, 4 Nov 2008 11:18:37 +0100 Subject: Bug in the txt plugin. --- ...txt_plugin_having_problems_with_meta_directives.mdwn | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 doc/bugs/txt_plugin_having_problems_with_meta_directives.mdwn diff --git a/doc/bugs/txt_plugin_having_problems_with_meta_directives.mdwn b/doc/bugs/txt_plugin_having_problems_with_meta_directives.mdwn new file mode 100644 index 000000000..07fce5002 --- /dev/null +++ b/doc/bugs/txt_plugin_having_problems_with_meta_directives.mdwn @@ -0,0 +1,17 @@ +When applying my usual copyright and licensing header to a [[plugins/txt]] +page, garbled output is created. + +Here is the header: + + \[[meta copyright="Copyright © 2001, 2002, 2003, 2004, 2005, 2008 Free + Software Foundation, Inc."]] + + \[[meta license="""\[[toggle id="license" text="GFDL 1.2+"]]\[[toggleable + id="license" text="Permission is granted to copy, distribute and/or modify + this document under the terms of the GNU Free Documentation License, + Version 1.2 or any later version published by the Free Software Foundation; + with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + A copy of the license is included in the section entitled + \[[GNU_Free_Documentation_License|/fdl]]."]]"""]] + +--[[tschwinge]] -- cgit v1.2.3 From c67c35e8971886adb07fbe8d7c9db8a022be1756 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Tue, 4 Nov 2008 11:22:30 +0100 Subject: Undo too much quoting. --- doc/bugs/txt_plugin_having_problems_with_meta_directives.mdwn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/bugs/txt_plugin_having_problems_with_meta_directives.mdwn b/doc/bugs/txt_plugin_having_problems_with_meta_directives.mdwn index 07fce5002..d2d5a46ed 100644 --- a/doc/bugs/txt_plugin_having_problems_with_meta_directives.mdwn +++ b/doc/bugs/txt_plugin_having_problems_with_meta_directives.mdwn @@ -6,12 +6,12 @@ Here is the header: \[[meta copyright="Copyright © 2001, 2002, 2003, 2004, 2005, 2008 Free Software Foundation, Inc."]] - \[[meta license="""\[[toggle id="license" text="GFDL 1.2+"]]\[[toggleable + \[[meta license="""[[toggle id="license" text="GFDL 1.2+"]][[toggleable id="license" text="Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled - \[[GNU_Free_Documentation_License|/fdl]]."]]"""]] + [[GNU_Free_Documentation_License|/fdl]]."]]"""]] --[[tschwinge]] -- cgit v1.2.3 From 5f4b41076ce30044a195da5c50d015e658967400 Mon Sep 17 00:00:00 2001 From: Jason Blevins Date: Tue, 4 Nov 2008 11:05:55 -0500 Subject: Forum response --- doc/forum/wiki_name_in_page_titles.mdwn | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/doc/forum/wiki_name_in_page_titles.mdwn b/doc/forum/wiki_name_in_page_titles.mdwn index 385e7a3f2..f22049aa8 100644 --- a/doc/forum/wiki_name_in_page_titles.mdwn +++ b/doc/forum/wiki_name_in_page_titles.mdwn @@ -8,3 +8,19 @@ that provides a `IS_HOMEPAGE` template variable? --[[JasonBlevins]] > Hmm, one way to work around this is to put a meta title directive on the > index page. Then TITLE will be that, rather than WIKINAME, and your > template should work. --[[Joey]] + +>> I ended up writing a [path][] plugin since I had some other +>> path-specific conditional things to include in my templates. +>> +>> So now I can do things like this: +>> +>> +>> <TMPL_VAR WIKINAME><TMPL_UNLESS IS_HOMEPAGE>: <TMPL_VAR TITLE></TMPL_UNLESS> +>> +>> +>> But also more complicated path-specific conditionals like +>> `IN_DIR_SUBDIR` to indicate subpages of `/dir/subdir/`. I've got a +>> few other small plugins brewing so I'll try to put up some contrib +>> pages for them soon. --[[JasonBlevins]] + +[path][]: http://code.jblevins.org/ikiwiki/plugins.git/plain/path.pm -- cgit v1.2.3 From d175961d41cea034f7816e12be0ed9b6597352c1 Mon Sep 17 00:00:00 2001 From: Jason Blevins Date: Tue, 4 Nov 2008 11:16:58 -0500 Subject: Added experimental code, metamail, pandoc, and path plugins --- doc/users/jasonblevins.mdwn | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/doc/users/jasonblevins.mdwn b/doc/users/jasonblevins.mdwn index f69a8040c..61c381d96 100644 --- a/doc/users/jasonblevins.mdwn +++ b/doc/users/jasonblevins.mdwn @@ -29,7 +29,8 @@ Current ikiwki issues of interest: ## Plugins These plugins are experimental. Use them at your own risk. Read the -perldoc documentation for more details. +perldoc documentation for more details. Patches and suggestions are +welcome. * [mdwn_itex][] - Works with the `mdwn` plugin to convert inline LaTeX expressions to MathML using `itex2MML`. @@ -37,6 +38,30 @@ perldoc documentation for more details. * [h1title][] - If present, use the leading level 1 Markdown header to set the page title and remove it from the page body. + * [code][] - Whole file and inline code snippet syntax highlighting + via GNU Source-highlight. The list of supported file extensions is + configurable. There is also some preliminary [documentation][code-doc]. + See the [FortranWiki](http://fortranwiki.org) for examples. + + * [metamail][] - a plugin for loading metadata from email-style + headers at top of a file (e.g., `title: Page Title` or + `date: November 2, 2008 11:14 EST`). + + * [pandoc][] - Markdown page processing via Pandoc. LaTeX and + reStructuredText are optional. + + * [path][] - Provides path-specific template conditionals such as + `IS_HOMEPAGE` and `IN_DIR_SUBDIR`. + + [mdwn_itex]: http://code.jblevins.org/ikiwiki/plugins.git/plain/mdwn_itex.pm + [h1title]: http://code.jblevins.org/ikiwiki/plugins.git/plain/h1title.pm + [code]: http://code.jblevins.org/ikiwiki/plugins.git/plain/code.pm + [code-doc]: http://code.jblevins.org/ikiwiki/plugins.git/plain/code.text + [metamail]: http://code.jblevins.org/ikiwiki/plugins.git/plain/metamail.pm + [pandoc]: http://code.jblevins.org/ikiwiki/plugins.git/plain/pandoc.pm + [path]: http://code.jblevins.org/ikiwiki/plugins.git/plain/path.pm + + ## MathML and SVG support So far, I've made some notes on sanitizing MathML and SVG via @@ -82,5 +107,3 @@ page in the first place (unless they post directly to the right URL). [template-patch]: http://xbeta.org/gitweb/?p=xbeta/ikiwiki.git;a=blobdiff;f=templates/page.tmpl;h=380ef699fa72223744eb5c1ee655fb79aa6bce5b;hp=9084ba7e11e92a10528b2ab12c9b73cf7b0f40a7;hb=416d5d1b15b94e604442e4e209a30dee4b77b684;hpb=ececf4fb8766a4ff7eff943b3ef600be81a0df49 [cgi-patch]: http://xbeta.org/gitweb/?p=xbeta/ikiwiki.git;a=commitdiff;h=fa538c375250ab08f396634135f7d79fce2a9d36 - [mdwn_itex]: http://code.jblevins.org/ikiwiki/plugins/mdwn_itex.pm - [h1title]: http://code.jblevins.org/ikiwiki/plugins/h1title.pm -- cgit v1.2.3 From a0401960c745cc49b2b274a599fa461d824bcdbc Mon Sep 17 00:00:00 2001 From: Jason Blevins Date: Tue, 4 Nov 2008 11:19:14 -0500 Subject: Fix reference link --- doc/forum/wiki_name_in_page_titles.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/forum/wiki_name_in_page_titles.mdwn b/doc/forum/wiki_name_in_page_titles.mdwn index f22049aa8..01ff8d817 100644 --- a/doc/forum/wiki_name_in_page_titles.mdwn +++ b/doc/forum/wiki_name_in_page_titles.mdwn @@ -23,4 +23,4 @@ that provides a `IS_HOMEPAGE` template variable? --[[JasonBlevins]] >> few other small plugins brewing so I'll try to put up some contrib >> pages for them soon. --[[JasonBlevins]] -[path][]: http://code.jblevins.org/ikiwiki/plugins.git/plain/path.pm +[path]: http://code.jblevins.org/ikiwiki/plugins.git/plain/path.pm -- cgit v1.2.3 From c197cc34b07be94fb7481af0e5db09bbaaff8365 Mon Sep 17 00:00:00 2001 From: Jason Blevins Date: Tue, 4 Nov 2008 11:37:50 -0500 Subject: Question excluding images in inline pagespec --- doc/ikiwiki/directive/inline/discussion.mdwn | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/ikiwiki/directive/inline/discussion.mdwn b/doc/ikiwiki/directive/inline/discussion.mdwn index 91b2ff462..003c6abff 100644 --- a/doc/ikiwiki/directive/inline/discussion.mdwn +++ b/doc/ikiwiki/directive/inline/discussion.mdwn @@ -19,3 +19,11 @@ take it as far as implementing "replies" to other comments. ## More dynamic `rootpage` parameter of inline plugin? (Moved to [[todo/dynamic_rootpage]]) + +--- + +## Excluding Images + +Is there a simple way to exclude images, stylesheets, and other +"non-page" files other than a blacklist approach like +`pages="* and !*.png and !*.css"`? --[[JasonBlevins]] -- cgit v1.2.3 From c731a81b4320fc39f7877cc8a36849f13edf149a Mon Sep 17 00:00:00 2001 From: intrigeri Date: Tue, 4 Nov 2008 17:56:42 +0100 Subject: po plugin: fix preview for PO files As a trick, use editcontent hook to mark the page as unfiltered, to force our filter() sub's to proceed again. Signed-off-by: intrigeri --- IkiWiki/Plugin/po.pm | 45 +++++++++++++++++++++++++++++++-------------- 1 file changed, 31 insertions(+), 14 deletions(-) diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index 9dda8c0db..779571984 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -38,6 +38,7 @@ sub import { hook(type => "filter", id => "po", call => \&filter); hook(type => "htmlize", id => "po", call => \&htmlize); hook(type => "pagetemplate", id => "po", call => \&pagetemplate); + hook(type => "editcontent", id => "po", call => \&editcontent); inject(name => "IkiWiki::bestlink", call => \&mybestlink); inject(name => "IkiWiki::beautify_urlpath", call => \&mybeautify_urlpath); inject(name => "IkiWiki::targetpage", call => \&mytargetpage); @@ -282,25 +283,31 @@ sub mybestlink ($$) { #{{{ return ""; } #}}} -# We use filter to convert PO to the master page's type, -# since other plugins should not work on PO files +# We use filter to convert PO to the master page's format, +# since the rest of ikiwiki should not work on PO files. sub filter (@) { #{{{ my %params = @_; my $page = $params{page}; my $destpage = $params{destpage}; my $content = decode_utf8(encode_utf8($params{content})); - # decide if this is a PO file that should be converted into a translated document, - # and perform various sanity checks - if (! istranslation($page) || $filtered{$page}{$destpage}) { - return $content; - } + return $content if ( ! istranslation($page) + || ( exists $filtered{$page}{$destpage} + && $filtered{$page}{$destpage} eq 1 )); + + # CRLF line terminators make poor Locale::Po4a feel bad + $content=~s/\r\n/\n/g; + + # Locale::Po4a needs an input file, and I'm too lazy to learn + # how to disguise a variable as a file + my $infile = File::Temp->new(TEMPLATE => "ikiwiki-po-filter-in.XXXXXXXXXX", + TMPDIR => 1)->filename; + writefile(basename($infile), File::Spec->tmpdir, $content); my ($masterpage, $lang) = ($page =~ /(.*)[.]([a-z]{2})$/); - my $file=srcfile(exists $params{file} ? $params{file} : $IkiWiki::pagesources{$page}); my $masterfile = srcfile($pagesources{$masterpage}); my (@pos,@masters); - push @pos,$file; + push @pos,$infile; push @masters,$masterfile; my %options = ( "markdown" => (pagetype($masterfile) eq 'mdwn') ? 1 : 0, @@ -311,11 +318,11 @@ sub filter (@) { #{{{ 'file_in_name' => \@masters, 'file_in_charset' => 'utf-8', 'file_out_charset' => 'utf-8', - ) or error("[po/filter:$file]: failed to translate"); - my $tmpfh = File::Temp->new(TEMPLATE => "/tmp/ikiwiki-po-filter-out.XXXXXXXXXX"); - my $tmpout = $tmpfh->filename; - $doc->write($tmpout) or error("[po/filter:$file] could not write $tmpout"); - $content = readfile($tmpout) or error("[po/filter:$file] could not read $tmpout"); + ) or error("[po/filter:$infile]: failed to translate"); + my $tmpout = File::Temp->new(TEMPLATE => "ikiwiki-po-filter-out.XXXXXXXXXX", + TMPDIR => 1)->filename; + $doc->write($tmpout) or error("[po/filter:$infile] could not write $tmpout"); + $content = readfile($tmpout) or error("[po/filter:$infile] could not read $tmpout"); $filtered{$page}{$destpage}=1; return $content; } #}}} @@ -438,6 +445,16 @@ sub pagetemplate (@) { #{{{ } } # }}} +sub editcontent () { #{{{ + my %params=@_; + # as we're previewing or saving a page, the content may have + # changed, so tell the next filter() invocation it must not be lazy + if (exists $filtered{$params{page}}{$params{page}}) { + delete $filtered{$params{page}}{$params{page}}; + } + return $params{content}; +} #}}} + sub istranslatable ($) { #{{{ my $page=shift; my $file=$pagesources{$page}; -- cgit v1.2.3 From 43a83e103e7f0e4a522f8393a4e2015dad767864 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 4 Nov 2008 13:19:15 -0500 Subject: response --- doc/ikiwiki/directive/inline/discussion.mdwn | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/ikiwiki/directive/inline/discussion.mdwn b/doc/ikiwiki/directive/inline/discussion.mdwn index 003c6abff..e301190bf 100644 --- a/doc/ikiwiki/directive/inline/discussion.mdwn +++ b/doc/ikiwiki/directive/inline/discussion.mdwn @@ -27,3 +27,6 @@ take it as far as implementing "replies" to other comments. Is there a simple way to exclude images, stylesheets, and other "non-page" files other than a blacklist approach like `pages="* and !*.png and !*.css"`? --[[JasonBlevins]] + +> The [[plugins/filecheck]] plugin adds a 'ispage()' pagespec test that can do that. +> --[[Joey]] -- cgit v1.2.3 From 4dc4c9586dbae352c27cd316374fbf0e1db1d082 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 4 Nov 2008 13:21:07 -0500 Subject: maintain list --- doc/todo/syntax_highlighting.mdwn | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/todo/syntax_highlighting.mdwn b/doc/todo/syntax_highlighting.mdwn index 5df185705..97526bae6 100644 --- a/doc/todo/syntax_highlighting.mdwn +++ b/doc/todo/syntax_highlighting.mdwn @@ -23,6 +23,8 @@ pages, as well as doing syntax highlighting as a preprocessor directive * [[sourcecode|todo/automatic_use_of_syntax_plugin_on_source_code_files/discussion]] also uses src-highlight, and operates on whole source files. Updated to work with the fix for [[bugs/multiple_pages_with_same_name]]. Untested with files with no extension, e.g. `Makefile`. +* [[user/jrblevin]]'s code plugin uses src-highlight, and supports both + while file and directive use. ## General problems -- cgit v1.2.3 From cfcb7454db57481060f4caccd501ca8d281b22c5 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Tue, 4 Nov 2008 19:23:58 +0100 Subject: po plugin: aesthetics Signed-off-by: intrigeri --- IkiWiki/Plugin/po.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index 779571984..cc8e9b2ed 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -19,11 +19,12 @@ use Memoize; my %translations; our %filtered; -## FIXME: makes some test cases cry once every two tries; this may be -## related to the artificial way the testsuite is run, or not. -# memoize("istranslatable"); memoize("_istranslation"); memoize("percenttranslated"); +# FIXME: memoizing istranslatable() makes some test cases fail once every +# two tries; this may be related to the artificial way the testsuite is +# run, or not. +# memoize("istranslatable"); # backup references to subs that will be overriden my %origsubs; -- cgit v1.2.3 From 61c4129aaaa5ce1849023aa9f12f32ff98eb52fb Mon Sep 17 00:00:00 2001 From: intrigeri Date: Tue, 4 Nov 2008 19:24:37 +0100 Subject: po plugin: updated doc/todo Signed-off-by: intrigeri --- doc/plugins/po.mdwn | 70 ++++++++++++++++++++++------------------------------- 1 file changed, 29 insertions(+), 41 deletions(-) diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index fe6b6b562..6aa63b429 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -185,12 +185,12 @@ Automatic PO files update Committing changes to a "master" page: -1. updates the POT file and the PO files for the supported languages - (this is done in the `needsbuild` hook); the updated PO files are - then put under version control +1. updates the POT file, as well as the PO files for the "slave" + languages (this is done in the `needsbuild` hook); the updated PO + files are then put under version control; 2. triggers a refresh of the corresponding HTML slave pages (this is achieved by making any "slave" page dependent on the corresponding - "master" page, in the `needsbuild` hook) + "master" page, in the `needsbuild` hook). Also, when the plugin has just been enabled, or when a page has just been declared as being translatable, the needed POT and PO files are @@ -199,33 +199,23 @@ created, and the PO files are checked into version control. Discussion pages ---------------- -Discussion should happen in the language in which the pages are written for -real, *i.e.* the "master" one. If discussion pages are enabled, "slave" pages -therefore link to the "master" page's discussion page. +Discussion should happen in the language in which the pages are +written for real, *i.e.* the "master" one. If discussion pages are +enabled, "slave" pages therefore link to the "master" page's +discussion page. Translating ----------- -One can edit the PO files using ikiwiki's CGI (a message-by-message interface -could also be implemented at some point). +One can edit the PO files using ikiwiki's CGI (a message-by-message +interface could also be implemented at some point). -If [[tips/untrusted_git_push]] is setup, one can edit the PO files in her -preferred `$EDITOR`, without needing to be online. +If [[tips/untrusted_git_push]] is setup, one can edit the PO files in +her preferred `$EDITOR`, without needing to be online. TODO ==== -OTHERLANGUAGES dependencies ---------------------------- - -Pages using `OTHERLANGUAGES` depend on any "master" and "slave" pages -whose status is being displayed. It is supposed to trigger dependency -loops, but no practical bugs were noticed yet. - -Should pages using the `OTHERLANGUAGES` template loop be declared as -linking to the same page in other versions? To be rigorous, they -should, but this may clutter the backlinks. - Security checks --------------- @@ -243,29 +233,27 @@ gettext/po4a rough corners changes bla.fr.po in repo1; then pushing repo1 to repo2 triggers a PO update, that changes bla.fr.po in repo2; etc.; fixed in `629968fc89bced6727981c0a1138072631751fee`? -- new translations created in the web interface must get proper charset/encoding - gettext metadata, else the next automatic PO update removes any non-ascii - chars; possible solution: put such metadata into the Pot file, and let it - propagate; should be fixed in `773de05a7a1ee68d2bed173367cf5e716884945a`, time - will tell. +- new translations created in the web interface must get proper + charset/encoding gettext metadata, else the next automatic PO update + removes any non-ascii chars; possible solution: put such metadata + into the Pot file, and let it propagate; should be fixed in + `773de05a7a1ee68d2bed173367cf5e716884945a`, time will tell. Misc. improvements ------------------ -### preview - -preview does not work for PO files. - ### automatic POT/PO update -Use the `change` hook instead of `needsbuild`? +- Use the `change` hook instead of `needsbuild`? +- Fix (apparently harmless) undefined values that pollute logs when + saving a master page in the CGI ### page titles -Use nice page titles from meta plugin in links, as inline already does. This is -actually a duplicate for -[[bugs/pagetitle_function_does_not_respect_meta_titles]], which might be fixed -by something like [[todo/using_meta_titles_for_parentlinks]]. +Use nice page titles from meta plugin in links, as inline already +does. This is actually a duplicate for +[[bugs/pagetitle_function_does_not_respect_meta_titles]], which might +be fixed by something like [[todo/using_meta_titles_for_parentlinks]]. ### websetup @@ -274,15 +262,15 @@ Which configuration settings are safe enough for websetup? ### parentlinks When the wiki home page is translatable, the parentlinks plugin sets -`./index.html` as its translations' single parent link. Ideally, the home page's -translations should get no parent link at all, just like the version written in -the master language. +`./index.html` as its translations' single parent link. Ideally, the +home page's translations should get no parent link at all, just like +the version written in the master language. ### backlinks If a given translatable `sourcepage.mdwn` links to \[[destpage]], -`sourcepage.LL.po` also link to \[[destpage]], and the latter has the master -page *and* all its translations listed in the backlinks. +`sourcepage.LL.po` also link to \[[destpage]], and the latter has the +master page *and* all its translations listed in the backlinks. Translation quality assurance ----------------------------- -- cgit v1.2.3 From bc5b875de85419d38688b47e0d40ff808f0ebd86 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Tue, 4 Nov 2008 20:05:21 +0100 Subject: po plugin: remove broken parentlinks for home page's translations Signed-off-by: intrigeri --- IkiWiki/Plugin/po.pm | 17 +++++++++++------ doc/plugins/po.mdwn | 7 ------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index cc8e9b2ed..a5bf4fb54 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -38,7 +38,7 @@ sub import { hook(type => "needsbuild", id => "po", call => \&needsbuild); hook(type => "filter", id => "po", call => \&filter); hook(type => "htmlize", id => "po", call => \&htmlize); - hook(type => "pagetemplate", id => "po", call => \&pagetemplate); + hook(type => "pagetemplate", id => "po", call => \&pagetemplate, last => 1); hook(type => "editcontent", id => "po", call => \&editcontent); inject(name => "IkiWiki::bestlink", call => \&mybestlink); inject(name => "IkiWiki::beautify_urlpath", call => \&mybeautify_urlpath); @@ -398,9 +398,10 @@ sub otherlanguages ($) { #{{{ sub pagetemplate (@) { #{{{ my %params=@_; - my $page=$params{page}; - my $destpage=$params{destpage}; - my $template=$params{template}; + my $page=$params{page}; + my $destpage=$params{destpage}; + my $template=$params{template}; + my ($masterpage, $lang) = ($page =~ /(.*)[.]([a-z]{2})$/) if istranslation($page); if (istranslation($page) && $template->query(name => "percenttranslated")) { $template->param(percenttranslated => percenttranslated($page)); @@ -419,7 +420,6 @@ sub pagetemplate (@) { #{{{ } } elsif (istranslation($page)) { - my ($masterpage, $curlang) = ($page =~ /(.*)[.]([a-z]{2})$/); add_depends($page, $masterpage); foreach my $translation (values %{$translations{$masterpage}}) { add_depends($page, $translation); @@ -434,7 +434,6 @@ sub pagetemplate (@) { #{{{ # prevent future breakage when ikiwiki internals change. # Known limitations are preferred to future random bugs. if ($template->param('discussionlink') && istranslation($page)) { - my ($masterpage, $lang) = ($page =~ /(.*)[.]([a-z]{2})$/); $template->param('discussionlink' => htmllink( $page, $destpage, @@ -444,6 +443,12 @@ sub pagetemplate (@) { #{{{ linktext => gettext("Discussion"), )); } + # remove broken parentlink to ./index.html on home page's translations + if ($template->param('parentlinks') + && istranslation($page) + && $masterpage eq "index") { + $template->param('parentlinks' => []); + } } # }}} sub editcontent () { #{{{ diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 6aa63b429..61ed9e107 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -259,13 +259,6 @@ be fixed by something like [[todo/using_meta_titles_for_parentlinks]]. Which configuration settings are safe enough for websetup? -### parentlinks - -When the wiki home page is translatable, the parentlinks plugin sets -`./index.html` as its translations' single parent link. Ideally, the -home page's translations should get no parent link at all, just like -the version written in the master language. - ### backlinks If a given translatable `sourcepage.mdwn` links to \[[destpage]], -- cgit v1.2.3 From 225e21f6c5da40f3beea27e084515daf83471d95 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Tue, 4 Nov 2008 23:32:32 +0100 Subject: po plugin: redesign refresh mechanism after master page update manually triggering IkiWiki::refresh() was at least dubious, and more or less buggy (it randomly broke the whole backlinks feature); thinking a bit more to add the necessary bits to @needsbuild seems like a better way. don't play with ikiwiki's internals if not absolutely needed. Signed-off-by: intrigeri --- IkiWiki/Plugin/po.pm | 20 ++++++++++++-------- doc/plugins/po.mdwn | 6 ------ 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index a5bf4fb54..936fe3c49 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -112,14 +112,16 @@ sub checkconfig () { #{{{ sub potfile ($) { #{{{ my $masterfile=shift; (my $name, my $dir, my $suffix) = fileparse($masterfile, qr/\.[^.]*/); - return File::Spec->catfile($dir, $name . ".pot"); + $dir='' if $dir eq './'; + return File::Spec->catpath('', $dir, $name . ".pot"); } #}}} sub pofile ($$) { #{{{ my $masterfile=shift; my $lang=shift; (my $name, my $dir, my $suffix) = fileparse($masterfile, qr/\.[^.]*/); - return File::Spec->catfile($dir, $name . "." . $lang . ".po"); + $dir='' if $dir eq './'; + return File::Spec->catpath('', $dir, $name . "." . $lang . ".po"); } #}}} sub refreshpot ($) { #{{{ @@ -173,17 +175,22 @@ sub needsbuild () { #{{{ # refresh/create POT and PO files as needed my $updated_po_files=0; foreach my $page (keys %pagesources) { - my $pageneedsbuild = grep { $_ eq $pagesources{$page} } @$needsbuild; if (istranslatable($page)) { + my $pageneedsbuild = grep { $_ eq $pagesources{$page} } @$needsbuild; + my $updated_pot_file=0; my $file=srcfile($pagesources{$page}); if ($pageneedsbuild || ! -e potfile($file)) { refreshpot($file); + $updated_pot_file=1; } my @pofiles; foreach my $lang (keys %{$config{po_slave_languages}}) { my $pofile=pofile($file, $lang); - if ($pageneedsbuild || ! -e $pofile) { + my $pofile_rel=pofile($pagesources{$page}, $lang); + if ($pageneedsbuild || $updated_pot_file || ! -e $pofile) { push @pofiles, $pofile; + push @$needsbuild, $pofile_rel + unless grep { $_ eq $pofile_rel } @$needsbuild; } } if (@pofiles) { @@ -194,7 +201,7 @@ sub needsbuild () { #{{{ } } - # check staged changes in and trigger a wiki refresh. + # check staged changes in if ($updated_po_files) { if ($config{rcs}) { IkiWiki::disable_commit_hook(); @@ -203,8 +210,6 @@ sub needsbuild () { #{{{ IkiWiki::enable_commit_hook(); IkiWiki::rcs_update(); } - IkiWiki::refresh(); - IkiWiki::saveindex(); # refresh module's private variables undef %filtered; undef %translations; @@ -213,7 +218,6 @@ sub needsbuild () { #{{{ } } - # make existing translations depend on the corresponding master page foreach my $master (keys %translations) { foreach my $slave (values %{$translations{$master}}) { diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 61ed9e107..173a26ac4 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -242,12 +242,6 @@ gettext/po4a rough corners Misc. improvements ------------------ -### automatic POT/PO update - -- Use the `change` hook instead of `needsbuild`? -- Fix (apparently harmless) undefined values that pollute logs when - saving a master page in the CGI - ### page titles Use nice page titles from meta plugin in links, as inline already -- cgit v1.2.3