aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag
diff options
context:
space:
mode:
authorMartin Trigaux <me@mart-e.be>2017-10-28 14:49:14 +0200
committerMartin Trigaux <me@mart-e.be>2017-10-28 14:49:14 +0200
commitc779373f2cafd191771dc575252cfc28c7b7539f (patch)
treef29fcbcf194fb8676ebb6fc3497f9c2149be8678 /src/Wallabag
parenta6e9ad0b7d4108a170b7d2e43576377bb0ad7516 (diff)
downloadwallabag-c779373f2cafd191771dc575252cfc28c7b7539f.tar.gz
wallabag-c779373f2cafd191771dc575252cfc28c7b7539f.tar.zst
wallabag-c779373f2cafd191771dc575252cfc28c7b7539f.zip
Set the title in a separated chapter
Set the export option on the same page, same as done in producePdf Move the ToC at the end of the book so the title page is the first one
Diffstat (limited to 'src/Wallabag')
-rw-r--r--src/Wallabag/CoreBundle/Helper/EntriesExport.php9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/Wallabag/CoreBundle/Helper/EntriesExport.php b/src/Wallabag/CoreBundle/Helper/EntriesExport.php
index 1b4afa3b..5d2fca31 100644
--- a/src/Wallabag/CoreBundle/Helper/EntriesExport.php
+++ b/src/Wallabag/CoreBundle/Helper/EntriesExport.php
@@ -174,8 +174,6 @@ class EntriesExport
174 $book->setCoverImage('Cover.png', file_get_contents($this->logoPath), 'image/png'); 174 $book->setCoverImage('Cover.png', file_get_contents($this->logoPath), 'image/png');
175 } 175 }
176 176
177 $book->buildTOC();
178
179 /* 177 /*
180 * Adding actual entries 178 * Adding actual entries
181 */ 179 */
@@ -190,12 +188,13 @@ class EntriesExport
190 // in filenames, we limit to A-z/0-9 188 // in filenames, we limit to A-z/0-9
191 $filename = preg_replace('/[^A-Za-z0-9\-]/', '', $entry->getTitle()); 189 $filename = preg_replace('/[^A-Za-z0-9\-]/', '', $entry->getTitle());
192 190
193 $titlepage = "<h1>".$entry->getTitle()."</h1>"; 191 $titlepage = $content_start . "<h1>".$entry->getTitle()."</h1>" . $this->getExportInformation('PHPePub') . $bookEnd;
194 $chapter = $content_start . $titlepage . $entry->getContent() . $bookEnd; 192 $book->addChapter("Title", 'Title.html', $titlepage, true, EPub::EXTERNAL_REF_ADD);
193 $chapter = $content_start . $entry->getContent() . $bookEnd;
195 $book->addChapter($entry->getTitle(), htmlspecialchars($filename) . '.html', $chapter, true, EPub::EXTERNAL_REF_ADD); 194 $book->addChapter($entry->getTitle(), htmlspecialchars($filename) . '.html', $chapter, true, EPub::EXTERNAL_REF_ADD);
196 } 195 }
197 196
198 $book->addChapter('Notices', 'Cover2.html', $content_start . $this->getExportInformation('PHPePub') . $bookEnd); 197 $book->buildTOC();
199 198
200 return Response::create( 199 return Response::create(
201 $book->getBook(), 200 $book->getBook(),