diff options
Diffstat (limited to 'doc/forum/understanding_filter_hooks.mdwn')
-rw-r--r-- | doc/forum/understanding_filter_hooks.mdwn | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/doc/forum/understanding_filter_hooks.mdwn b/doc/forum/understanding_filter_hooks.mdwn new file mode 100644 index 000000000..e6ddc91cc --- /dev/null +++ b/doc/forum/understanding_filter_hooks.mdwn @@ -0,0 +1,17 @@ +Hi All; + +I'm trying to use a filter hook as part of making [[wikilinks|ikiwiki/wikilink]] work in [[plugins/contrib/tex4ht]]. +It seems that filter is called for every page. For my application I just want it to be called for ".tex" files, +but right now I have to have a look at the content, which I don't like so much. + +Is there a better hook to use for this? I need to transform the input before preprocessing. + +[[DavidBremner]] + +>You can check the type of the page without having to look at the content of the page: + + my $page_file=$pagesources{$page}; + my $page_type=pagetype($page_file); + +>Then you can check whether `$page_type` is "tex". +>--[[KathrynAndersen]] |