Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'xyz' blocks please. #7

Open
netcarver opened this issue Jan 10, 2011 · 4 comments
Open

Add 'xyz' blocks please. #7

netcarver opened this issue Jan 10, 2011 · 4 comments

Comments

@netcarver
Copy link
Contributor

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.

@jdlx
Copy link

jdlx commented Jun 3, 2014

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

@netcarver
Copy link
Contributor Author

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

@gocom
Copy link
Member

gocom commented Jun 5, 2014

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,
        );
    }
}

@jdlx
Copy link

jdlx commented Jun 5, 2014

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants