mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
Add TransformableRenderable capability
This commit is contained in:
25
src/Html/TransformableRenderable.php
Normal file
25
src/Html/TransformableRenderable.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Erusev\Parsedown\Html;
|
||||
|
||||
interface TransformableRenderable extends Renderable
|
||||
{
|
||||
/**
|
||||
* Takes a closure $Transform which will provide a transformation of
|
||||
* a "contained text" into Renderables.
|
||||
*
|
||||
* In order for TransformableRenderable to make sense, a Renderable must
|
||||
* have:
|
||||
* 1. Some concept of "contained text". $Transform can be applied
|
||||
* piece-wise if your container contains logically disjoint sections
|
||||
* of text.
|
||||
* 2. A generic mechanism for containing other Renderables, or replacing
|
||||
* the current renderable with a container.
|
||||
*
|
||||
* It is acceptable to only partially transform "contained text".
|
||||
*
|
||||
* @param \Closure(string):Renderable $Transform
|
||||
* @return Renderable
|
||||
*/
|
||||
public function transformingContent(\Closure $Transform): Renderable;
|
||||
}
|
||||
Reference in New Issue
Block a user