Repair single page documentation generator

This commit is contained in:
Stéphane Goetz 2017-12-11 22:25:45 +01:00
parent e12465b4de
commit da522ba2d3
2 changed files with 9 additions and 2 deletions

View File

@ -95,7 +95,7 @@ class Book
protected function generateCover() protected function generateCover()
{ {
return "<div style='margin:4em 30% 4em 0;'>" . return "<div>" .
"<h1 style='font-size:40pt; margin-bottom:0;'>{$this->cover['title']}</h1>" . "<h1 style='font-size:40pt; margin-bottom:0;'>{$this->cover['title']}</h1>" .
"<p><strong>{$this->cover['subject']}</strong> by {$this->cover['author']}</p>" . "<p><strong>{$this->cover['subject']}</strong> by {$this->cover['author']}</p>" .
'</div><div class="page-break">&nbsp;</div>'; '</div><div class="page-break">&nbsp;</div>';

View File

@ -4,6 +4,7 @@ use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Output\OutputInterface;
use Todaymade\Daux\Console\RunAction; use Todaymade\Daux\Console\RunAction;
use Todaymade\Daux\Daux; use Todaymade\Daux\Daux;
use Todaymade\Daux\Format\HTML\Template;
use Todaymade\Daux\Format\HTML\ContentTypes\Markdown\ContentType; use Todaymade\Daux\Format\HTML\ContentTypes\Markdown\ContentType;
class Generator implements \Todaymade\Daux\Format\Base\Generator class Generator implements \Todaymade\Daux\Format\Base\Generator
@ -18,7 +19,11 @@ class Generator implements \Todaymade\Daux\Format\Base\Generator
*/ */
public function __construct(Daux $daux) public function __construct(Daux $daux)
{ {
$params = $daux->getParams();
$this->daux = $daux; $this->daux = $daux;
$this->templateRenderer = new Template($params);
$params->templateRenderer = $this->templateRenderer;
} }
/** /**
@ -89,7 +94,9 @@ class Generator implements \Todaymade\Daux\Format\Base\Generator
$width, $width,
function () use ($book, $current, $params) { function () use ($book, $current, $params) {
$contentType = $this->daux->getContentTypeHandler()->getType($current); $contentType = $this->daux->getContentTypeHandler()->getType($current);
$content = ContentPage::fromFile($current, $params, $contentType)->getContent(); $content = ContentPage::fromFile($current, $params, $contentType);
$content->templateRenderer = $this->templateRenderer;
$content = $content->getContent();
$book->addPage($current, $content); $book->addPage($current, $content);
} }
); );