X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/af5299677e3a3bdaef75e72f82ccc4600cbd2f66..6040886c725c6b6a179bf164a34be20dd161f1e2:/doc/todo/color_plugin.mdwn diff --git a/doc/todo/color_plugin.mdwn b/doc/todo/color_plugin.mdwn index fa460a386..ec246f9d6 100644 --- a/doc/todo/color_plugin.mdwn +++ b/doc/todo/color_plugin.mdwn @@ -46,19 +46,37 @@ This is a RC1 of my `color` plugin. It works for me well, but all your comments are very welcome. --[[PaweÅ|ptecza]] > Sure, I have a couple. -> + +>> Great! Thank you very much! --[[PaweÅ|ptecza]] + > The preprocess function is passed named parameters. The hack you have of > hardcoding use of `$_[0]` and `$_[2]` can fail at any time. -> + +>> But the problem is that arguments of my plugin don't have a name. +>> How can I identify them in `params` hash? + +>> Similar hardcoded method I've found in `img` plugin :) But only one +>> argument is not named there (image path). + +>> Maybe I shouldn't use so simple plugin syntax? For following syntax +>> I wouldn't have that problem: + +>> \[[!color fg=white bg=red text="White text on red background"]] + > `replace_preserved_style` is passed a single parameter, so its prototype > should be `($)`, not `(@)`. Ditt `preserve_style`, it should have > `($$)`. -> + +>> OK, it will be fixed. + > The sanitize hook is always passed `$params{content}`, so there should be > no reason to check that it exists. Also, it shouldn't be done in a > sanitize hook, since html sanitization could run _after_ that santize > hook. It should use a format hook. -> + +>> Probably you're right. It was rather paranoid checking ;) Thanks for +>> the hook hint! + > The preprocess hook needs to call `IkiWiki::preprocess` on the content > passed into it if you want to support nesting other preprocessor > directives inside the color directive. See `preprocess_toggleable` in the @@ -68,6 +86,9 @@ comments are very welcome. --[[PaweÅ|ptecza]] > The method used by toggle of using two real `