summaryrefslogtreecommitdiff
path: root/doc/plugins/format/discussion.mdwn
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-11-11 17:52:32 -0500
committerJoey Hess <joey@kodama.kitenet.net>2008-11-11 17:52:32 -0500
commit2a56ec664402e21625e9251dcbb3b53490e7ed0d (patch)
treea3b8ca059cd5b671721b071f4d30786a389d7196 /doc/plugins/format/discussion.mdwn
parentf6db9205369d1197bbd05f3e07ed79393b5fe220 (diff)
parentd1b22b252481134815b1d02d564b6b9622fe7b4b (diff)
Merge branch 'master' into po
Diffstat (limited to 'doc/plugins/format/discussion.mdwn')
-rw-r--r--doc/plugins/format/discussion.mdwn15
1 files changed, 15 insertions, 0 deletions
diff --git a/doc/plugins/format/discussion.mdwn b/doc/plugins/format/discussion.mdwn
new file mode 100644
index 000000000..df8448ed6
--- /dev/null
+++ b/doc/plugins/format/discussion.mdwn
@@ -0,0 +1,15 @@
+Is there any way to tell if an htmlize hook have been called from a format directive?
+
+I am currently modifying the [[contrib/highlightcode]] plugin by [[sabr]] and I wanted to have a different behavior depending on the fact that the htmlize hook is called from a format directive or not. For instance, this could disable the raw copy of the highlighted code. Since I have enabled the keepextension option, I tried to rely on the page extension to decide whenever I have to create the raw file or not but this does not seems a reliable approach.
+
+One possible solution is to add an optional parameter to the htmlize hook (and thus to htmlize function in IkiWiki.pm) which could tell if this is the format directive that called the function but I am not sure that is a good way to do this.
+
+> It's (probably) not just the format directive that has a potential problem here.
+> Imagine a syntax highlighted source code file that contains some other
+> directive, such as table or meta. Such a directive calls `htmlize` on the
+> parameters passed to it.
+>
+> There is one way to detect this ATM. If `%IkiWiki::preprocessing` has
+> anything in it, then ikiwiki is in the middle of handling a preprocessing
+> directive. So you could check that. It's getting into internals, so not
+> ideal.. --[[Joey]]