[dokuwiki] Re: plugin question: nesting?

Thanks for the response.

On 7/26/05, Chris Smith <chris@xxxxxxxxxxxxx> wrote:
> Which parser modes are you including?

First, I started with what was on the using_allowedmodes page, since
then I've tried:

           $this->allowedModes = array_merge (
                $PARSER_MODES['container'],
                $PARSER_MODES['baseonly'],
                $PARSER_MODES['formatting'],
                $PARSER_MODES['substition'],
                $PARSER_MODES['protected'],
                $PARSER_MODES['disabled'],
                $PARSER_MODES['paragraphs']
            );

> If your plugin is of type container, you should probably include everything
> except other containers.  Refer to the page
> http://wiki.splitbrain.org/wiki:syntax_plugins#using_allowedmodes

...as well as leaving out 'container' and a few other combinations.

I'm not sure I follow what you mean by / how to 'include everything except
other containers' -- is there a way to exclude things at a finer granularity
than 'containers'?

It's been clear to me from when I started trying to put a plugin together
that I'm not really getting the concepts behind the modes -- I've
looked at the comments in inc/parser/parser.php, but that hasn't helped
my understanding.  Any help in resolving my lack of understanding
would be appreciated. 

> Also take a look at the code posted for the folded plugin, slightly modified
> version at http://wiki.splitbrain.org/plugin:inline_folding2

I haven't yet noticed too much that's different -- though I'm not counting
folded_count and I'm not using Javascript.  I've tried modifying the value 
returned by getSort() as well, but I confess I don't really get that either.

Commenting/uncommenting:

       if ($mode == substr(get_class($this), 7)) {
            return;
        }

doesn't seem to have an effect in the simple nesting case that I'm testing.
BTW, is that something that should be done in the inline_folding plugin
too?

On a side note, is there something that can be done to hide away instances
of:

substr(get_class($this), 7)

?  I imagine it'll be a bit disturbing to have to come back to that in a while
and wonder what  that means...
--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist

Other related posts: