On Sun, Feb 20, 2011 at 12:56, Vincent Massol
<vincent(a)massol.net> wrote:
On Feb 20, 2011, at 12:30 PM, Thomas Mortagne wrote:
> On Sun, Feb 20, 2011 at 09:52, Vincent Massol <vincent(a)massol.net> wrote:
>> Hi Thomas,
>>
>> I think it could be a good idea to remove (deprecate?) the current BlockFilter
interface/implementations and instead use the newly introduced BlockMatcher. WDYT?
>>
>> Thanks
>> -Vincent
>>
>
> It's not exactly the same thing. BlockFilter is used to modify the
> tree and can produce new blocks that did not existed (like generating
> a label for a standalone link for example). Impossible to replace it
> with BlockMatcher as it is.
hmmm ok. I was looking at PlainTextBlockFilter which at least could be replaced with a
PlainTextBlockMatcher. Seems we're using BlockFilter for clone() and I thought it
would be better to have clone(BlockMatcher).
Actually no, the link example I just described is used in PlainTextBlockFilter.
Shouldn't we use transformations for modifying an input Block (or XDOM) into another
output Block (XDOM)?
When you write a transformation you have to to the tree parsing, here
the goal was to provide something easy where you just need to
implements BlockFilter.
Indeed it's just that we have 3 notions that seem very close: BlockMatcher,
BlockFilter and Transformation. I thought maybe it was a bit too much and it could be
simpler for users to simplify the API.
We could have a tree iterator that could be used in transformations to traverse the tree
for example (actually we discussed about this together in the paste since several
transformations we currently have duplicate the tree traversal code).