2015-07-17 18:34:00 +02:00
|
|
|
<?php namespace Todaymade\Daux;
|
|
|
|
|
|
|
|
use League\CommonMark\Environment;
|
|
|
|
use Symfony\Component\Console\Output\OutputInterface;
|
2015-07-21 09:51:55 +02:00
|
|
|
use Todaymade\Daux\Tree\Root;
|
2015-07-17 18:34:00 +02:00
|
|
|
|
|
|
|
class Processor
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var Daux
|
|
|
|
*/
|
|
|
|
protected $daux;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var OutputInterface
|
|
|
|
*/
|
|
|
|
protected $output;
|
|
|
|
|
|
|
|
/**
|
2016-07-27 21:32:51 +02:00
|
|
|
* @var int
|
2015-07-17 18:34:00 +02:00
|
|
|
*/
|
|
|
|
protected $width;
|
|
|
|
|
2015-07-17 23:38:06 +02:00
|
|
|
/**
|
2016-07-27 21:32:51 +02:00
|
|
|
* @param int $width
|
2015-07-17 23:38:06 +02:00
|
|
|
*/
|
2015-07-17 18:34:00 +02:00
|
|
|
public function __construct(Daux $daux, OutputInterface $output, $width)
|
|
|
|
{
|
|
|
|
$this->daux = $daux;
|
|
|
|
$this->output = $output;
|
|
|
|
$this->width = $width;
|
|
|
|
}
|
|
|
|
|
2015-07-17 23:38:06 +02:00
|
|
|
/**
|
|
|
|
* With this connection point, you can transform
|
|
|
|
* the tree as you want, move pages, modify
|
|
|
|
* pages and even add new ones.
|
|
|
|
*/
|
2020-04-22 22:24:52 +02:00
|
|
|
public function manipulateTree(/* @scrutinizer ignore-unused */ Root $root)
|
2015-07-17 18:34:00 +02:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2015-07-17 23:38:06 +02:00
|
|
|
/**
|
|
|
|
* This connection point provides
|
|
|
|
* a way to extend the Markdown
|
|
|
|
* parser and renderer.
|
|
|
|
*/
|
2020-04-22 22:24:52 +02:00
|
|
|
public function extendCommonMarkEnvironment(/* @scrutinizer ignore-unused */ Environment $environment)
|
2015-07-17 18:34:00 +02:00
|
|
|
{
|
|
|
|
}
|
2015-07-19 00:55:57 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Provide new generators with this extension point. You
|
|
|
|
* can simply return an array, the key is the format's
|
|
|
|
* name, the value is a class name implementing the
|
|
|
|
* `Todaymade\Daux\Format\Base\Generator` contract.
|
|
|
|
* You can also replace base generators.
|
|
|
|
*
|
2015-07-28 17:25:03 +02:00
|
|
|
* @return string[]
|
2015-07-19 00:55:57 +02:00
|
|
|
*/
|
|
|
|
public function addGenerators()
|
|
|
|
{
|
|
|
|
return [];
|
|
|
|
}
|
2015-07-28 17:25:03 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Provide new content Types to be used during the generation
|
|
|
|
* phase, with this you can change the markdown parser or add
|
|
|
|
* a completely different file type.
|
|
|
|
*
|
2015-10-28 00:18:29 +01:00
|
|
|
* @return \Todaymade\Daux\ContentTypes\ContentType[]
|
2015-07-28 17:25:03 +02:00
|
|
|
*/
|
|
|
|
public function addContentType()
|
|
|
|
{
|
|
|
|
return [];
|
|
|
|
}
|
2015-07-17 18:34:00 +02:00
|
|
|
}
|