From: Jérémy Benoist Date: Tue, 31 Oct 2017 13:10:41 +0000 (+0200) Subject: Merge pull request #3392 from mart-e/add-title-page-epub X-Git-Tag: 2.3.0~30 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=494b47f29915cc881cfeba14c16b728d3adcb85a;hp=1953a872932a63792293b4aec087880265ba89f7;p=github%2Fwallabag%2Fwallabag.git Merge pull request #3392 from mart-e/add-title-page-epub add the title of article on the epub export --- diff --git a/src/Wallabag/CoreBundle/Helper/EntriesExport.php b/src/Wallabag/CoreBundle/Helper/EntriesExport.php index 830798b8..136f66f5 100644 --- a/src/Wallabag/CoreBundle/Helper/EntriesExport.php +++ b/src/Wallabag/CoreBundle/Helper/EntriesExport.php @@ -174,8 +174,6 @@ class EntriesExport $book->setCoverImage('Cover.png', file_get_contents($this->logoPath), 'image/png'); } - $book->buildTOC(); - /* * Adding actual entries */ @@ -190,11 +188,13 @@ class EntriesExport // in filenames, we limit to A-z/0-9 $filename = preg_replace('/[^A-Za-z0-9\-]/', '', $entry->getTitle()); + $titlepage = $content_start . '

' . $entry->getTitle() . '

' . $this->getExportInformation('PHPePub') . $bookEnd; + $book->addChapter('Title', 'Title.html', $titlepage, true, EPub::EXTERNAL_REF_ADD); $chapter = $content_start . $entry->getContent() . $bookEnd; $book->addChapter($entry->getTitle(), htmlspecialchars($filename) . '.html', $chapter, true, EPub::EXTERNAL_REF_ADD); } - $book->addChapter('Notices', 'Cover2.html', $content_start . $this->getExportInformation('PHPePub') . $bookEnd); + $book->buildTOC(); return Response::create( $book->getBook(),