From da522ba2d303dec181e8f04db03cd7f5f33544cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Goetz?= Date: Mon, 11 Dec 2017 22:25:45 +0100 Subject: [PATCH] Repair single page documentation generator --- libs/Format/HTMLFile/Book.php | 2 +- libs/Format/HTMLFile/Generator.php | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/libs/Format/HTMLFile/Book.php b/libs/Format/HTMLFile/Book.php index 96842a7..3fb4c81 100644 --- a/libs/Format/HTMLFile/Book.php +++ b/libs/Format/HTMLFile/Book.php @@ -95,7 +95,7 @@ class Book protected function generateCover() { - return "
" . + return "
" . "

{$this->cover['title']}

" . "

{$this->cover['subject']} by {$this->cover['author']}

" . '
 
'; diff --git a/libs/Format/HTMLFile/Generator.php b/libs/Format/HTMLFile/Generator.php index 5fbdb05..275769e 100644 --- a/libs/Format/HTMLFile/Generator.php +++ b/libs/Format/HTMLFile/Generator.php @@ -4,6 +4,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Todaymade\Daux\Console\RunAction; use Todaymade\Daux\Daux; +use Todaymade\Daux\Format\HTML\Template; use Todaymade\Daux\Format\HTML\ContentTypes\Markdown\ContentType; 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) { + $params = $daux->getParams(); + $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, function () use ($book, $current, $params) { $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); } );