diff options
author | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2006-07-27 23:47:13 +0000 |
---|---|---|
committer | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2006-07-27 23:47:13 +0000 |
commit | 22df49a2bf92302d4c6e25a04e9c7589a93844a9 (patch) | |
tree | 3ca84ddd7cf831b37867a6a468e552d9e46ccbee | |
parent | dea23a1031b55dbc408e9f99c761fd667331cccd (diff) |
more destpage improvements
-rw-r--r-- | IkiWiki/Plugin/meta.pm | 1 | ||||
-rw-r--r-- | IkiWiki/Plugin/tag.pm | 1 | ||||
-rw-r--r-- | doc/plugins/write.mdwn | 14 |
3 files changed, 16 insertions, 0 deletions
diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm index 5691ff6a9..15a8bad84 100644 --- a/IkiWiki/Plugin/meta.pm +++ b/IkiWiki/Plugin/meta.pm @@ -26,6 +26,7 @@ sub preprocess (@) { #{{{ delete $params{$key}; my $page=$params{page}; delete $params{page}; + delete $params{destpage}; eval q{use CGI 'escapeHTML'}; diff --git a/IkiWiki/Plugin/tag.pm b/IkiWiki/Plugin/tag.pm index f1f3b77f5..957fd986d 100644 --- a/IkiWiki/Plugin/tag.pm +++ b/IkiWiki/Plugin/tag.pm @@ -22,6 +22,7 @@ sub preprocess (@) { #{{{ my %params=@_; my $page = $params{page}; delete $params{page}; + delete $params{destpage}; $tags{$page} = []; foreach my $tag (keys %params) { diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 16b6e9d8e..24da94dd5 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -169,6 +169,20 @@ use the following hashes, using a page name as the key: it is by using the IkiWiki::add_depends function, which takes as its parameters the page name and a [[GlobList]] of dependencies to add. +# A note on generating html links + +Many plugins need to generate html links and add them to a page. This is +done by using the htmllink() function in ikiwiki. The usual way to call +htmlllink is: `htmllink($page, $page, $link)` + +Why is $page repeated? Because if a page is inlined inside another, and a +link is placed on it, the right way to make that link is actually: +`htmllink($page, $destpage, $link)` + +Here $destpage is the inlining page. A destpage parameter is passed to some +of the hook functions above; the ones that are not passed it are not used +during inlining and don't need to worry about this issue. + # RCS plugins ikiwiki's support for revision control systems also uses pluggable perl |