\n";
@@ -137,32 +138,33 @@ protected function buildEpub(Collection $chapters, array $config, string $curren
$coverDimensions = $config['cover']['dimensions'] ?? 'width: 210mm; height: 297mm; margin: 0;';
$book->setCoverImage($coverImage, file_get_contents($pathCoverImage), mime_content_type($pathCoverImage));
}
- $book->buildTOC(null, "toc", "Table of Contents", true, true);
- $book->addChapter("Notices", "Cover.html", $cover);
- //$book->addChapter("Table of Contents", "TOC.html", null, false, EPub::EXTERNAL_REF_IGNORE);
- //$book->buildTOC();
+
+ $book->addChapter("Cover", "Cover.html", $cover);
+ $book->addChapter("Table of Contents", "TOC.xhtml", null, false, EPub::EXTERNAL_REF_IGNORE);
+
/*
$book->addFileToMETAINF("com.apple.ibooks.display-options.xml", "\n\n \n \n \n \n \n");
*/
- //$book->addCustomNamespace("dc", "http://purl.org/dc/elements/1.1/"); // StaticData::$namespaces["dc"]);
- // This is to show how to use meta data, normally you'd use the $book->setAuthor
- $metaValue = new MetaValue("dc:creator", $this->config->author());
- $metaValue->addOpfAttr("file-as", $this->config->author());
- $metaValue->addOpfAttr("role", "aut");
- $book->addCustomMetaValue($metaValue);
+ $book->addCustomNamespace("dc", "http://purl.org/dc/elements/1.1/"); // StaticData::$namespaces["dc"]);
foreach ($chapters as $key => $chapter) {
$this->output->writeln('==>> ❇️ ' . $chapter["mdfile"] . ' ...');
$book->addChapter(
- Arr::get($chapter, "frontmatter.title", "Chapter " . $key + 1),
- "Chapter" . $key . ".html",
- $content_start . $chapter["html"] . $content_end
+ chapterName: Arr::get($chapter, "frontmatter.title", "Chapter " . $key + 1),
+ fileName: "Chapter" . $key . ".html",
+ chapterData: $content_start . $chapter["html"] . $content_end,
+ externalReferences: EPub::EXTERNAL_REF_ADD
);
//file_put_contents('export/' . "Chapter" . $key . " .html", $content_start . $chapter["html"] . $content_end);
}
- //$book->buildTOC();
+
+ $book->buildTOC(
+ title: "Index",
+ addReferences: false,
+ addToIndex: false
+ );
$book->finalize();
diff --git a/stubs/content/004-writing-content.md b/stubs/content/004-writing-content.md
index 0a9711d..e61dc7e 100644
--- a/stubs/content/004-writing-content.md
+++ b/stubs/content/004-writing-content.md
@@ -10,6 +10,7 @@ This sample content is taken from [Ibis Next: create your eBooks with Markdown](
Inside the `content` directory, you can write multiple `.md` files. Ibis uses the headings to divide the book into parts and chapters:
~~~markdown
+
# Part 1
`
` tags define the start of a part. A separate PDF page will be generated to print the part title and any content below.
diff --git a/stubs/content/006-conclusion.md b/stubs/content/006-conclusion.md
index 224a09e..1ff61f1 100644
--- a/stubs/content/006-conclusion.md
+++ b/stubs/content/006-conclusion.md
@@ -1,3 +1,7 @@
+---
+title: Conclusion and Your Feedback
+---
+
## Conclusion and Your Feedback
Congratulations on exploring the powerful capabilities of Ibis Next for seamless eBook creation!