2015-04-22 12:23:57 +02:00
|
|
|
<?php namespace Todaymade\Daux\Generator;
|
|
|
|
|
|
|
|
use Todaymade\Daux\Daux;
|
2015-05-21 17:39:11 +02:00
|
|
|
use Todaymade\Daux\Format\HTML\Generator as HTMLGenerator;
|
|
|
|
use Todaymade\Daux\Format\Confluence\Generator as ConfluenceGenerator;
|
2015-04-22 12:23:57 +02:00
|
|
|
|
2015-04-23 00:32:30 +02:00
|
|
|
class Generator
|
|
|
|
{
|
2015-05-21 17:39:11 +02:00
|
|
|
public function generate($options)
|
2015-04-23 00:32:30 +02:00
|
|
|
{
|
2015-04-22 12:23:57 +02:00
|
|
|
$daux = new Daux(Daux::STATIC_MODE);
|
2015-05-21 17:39:11 +02:00
|
|
|
$daux->initialize(null, $options['config']);
|
|
|
|
|
|
|
|
switch(strtolower($options['format'])) {
|
|
|
|
case 'confluence':
|
|
|
|
(new ConfluenceGenerator())->generate($daux, $options['destination']);
|
|
|
|
break;
|
|
|
|
case 'html':
|
|
|
|
default:
|
|
|
|
(new HTMLGenerator())->generate($daux, $options['destination']);
|
2015-04-23 00:32:30 +02:00
|
|
|
}
|
2015-04-22 12:23:57 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
}
|