more destpage improvements
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Thu, 27 Jul 2006 23:47:13 +0000 (23:47 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Thu, 27 Jul 2006 23:47:13 +0000 (23:47 +0000)
IkiWiki/Plugin/meta.pm
IkiWiki/Plugin/tag.pm
doc/plugins/write.mdwn

index 5691ff6a91e8fdba1a468acfe57ee74423b40e3a..15a8bad845f08e389bbc656ff518947ff175c6b9 100644 (file)
@@ -26,6 +26,7 @@ sub preprocess (@) { #{{{
        delete $params{$key};
        my $page=$params{page};
        delete $params{page};
        delete $params{$key};
        my $page=$params{page};
        delete $params{page};
+       delete $params{destpage};
 
        eval q{use CGI 'escapeHTML'};
 
 
        eval q{use CGI 'escapeHTML'};
 
index f1f3b77f5fc6ea8566607279ba3f6c6d4104e1b3..957fd986d69a83496eddced3be5e495f85760477 100644 (file)
@@ -22,6 +22,7 @@ sub preprocess (@) { #{{{
        my %params=@_;
        my $page = $params{page};
        delete $params{page};
        my %params=@_;
        my $page = $params{page};
        delete $params{page};
+       delete $params{destpage};
 
        $tags{$page} = [];
        foreach my $tag (keys %params) {
 
        $tags{$page} = [];
        foreach my $tag (keys %params) {
index 16b6e9d8ed7dd57f06df7e9dfca6ef2211d7807a..24da94dd5b785e3ccd84a21c2e4a42f5688546f1 100644 (file)
@@ -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.
 
   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
 # RCS plugins
 
 ikiwiki's support for revision control systems also uses pluggable perl