[dokuwiki] Re: Headlines in plugin output should show up in TOC
- From: Chris Smith <chris@xxxxxxxxxxxxx>
- To: dokuwiki@xxxxxxxxxxxxx
- Date: Tue, 27 Jun 2006 17:51:39 +0100
Dave Kliczbor wrote:
By now, text enclosed in <timed 2006-07-01>...</timed> will hide itself
on 2006-07-01 (not in the source, of course ;).
But until that, I want headlines enclosed in <timed> to show up in the
tables of contents box. As of now, they don't ever show up.
How can I achieve this?
Your use of modes and allowedModes is a little confusing.
substition is normally used for syntax modes which substitute output in
place of the wiki markup. They use a special pattern rather than
entry/exit patterns and because they substitute whole, they have no
chance to accept other syntax modes.
Also, there shouldn't be any need to override the accepts() method if
you use getAllowedTypes. Handling both methods in your plugin is redundant.
If you use entry / exit patterns and allow modes to occur within your
markup, then DokuWiki will handle those modes itself. That means you
shouldn't receive any DokuWiki markup in the unmatched content, it
should be plain CDATA.
I think you're best bet would be to either:
- use a single special pattern and pass the content between your tags to
p_get_instructions() in the handle() method, saving the results as data
to be used by a call to p_render() in the render() method.
- do something similar with an entry and exit pattern - but don't accept
any other syntax modes within your own mode. fyi, you can use "<" and
">" in look ahead patterns now.
To merge your headlines with the TOC, take a look at the include plugin,
it has functions to merge the headings from a separate page into the
current page TOC, something that isn't all that different from what you
are trying to do.
--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist
Other related posts: