Improve processors
Now you can add generators and extend the markdown parser
This commit is contained in:
@ -18,8 +18,9 @@ class CommonMarkConverter extends \League\CommonMark\CommonMarkConverter
|
||||
|
||||
$this->extendEnvironment($environment);
|
||||
|
||||
//TODO :: finish
|
||||
//$daux->getProcessor()->extendCommonMarkEnvironment($environment);
|
||||
if (array_key_exists('processor_instance', $config['daux'])) {
|
||||
$config['daux']['processor_instance']->extendCommonMarkEnvironment($environment);
|
||||
}
|
||||
|
||||
$this->docParser = new DocParser($environment);
|
||||
$this->htmlRenderer = new HtmlRenderer($environment);
|
||||
|
10
libs/Format/Base/Generator.php
Normal file
10
libs/Format/Base/Generator.php
Normal file
@ -0,0 +1,10 @@
|
||||
<?php namespace Todaymade\Daux\Format\Base;
|
||||
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Todaymade\Daux\Daux;
|
||||
|
||||
interface Generator
|
||||
{
|
||||
public function generate(Daux $daux, InputInterface $input, OutputInterface $output, $width);
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
<?php namespace Todaymade\Daux\Format\Confluence;
|
||||
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Todaymade\Daux\Config;
|
||||
use Todaymade\Daux\Daux;
|
||||
@ -7,7 +8,7 @@ use Todaymade\Daux\Format\Base\RunAction;
|
||||
use Todaymade\Daux\Tree\Content;
|
||||
use Todaymade\Daux\Tree\Directory;
|
||||
|
||||
class Generator
|
||||
class Generator implements \Todaymade\Daux\Format\Base\Generator
|
||||
{
|
||||
use RunAction;
|
||||
|
||||
@ -16,7 +17,7 @@ class Generator
|
||||
*/
|
||||
protected $prefix;
|
||||
|
||||
public function generate(Daux $daux, OutputInterface $output, $width)
|
||||
public function generate(Daux $daux, InputInterface $input, OutputInterface $output, $width)
|
||||
{
|
||||
$confluence = $daux->getParams()['confluence'];
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
<?php namespace Todaymade\Daux\Format\HTML;
|
||||
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Todaymade\Daux\Config;
|
||||
use Todaymade\Daux\Daux;
|
||||
@ -9,12 +10,14 @@ use Todaymade\Daux\Generator\Helper;
|
||||
use Todaymade\Daux\Tree\Directory;
|
||||
use Todaymade\Daux\Tree\Content;
|
||||
|
||||
class Generator
|
||||
class Generator implements \Todaymade\Daux\Format\Base\Generator
|
||||
{
|
||||
use RunAction;
|
||||
|
||||
public function generate(Daux $daux, $destination, OutputInterface $output, $width)
|
||||
public function generate(Daux $daux, InputInterface $input, OutputInterface $output, $width)
|
||||
{
|
||||
$destination = $input->getOption('destination');
|
||||
|
||||
$params = $daux->getParams();
|
||||
if (is_null($destination)) {
|
||||
$destination = $daux->local_base . DS . 'static';
|
||||
|
Reference in New Issue
Block a user