diff options
author | Joey Hess <joey@kodama.kitenet.net> | 2008-06-28 23:08:24 -0400 |
---|---|---|
committer | Joey Hess <joey@kodama.kitenet.net> | 2008-06-28 23:08:24 -0400 |
commit | b66f9a1981094bc2159a228dfaefc5c2e01ee68a (patch) | |
tree | 47264880d8667dc2411b7392b6c6da3f4ac1a0f1 /doc | |
parent | f8fe1247bdc13533673f217e6c77361a1188d7eb (diff) |
call format hooks when generating page previews
* toc: Revert change in 2.45 that made it run at sanitize time. This breaks
use of toc in a sidebar.
* Call format hooks when generating page previews, thus fixing toc display
there, as well as fixing inlins to again display in page previews, since
it's started using format hooks. This also allows several other things,
like embed, that use format hooks, to work during page preview time.
* Format hooks should not rely on getting an entire html document, as they
will only get the body during page preview.
* toggle: Deal with preview mode when adding javascript.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/bugs/toc_in_sidebar.mdwn | 5 | ||||
-rw-r--r-- | doc/plugins/plaintext/.discussion.mdwn.swp | bin | 12288 -> 0 bytes | |||
-rw-r--r-- | doc/plugins/write.mdwn | 4 |
3 files changed, 8 insertions, 1 deletions
diff --git a/doc/bugs/toc_in_sidebar.mdwn b/doc/bugs/toc_in_sidebar.mdwn index 9286790b8..d2c3ab975 100644 --- a/doc/bugs/toc_in_sidebar.mdwn +++ b/doc/bugs/toc_in_sidebar.mdwn @@ -13,4 +13,9 @@ I can't think of a way between these that works in all cases. Maybe call the format hooks when generating a page preview? Maybe add an option to toc to make it embeddable in the sidebar? +Hmm, I think I need to call format during preview. Another case is that +inline uses a format hook to insert the inlined content.. + --[[Joey]] + +[[done]] diff --git a/doc/plugins/plaintext/.discussion.mdwn.swp b/doc/plugins/plaintext/.discussion.mdwn.swp Binary files differdeleted file mode 100644 index df2347f9e..000000000 --- a/doc/plugins/plaintext/.discussion.mdwn.swp +++ /dev/null diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 35f391f7f..5def4c679 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -220,7 +220,9 @@ and should return the sanitized content. The difference between format and sanitize is that sanitize only acts on the page body, while format can modify the entire html page including the -header and footer inserted by ikiwiki, the html document type, etc. +header and footer inserted by ikiwiki, the html document type, etc. (It +should not rely on always being passed the entire page, as it won't be +when the page is being previewed.) The function is passed named parameters: "page" and "content", and should return the formatted content. |