[dokuwiki] Re: Headlines in plugin output should show up in TOC

  • From: Dave Kliczbor <maligree@xxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Wed, 12 Jul 2006 15:21:38 +0200

hello there!

Thanks for answering, Chris.

I tried to use your comments, but could not get much sense out of it...

Chris Smith schrieb:
> Your use of modes and allowedModes is a little confusing.

That's because I did not understand (yet) what the semantics of each
mode is. http://wiki.splitbrain.org/wiki:syntax_plugins did not really
help me there.
I tried numerous modes and allowedModes but I did not notice any
different behavior, so you just saw my last try.

> 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.

OK. I want to re-feed a whole block into the parser as if it has been
read directly from the file -- without the start and stop tags around
it. Which mode should I use? I'd think container, but that did not work
just like any other mode. Which allowedModes should I use? I would think
all.

> Also, there shouldn't be any need to override the accepts() method if
> you use getAllowedTypes.  Handling both methods in your plugin is
> redundant.

OK, got that.

> 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.

Plain CDATA ... That means which possibility?
 - I receive the verbatim text, including wiki markup, but it wouldn't
    be parsed any more?
 - I receive the verbatim text, wiki markup stripped?
 - I receive the parsed text?

> 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.

Seems to me now that I have no way of telling Lexer->addSpecialPattern()
to do multiline matching.

> - do something similar with an entry and exit pattern - but don't accept
> any other syntax modes within your own mode.

Ummm? As far as I understand, I'd have to accept ALL modes in my block,
since I just want to enable or disable a text block by timestamp. All
text and markup (modes?) in this block should either be normally parsed
or completely ignored.

And what else does "To integrate your Plugin into this system it needs
to specify which type it is and which types can be nested within it."
(from http://wiki.splitbrain.org/wiki:syntax_plugins) mean, if not my
interpretation?

> 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.

Still trying to get a sense out of that plugin code...

cu
 Dave

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

Other related posts: