Extract ContentType from format

This commit is contained in:
Stéphane Goetz 2015-07-29 22:31:41 +02:00
parent 386f323dd0
commit e543a107b1
13 changed files with 14 additions and 18 deletions

View File

@ -1,4 +1,4 @@
<?php namespace Todaymade\Daux\Format\Base\ContentTypes; <?php namespace Todaymade\Daux\ContentTypes;
use Todaymade\Daux\Config; use Todaymade\Daux\Config;

View File

@ -1,4 +1,4 @@
<?php namespace Todaymade\Daux\Format\Base\ContentTypes; <?php namespace Todaymade\Daux\ContentTypes;
use Todaymade\Daux\Tree\Content; use Todaymade\Daux\Tree\Content;

View File

@ -1,4 +1,4 @@
<?php namespace Todaymade\Daux\Format\Base\ContentTypes\Markdown; <?php namespace Todaymade\Daux\ContentTypes\Markdown;
use League\CommonMark\DocParser; use League\CommonMark\DocParser;
use League\CommonMark\Environment; use League\CommonMark\Environment;

View File

@ -1,8 +1,8 @@
<?php namespace Todaymade\Daux\Format\Base\ContentTypes\Markdown; <?php namespace Todaymade\Daux\ContentTypes\Markdown;
use Todaymade\Daux\Config; use Todaymade\Daux\Config;
class ContentType implements \Todaymade\Daux\Format\Base\ContentTypes\ContentType class ContentType implements \Todaymade\Daux\ContentTypes\ContentType
{ {
/** @var Config */ /** @var Config */
protected $config; protected $config;

View File

@ -1,4 +1,4 @@
<?php namespace Todaymade\Daux\Format\Base\ContentTypes\Markdown; <?php namespace Todaymade\Daux\ContentTypes\Markdown;
use League\CommonMark\HtmlElement; use League\CommonMark\HtmlElement;
use League\CommonMark\HtmlRendererInterface; use League\CommonMark\HtmlRendererInterface;

View File

@ -1,7 +1,7 @@
<?php namespace Todaymade\Daux; <?php namespace Todaymade\Daux;
use Symfony\Component\Console\Output\NullOutput; use Symfony\Component\Console\Output\NullOutput;
use Todaymade\Daux\Format\Base\ContentTypes\ContentTypeHandler; use Todaymade\Daux\ContentTypes\ContentTypeHandler;
use Todaymade\Daux\Tree\Builder; use Todaymade\Daux\Tree\Builder;
use Todaymade\Daux\Tree\Root; use Todaymade\Daux\Tree\Root;
@ -19,7 +19,7 @@ class Daux
/** @var \Todaymade\Daux\Format\Base\Generator */ /** @var \Todaymade\Daux\Format\Base\Generator */
protected $generator; protected $generator;
/** @var \Todaymade\Daux\Format\Base\ContentTypes\ContentTypeHandler */ /** @var ContentTypeHandler */
protected $typeHandler; protected $typeHandler;
/** /**

View File

@ -1,7 +1,7 @@
<?php namespace Todaymade\Daux\Format\Base; <?php namespace Todaymade\Daux\Format\Base;
use Todaymade\Daux\Config; use Todaymade\Daux\Config;
use Todaymade\Daux\Format\Base\ContentTypes\ContentType; use Todaymade\Daux\ContentTypes\ContentType;
use Todaymade\Daux\Tree\Content; use Todaymade\Daux\Tree\Content;
abstract class ContentPage extends SimplePage abstract class ContentPage extends SimplePage

View File

@ -3,7 +3,6 @@
use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Output\OutputInterface;
use Todaymade\Daux\Daux; use Todaymade\Daux\Daux;
use Todaymade\Daux\Format\Base\ContentTypes\ContentTypeHandler;
interface Generator interface Generator
{ {

View File

@ -2,7 +2,7 @@
use League\CommonMark\Environment; use League\CommonMark\Environment;
class CommonMarkConverter extends \Todaymade\Daux\Format\Base\ContentTypes\Markdown\CommonMarkConverter class CommonMarkConverter extends \Todaymade\Daux\ContentTypes\Markdown\CommonMarkConverter
{ {
protected function getLinkRenderer(Environment $environment) protected function getLinkRenderer(Environment $environment)
{ {

View File

@ -2,7 +2,7 @@
use Todaymade\Daux\Config; use Todaymade\Daux\Config;
class ContentType extends \Todaymade\Daux\Format\Base\ContentTypes\Markdown\ContentType class ContentType extends \Todaymade\Daux\ContentTypes\Markdown\ContentType
{ {
public function __construct(Config $config) public function __construct(Config $config)
{ {

View File

@ -5,7 +5,7 @@ use League\CommonMark\HtmlRendererInterface;
use League\CommonMark\Inline\Element\AbstractInline; use League\CommonMark\Inline\Element\AbstractInline;
use League\CommonMark\Inline\Element\Link; use League\CommonMark\Inline\Element\Link;
class LinkRenderer extends \Todaymade\Daux\Format\Base\ContentTypes\Markdown\LinkRenderer class LinkRenderer extends \Todaymade\Daux\ContentTypes\Markdown\LinkRenderer
{ {
/** /**
* @param Link $inline * @param Link $inline

View File

@ -5,8 +5,6 @@ use Symfony\Component\Console\Output\OutputInterface;
use Todaymade\Daux\Config; use Todaymade\Daux\Config;
use Todaymade\Daux\Console\RunAction; use Todaymade\Daux\Console\RunAction;
use Todaymade\Daux\Daux; use Todaymade\Daux\Daux;
use Todaymade\Daux\Format\Base\ContentTypes\ContentTypeHandler;
use Todaymade\Daux\Format\Confluence\CommonMark\CommonMarkConverter;
use Todaymade\Daux\Tree\Content; use Todaymade\Daux\Tree\Content;
use Todaymade\Daux\Tree\Directory; use Todaymade\Daux\Tree\Directory;

View File

@ -4,10 +4,9 @@ use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Output\OutputInterface;
use Todaymade\Daux\Config; use Todaymade\Daux\Config;
use Todaymade\Daux\Console\RunAction; use Todaymade\Daux\Console\RunAction;
use Todaymade\Daux\ContentTypes\Markdown\ContentType;
use Todaymade\Daux\Daux; use Todaymade\Daux\Daux;
use Todaymade\Daux\DauxHelper; use Todaymade\Daux\DauxHelper;
use Todaymade\Daux\Format\Base\CommonMark\CommonMarkConverter;
use Todaymade\Daux\Format\Base\ContentTypes\ContentTypeHandler;
use Todaymade\Daux\Format\Base\LiveGenerator; use Todaymade\Daux\Format\Base\LiveGenerator;
use Todaymade\Daux\GeneratorHelper; use Todaymade\Daux\GeneratorHelper;
use Todaymade\Daux\Tree\Content; use Todaymade\Daux\Tree\Content;
@ -36,7 +35,7 @@ class Generator implements \Todaymade\Daux\Format\Base\Generator, LiveGenerator
public function getContentTypes() public function getContentTypes()
{ {
return [ return [
new \Todaymade\Daux\Format\Base\ContentTypes\Markdown\ContentType($this->daux->getParams()) 'markdown' => new ContentType($this->daux->getParams())
]; ];
} }