]> sipb.mit.edu Git - ikiwiki.git/blobdiff - doc/plugins/toc/discussion.mdwn
workaround noworkaround
[ikiwiki.git] / doc / plugins / toc / discussion.mdwn
index a09ae57034525d9081f3c03bdb7f4a393d69bb18..11c874fcb36bd2c7497c2692d74e8cd4042ffaeb 100644 (file)
@@ -8,3 +8,24 @@ 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]]
+
+Just ran into a side effect of `\[[!toc]]` being a NOP in pages
+which are inlined: pages with `\[[!template id=note text="[[!toc]]"]]`
+wound up having the note rendered in feeds as "Use this template
+to insert a note into a page". Worked around this by making a local
+copy of the template and removing its `<TMPL_UNLESS text>...</TMPL_UNLESS>`
+section. Besides needing to generate guaranteed-unique anchor names,
+are there other reasons this directive couldn't be made to work on
+inlined pages?  --[[schmonz]]
+
+> Workaround: `\[[!template id=note text=" [[!toc]]"]]`
+> (with whitespace) should work, because then Perl will consider
+> the string to be a true value.
+>
+> Longer-term, my branch on [[bugs/template_creation_error]]
+> aims to fix this sort of thing. --[[smcv]]
+
+>> Workaround seems not to. Maybe whitespace is getting trimmed
+>> along the way and it stays falsish. Interested in your branch;
+>> sorry I can't offer precise feedback right now, but it looks sane
+>> at a glance. --[[schmonz]]