[dokuwiki] Re: metadata clearing

Hi Chris

I ran into the same problem as well with the Discussion Plugin. If you
just remove the ~~DISCUSSION~~ command, the comments still show up as
in the metadata the status is unchanged. For the discussion plugin,
it's not so grave because with ~~DISCUSSION:off~~ there's a regular
way to remove the comments. Still, the problem should be addressed.

> My proposal is to:
> - add a PARSER_METADATA_RENDER event wrapped around metadata
> rendering.  Action plugins which add/handle metadata could respond to
> this.

Good idea.

> - add a clear() method to the syntax plugin class.  DW would call that
> method for every syntax plugin prior to processing the instruction
> list.  Syntax plugins that wished to clear out their metadata could
> override the default method (which does nothing).

You mean, before rendering the instructions to XHTML the redirect
plugin could clear its metadata and while processing the instructions
re-adds it, if the redirect instruction is still there. I doubt
whether this is the most elegant solution.

Other alternatives are:
- wipe all metadata before re-rendering

Can all the metadata be easily reproduced by rendering the _current_
page? We currently do not use 'isreferencedby' and 'ispartof', but the
list of contributors might be a problem.

- allow metadata values to be (somehow) marked as persistent when
setting them. Values would not be persistent by default.  The renderer
would wipe all but persistent values before re-rendering.

I think this makes sense. But should this mark be stored with every
value in the metadata or should we rather provide a way for plugins to
register persistent metadata types?

- as above, but mark as non-persistent and default to persistent.

That's the current way - only that non-persistent values are not
marked, but hard-coded for some known types.

Cheers

-- esther
--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist

Other related posts: