php-textile icon indicating copy to clipboard operation
php-textile copied to clipboard

Add 'xyz' blocks please.

Open netcarver opened this issue 14 years ago • 4 comments

Ok, I've received enough of these requests to get me to try out a new feature that allows you to extend textile's block handling by registering your own handlers.

You want an 'xyz.' handler -- no problem, you can add your own.

Look at the feature-block-plugins branch for how to go about extending textile via 'textplugs' -- textile style plugins. Brief documentation in extending textile.

The branch includes a directory 'textplugs-available\external' that has implementations of a couple of additional block level handlers ('hr.' and 'bcphp.') that I've been asked for before.

As always, feature- branches are for testing only, not for live deployment.

netcarver avatar Jan 10 '11 01:01 netcarver

I still like the idea.. and actually use it (merged it into 2.5 at some point).. what's the future of this feature?

jdlx avatar Jun 03 '14 12:06 jdlx

@gocom What's your take on allowing block-level 'plugins' for textile?

netcarver avatar Jun 04 '14 21:06 netcarver

Tags should map to objects. Each tag, attribute and so should be implemented as its own class and be extendable that way, and allowing new tags to be registered. E.g.

namespace Netcarver\Textile\Tag;

class BlockQuoteTag extends BaseBlockTag
{
    public function getTagIdentifier()
    {
        return 'bc';
    }

    public function getTagAttributes()
    {
        return array(
            new Attribute/ClassAttribute,
            new Attribute/IdAttribute,
            new Attribute/CiteAttribute,
        );
    }
}

gocom avatar Jun 05 '14 21:06 gocom

So except for the coding approach (which was whipped up by steve rather casually back then) you'd be generally d'accord with the feature per se?

jdlx avatar Jun 05 '14 22:06 jdlx