1 [[!meta title="Cannot manage to inject preprocess_tag"]]
4 I am trying to write a plugin that changes the way the
5 [[ikiwiki/directive/tag]] [[ikiwiki/directive]] works, and I am trying to do so
6 by using the [[inject|plugins/write/#index81h3]] function. The piece of code
7 that should (if I understood well the `inject` function) do the trick is :
11 name => 'IkiWiki::Plugin::tag::preprocess_tag',
12 call => \&my_preprocess_tag
16 Howere, this does not change anything about the effect of the `tag` directive.
18 I have tried some variants, like calling `inject` outside the `import`
19 function, or calling `IkiWiki::loadplugin("tag");` to ensure that the
20 [[plugins/tag]] is loaded, but none of these things work. Any idea?
22 *Disclaimer:* although proficient in several languages, I am a beginner in Perl.
24 Here is the full code of (a very early version of) my plugin.
28 package IkiWiki::Plugin::parenttag;
34 my $orig_preprocess_tag=\&preprocess_tag;
38 name => 'IkiWiki::Plugin::tag::preprocess_tag',
39 call => \&my_preprocess_tag
43 sub my_preprocess_tag(@) {
44 print "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nWorking!\n";