[dokuwiki] syntax plugins handle vs. render

The plugin page mentions that when developing plugins it is best to do as
much as possible in the handle function.
I'm not sure I understand how it matters?
Let's say i have 3 <h2>s on my page. head1, head2 and head3
Doesn't the handle function find each seperately and then the render
function runs three times?

If I should do most of the work in the handle:
Would it make sense then to process all info based on the found pattern into
an object or array of some sort in the handle function.
Then in the render function wrap the obj pieces around the content?


Another question regarding plugins.

I have a number of very similar syntaxes for this plugin.
a) Is it better to create separate files for each syntax variation (right
now I separate them out)
b) To share common functions between these seperate files would it be
possible to subclass each from a common plugin_syntax class that is based on
syntax.pnp?

Thanks in advance...martin

Other related posts: