toc: Add the table of contents at sanitize time, rather than at format time. This...
authorJoey Hess <joey@kodama.kitenet.net>
Sat, 26 Apr 2008 19:13:01 +0000 (15:13 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Sat, 26 Apr 2008 19:13:01 +0000 (15:13 -0400)
IkiWiki/Plugin/toc.pm
debian/changelog
doc/plugins/toc/discussion.mdwn

index 639cae4a90e88d437824f51689824fa1b30e95ca..5380dd9658d5ecbfa71b335edd7830628c83a88b 100644 (file)
@@ -9,7 +9,7 @@ use HTML::Parser;
 
 sub import { #{{{
        hook(type => "preprocess", id => "toc", call => \&preprocess);
-       hook(type => "format", id => "toc", call => \&format);
+       hook(type => "sanitize", id => "toc", call => \&sanitize);
 } # }}}
 
 my %tocpages;
@@ -33,7 +33,7 @@ sub preprocess (@) { #{{{
        }
 } # }}}
 
-sub format (@) { #{{{
+sub sanitize (@) { #{{{
        my %params=@_;
        my $content=$params{content};
        
index d851f35f61c8ed0ef3996b42c005ce9ebcf9876c..bcf3c9ac5a4a7b9623e2b9a6cbb150f511607113 100644 (file)
@@ -1,3 +1,11 @@
+ikiwiki (2.45) UNRELEASED; urgency=low
+
+  * toc: Add the table of contents at sanitize time, rather than at format
+    time. This allows the toc to be displayed when previewing an edit. It also
+    avoids headers in the page template from showing up in the toc.
+
+ -- Joey Hess <joeyh@debian.org>  Sat, 26 Apr 2008 15:09:36 -0400
+
 ikiwiki (2.44) unstable; urgency=medium
 
   * Bring back the svnrepo setup file option. This is needed for
index dc622425a6f72d46c54b093b12516e3cc84a5758..a09ae57034525d9081f3c03bdb7f4a393d69bb18 100644 (file)
@@ -6,3 +6,5 @@ picks it up.  I suppose it parses the entire page rather than just the
 rendered content. --[[JasonBlevins]]
 
 Why doesn't the TOC appear in the edit page preview?  It only appears when the page is finally rendered.  This makes it somewhat difficult to organize headings, saving & re-editing all the time.  My user page currently has a toc to play with: --[[sabr]]
+
+> Fixed. --[[Joey]]