mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-05 15:32:55 +02:00
Removed manifest output in Epub
This commit is contained in:
parent
9e13f62a89
commit
ccab155e2e
3 changed files with 10 additions and 4 deletions
|
@ -167,6 +167,12 @@ class Epub extends Publication {
|
||||||
|
|
||||||
this.displayOptions = await this.loadDisplayOptions(packaging);
|
this.displayOptions = await this.loadDisplayOptions(packaging);
|
||||||
|
|
||||||
|
if (packaging.coverImagePath) {
|
||||||
|
let cover = this.resources.get(this.resolve(packaging.coverPath))
|
||||||
|
if (cover) {
|
||||||
|
cover.rel.push("cover-image")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,6 +45,7 @@ class Packaging {
|
||||||
throw new Error("No Spine Found");
|
throw new Error("No Spine Found");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.metadata = this.parseMetadata(metadataNode);
|
||||||
this.manifest = this.parseManifest(manifestNode);
|
this.manifest = this.parseManifest(manifestNode);
|
||||||
this.navPath = this.findNavPath(manifestNode);
|
this.navPath = this.findNavPath(manifestNode);
|
||||||
this.ncxPath = this.findNcxPath(manifestNode, spineNode);
|
this.ncxPath = this.findNcxPath(manifestNode, spineNode);
|
||||||
|
@ -56,7 +57,6 @@ class Packaging {
|
||||||
this.spine = this.parseSpine(spineNode, this.manifest);
|
this.spine = this.parseSpine(spineNode, this.manifest);
|
||||||
|
|
||||||
this.uniqueIdentifier = this.findUniqueIdentifier(packageDocument);
|
this.uniqueIdentifier = this.findUniqueIdentifier(packageDocument);
|
||||||
this.metadata = this.parseMetadata(metadataNode);
|
|
||||||
|
|
||||||
this.metadata.direction = spineNode.getAttribute("page-progression-direction");
|
this.metadata.direction = spineNode.getAttribute("page-progression-direction");
|
||||||
|
|
||||||
|
@ -121,7 +121,7 @@ class Packaging {
|
||||||
var items = Array.prototype.slice.call(selected);
|
var items = Array.prototype.slice.call(selected);
|
||||||
|
|
||||||
//-- Create an object with the id as key
|
//-- Create an object with the id as key
|
||||||
items.forEach(function (item) {
|
items.forEach((item) => {
|
||||||
var id = item.getAttribute("id"),
|
var id = item.getAttribute("id"),
|
||||||
href = item.getAttribute("href") || "",
|
href = item.getAttribute("href") || "",
|
||||||
type = item.getAttribute("media-type") || "",
|
type = item.getAttribute("media-type") || "",
|
||||||
|
@ -158,7 +158,7 @@ class Packaging {
|
||||||
// var epubcfi = new EpubCFI();
|
// var epubcfi = new EpubCFI();
|
||||||
|
|
||||||
//-- Add to array to maintain ordering and cross reference with manifest
|
//-- Add to array to maintain ordering and cross reference with manifest
|
||||||
items.forEach(function(item, index){
|
items.forEach((item, index) => {
|
||||||
const idref = item.getAttribute("idref");
|
const idref = item.getAttribute("idref");
|
||||||
const props = item.getAttribute("properties") || "";
|
const props = item.getAttribute("properties") || "";
|
||||||
const propArray = props.length ? props.split(" ") : [];
|
const propArray = props.length ? props.split(" ") : [];
|
||||||
|
|
|
@ -9,7 +9,7 @@ class Resource {
|
||||||
if (item && !item.url) {
|
if (item && !item.url) {
|
||||||
throw new Error("Resource url is required.");
|
throw new Error("Resource url is required.");
|
||||||
}
|
}
|
||||||
if (item.rel || !Array.isArray(item.rel)) {
|
if (item.rel && !Array.isArray(item.rel)) {
|
||||||
item.rel = [item.rel];
|
item.rel = [item.rel];
|
||||||
}
|
}
|
||||||
this.data = {
|
this.data = {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue