mirror of
https://github.com/daniel-j/fimfic2epub.git
synced 2024-09-28 23:31:16 +12:00
Put files in OEBPS folder
This commit is contained in:
parent
40038e3098
commit
dc6ab33d0b
2 changed files with 12 additions and 12 deletions
|
@ -117,14 +117,14 @@ module.exports = class FimFic2Epub {
|
||||||
|
|
||||||
this.filename = FimFic2Epub.getFilename(this.storyInfo)
|
this.filename = FimFic2Epub.getFilename(this.storyInfo)
|
||||||
|
|
||||||
this.zip.file('Styles/style.css', styleCss)
|
this.zip.file('OEBPS/Styles/style.css', styleCss)
|
||||||
this.zip.file('Styles/coverstyle.css', coverstyleCss)
|
this.zip.file('OEBPS/Styles/coverstyle.css', coverstyleCss)
|
||||||
if (this.includeTitlePage) {
|
if (this.includeTitlePage) {
|
||||||
this.zip.file('Styles/titlestyle.css', titlestyleCss)
|
this.zip.file('OEBPS/Styles/titlestyle.css', titlestyleCss)
|
||||||
}
|
}
|
||||||
|
|
||||||
this.zip.file('toc.ncx', template.createNcx(this))
|
this.zip.file('OEBPS/toc.ncx', template.createNcx(this))
|
||||||
this.zip.file('Text/nav.xhtml', template.createNav(this))
|
this.zip.file('OEBPS/Text/nav.xhtml', template.createNav(this))
|
||||||
|
|
||||||
this.fetchTitlePage(resolve, reject)
|
this.fetchTitlePage(resolve, reject)
|
||||||
}).catch(reject)
|
}).catch(reject)
|
||||||
|
@ -273,23 +273,23 @@ module.exports = class FimFic2Epub {
|
||||||
|
|
||||||
for (let num = 0; num < this.chapterContent.length; num++) {
|
for (let num = 0; num < this.chapterContent.length; num++) {
|
||||||
let html = this.chapterContent[num]
|
let html = this.chapterContent[num]
|
||||||
let filename = 'Text/chapter_' + zeroFill(3, num + 1) + '.xhtml'
|
let filename = 'OEBPS/Text/chapter_' + zeroFill(3, num + 1) + '.xhtml'
|
||||||
this.zip.file(filename, html)
|
this.zip.file(filename, html)
|
||||||
}
|
}
|
||||||
|
|
||||||
this.chapterContent.length = 0
|
this.chapterContent.length = 0
|
||||||
|
|
||||||
if (this.hasCoverImage) {
|
if (this.hasCoverImage) {
|
||||||
this.zip.file('Text/cover.xhtml', template.createCoverPage(coverFilename, this.coverImageDimensions.width, this.coverImageDimensions.height))
|
this.zip.file('OEBPS/Text/cover.xhtml', template.createCoverPage(coverFilename, this.coverImageDimensions.width, this.coverImageDimensions.height))
|
||||||
} else {
|
} else {
|
||||||
this.zip.file('Text/cover.xhtml', template.createCoverPage(this))
|
this.zip.file('OEBPS/Text/cover.xhtml', template.createCoverPage(this))
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.includeTitlePage) {
|
if (this.includeTitlePage) {
|
||||||
this.zip.file('Text/title.xhtml', template.createTitlePage(this))
|
this.zip.file('OEBPS/Text/title.xhtml', template.createTitlePage(this))
|
||||||
}
|
}
|
||||||
|
|
||||||
this.zip.file('content.opf', template.createOpf(this))
|
this.zip.file('OEBPS/content.opf', template.createOpf(this))
|
||||||
|
|
||||||
this.isDownloading = false
|
this.isDownloading = false
|
||||||
this.hasDownloaded = true
|
this.hasDownloaded = true
|
||||||
|
@ -324,7 +324,7 @@ module.exports = class FimFic2Epub {
|
||||||
|
|
||||||
if (dest) {
|
if (dest) {
|
||||||
r.dest = dest.replace('*', r.filename)
|
r.dest = dest.replace('*', r.filename)
|
||||||
this.zip.file(r.dest, data)
|
this.zip.file('OEBPS/' + r.dest, data)
|
||||||
if (isNode && r.filename === 'cover') {
|
if (isNode && r.filename === 'cover') {
|
||||||
const sizeOf = require('image-size')
|
const sizeOf = require('image-size')
|
||||||
this.coverImageDimensions = sizeOf(data)
|
this.coverImageDimensions = sizeOf(data)
|
||||||
|
|
|
@ -31,7 +31,7 @@ export let mimeMap = {
|
||||||
export let containerXml = `<?xml version="1.0" encoding="UTF-8"?>
|
export let containerXml = `<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<container version="1.0" xmlns="urn:oasis:names:tc:opendocument:xmlns:container">
|
<container version="1.0" xmlns="urn:oasis:names:tc:opendocument:xmlns:container">
|
||||||
<rootfiles>
|
<rootfiles>
|
||||||
<rootfile full-path="content.opf" media-type="application/oebps-package+xml"/>
|
<rootfile full-path="OEBPS/content.opf" media-type="application/oebps-package+xml"/>
|
||||||
</rootfiles>
|
</rootfiles>
|
||||||
</container>
|
</container>
|
||||||
`
|
`
|
||||||
|
|
Loading…
Reference in a new issue