php-textile
php-textile copied to clipboard
Add 'xyz' blocks please.
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.
I still like the idea.. and actually use it (merged it into 2.5 at some point).. what's the future of this feature?
@gocom What's your take on allowing block-level 'plugins' for textile?
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,
);
}
}
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?