mirror of
https://github.com/daniel-j/fimfic2epub.git
synced 2024-05-21 12:53:13 +12:00
Lint and update deps
This commit is contained in:
parent
c4190ebb07
commit
7a01902056
40
package.json
40
package.json
|
@ -27,36 +27,36 @@
|
|||
"detect-node": "^2.0.3",
|
||||
"elementtree": "^0.1.7",
|
||||
"escape-string-regexp": "^1.0.5",
|
||||
"file-type": "^7.2.0",
|
||||
"file-type": "^7.7.1",
|
||||
"fonteditor-core": "^1.0.2",
|
||||
"html-entities": "^1.2.0",
|
||||
"html-entities": "^1.2.1",
|
||||
"html-to-text": "^4.0.0",
|
||||
"image-size": "^0.6.1",
|
||||
"image-size": "^0.6.2",
|
||||
"is-svg": "^3.0.0",
|
||||
"jszip": "^3.1.4",
|
||||
"jszip": "^3.1.5",
|
||||
"match-words": "^1.0.0",
|
||||
"mithril": "^1.1.5",
|
||||
"mithril-node-render": "^2.2.0",
|
||||
"mithril": "^1.1.6",
|
||||
"mithril-node-render": "^2.3.0",
|
||||
"node-png": "^0.4.3",
|
||||
"pretty-data": "^0.40.0",
|
||||
"request": "^2.85.0",
|
||||
"sanitize-filename": "^1.6.0",
|
||||
"sanitize-filename": "^1.6.1",
|
||||
"syllable": "^3.0.0",
|
||||
"twemoji": "^2.5.0",
|
||||
"twemoji": "^2.5.1",
|
||||
"typogr": "^0.6.7",
|
||||
"url-regex": "^4.1.1",
|
||||
"zero-fill": "^2.2.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"autosize": "^4.0.1",
|
||||
"babel-core": "^6.26.0",
|
||||
"autosize": "^4.0.2",
|
||||
"babel-core": "^6.26.3",
|
||||
"babel-loader": "^7.1.4",
|
||||
"babel-preset-env": "^1.6.1",
|
||||
"babel-register": "^6.26.0",
|
||||
"binary-loader": "0.0.1",
|
||||
"del": "^3.0.0",
|
||||
"eslint": "^4.19.1",
|
||||
"eslint-plugin-standard": "^3.0.1",
|
||||
"eslint-plugin-standard": "^3.1.0",
|
||||
"exports-loader": "^0.7.0",
|
||||
"file-saver": "^1.3.8",
|
||||
"font-awesome": "4.7.0",
|
||||
|
@ -64,23 +64,23 @@
|
|||
"gulp-banner": "^0.1.3",
|
||||
"gulp-change": "^1.0.0",
|
||||
"gulp-chmod": "^2.0.0",
|
||||
"gulp-filter": "^5.0.1",
|
||||
"gulp-json-editor": "^2.2.1",
|
||||
"gulp-filter": "^5.1.0",
|
||||
"gulp-json-editor": "^2.3.0",
|
||||
"gulp-rename": "^1.2.2",
|
||||
"gulp-standard": "^10.1.1",
|
||||
"gulp-util": "^3.0.7",
|
||||
"gulp-standard": "^11.0.0",
|
||||
"gulp-util": "^3.0.8",
|
||||
"gulp-watch": "^5.0.0",
|
||||
"gulp-zip": "^4.0.0",
|
||||
"gulp-zip": "^4.1.0",
|
||||
"lazypipe": "^1.0.1",
|
||||
"raw-loader": "^0.5.1",
|
||||
"regenerator-runtime": "^0.11.1",
|
||||
"removeNPMAbsolutePaths": "^1.0.4",
|
||||
"run-sequence": "^2.2.0",
|
||||
"run-sequence": "^2.2.1",
|
||||
"standard": "^11.0.1",
|
||||
"stylus": "^0.54.5",
|
||||
"stylus-loader": "^3.0.1",
|
||||
"webpack": "^4.2.0",
|
||||
"webpack-node-externals": "^1.3.3"
|
||||
"stylus-loader": "^3.0.2",
|
||||
"webpack": "^4.8.1",
|
||||
"webpack-node-externals": "^1.7.2"
|
||||
},
|
||||
"standard": {
|
||||
"env": {
|
||||
|
|
84
src/cli.js
84
src/cli.js
|
@ -61,47 +61,47 @@ const ffc = new FimFic2Epub(STORY_ID, {
|
|||
ffc.coverUrl = args.cover
|
||||
|
||||
ffc.fetchMetadata()
|
||||
.then(() => {
|
||||
if (args.title) {
|
||||
ffc.setTitle(args.title)
|
||||
}
|
||||
if (args.author) {
|
||||
ffc.setAuthorName(args.author)
|
||||
}
|
||||
ffc.storyInfo.short_description = htmlToText(ffc.storyInfo.description)
|
||||
})
|
||||
.then(ffc.fetchAll.bind(ffc))
|
||||
.then(ffc.build.bind(ffc))
|
||||
.then(() => {
|
||||
let filename = ffc.filename
|
||||
if (ffc.options.kepubify) {
|
||||
filename = filename.replace(/\.epub$/, '.kepub.epub')
|
||||
}
|
||||
filename = (args.args[1] || '').replace('%id%', ffc.storyInfo.id) || filename
|
||||
let stream
|
||||
|
||||
if (args.dir) {
|
||||
filename = path.join(args.dir, filename)
|
||||
}
|
||||
|
||||
if (outputStdout) {
|
||||
stream = process.stdout
|
||||
} else {
|
||||
stream = fs.createWriteStream(filename)
|
||||
}
|
||||
ffc.streamFile(null)
|
||||
.pipe(stream)
|
||||
.on('finish', () => {
|
||||
if (!outputStdout) {
|
||||
console.log('Saved story as ' + filename)
|
||||
.then(() => {
|
||||
if (args.title) {
|
||||
ffc.setTitle(args.title)
|
||||
}
|
||||
if (args.author) {
|
||||
ffc.setAuthorName(args.author)
|
||||
}
|
||||
ffc.storyInfo.short_description = htmlToText(ffc.storyInfo.description)
|
||||
})
|
||||
.then(ffc.fetchAll.bind(ffc))
|
||||
.then(ffc.build.bind(ffc))
|
||||
.then(() => {
|
||||
let filename = ffc.filename
|
||||
if (ffc.options.kepubify) {
|
||||
filename = filename.replace(/\.epub$/, '.kepub.epub')
|
||||
}
|
||||
filename = (args.args[1] || '').replace('%id%', ffc.storyInfo.id) || filename
|
||||
let stream
|
||||
|
||||
if (args.dir) {
|
||||
filename = path.join(args.dir, filename)
|
||||
}
|
||||
|
||||
if (outputStdout) {
|
||||
stream = process.stdout
|
||||
} else {
|
||||
stream = fs.createWriteStream(filename)
|
||||
}
|
||||
ffc.streamFile(null)
|
||||
.pipe(stream)
|
||||
.on('finish', () => {
|
||||
if (!outputStdout) {
|
||||
console.log('Saved story as ' + filename)
|
||||
}
|
||||
})
|
||||
})
|
||||
.catch((err) => {
|
||||
if (err && err.stack) {
|
||||
console.error(err.stack)
|
||||
} else {
|
||||
console.error('Error: ' + (err || 'Unknown error'))
|
||||
}
|
||||
process.exit(1)
|
||||
})
|
||||
})
|
||||
.catch((err) => {
|
||||
if (err && err.stack) {
|
||||
console.error(err.stack)
|
||||
} else {
|
||||
console.error('Error: ' + (err || 'Unknown error'))
|
||||
}
|
||||
process.exit(1)
|
||||
})
|
||||
|
|
|
@ -245,9 +245,9 @@ export function createOpf (ffc) {
|
|||
])
|
||||
])
|
||||
, {strict: true}).then((contentOpf) => {
|
||||
contentOpf = '<?xml version="1.0" encoding="utf-8"?>\n' + pretty.xml(contentOpf)
|
||||
return contentOpf
|
||||
})
|
||||
contentOpf = '<?xml version="1.0" encoding="utf-8"?>\n' + pretty.xml(contentOpf)
|
||||
return contentOpf
|
||||
})
|
||||
}
|
||||
|
||||
function navPoints (list) {
|
||||
|
@ -281,9 +281,9 @@ export function createNcx (ffc) {
|
|||
), ffc.options.includeAuthorNotes && ffc.options.useAuthorNotesIndex && ffc.hasAuthorNotes ? [['Author\'s Notes', 'notesnav.xhtml']] : null)))
|
||||
])
|
||||
, {strict: true}).then((tocNcx) => {
|
||||
tocNcx = '<?xml version="1.0" encoding="utf-8" ?>\n' + pretty.xml(tocNcx)
|
||||
return tocNcx
|
||||
})
|
||||
tocNcx = '<?xml version="1.0" encoding="utf-8" ?>\n' + pretty.xml(tocNcx)
|
||||
return tocNcx
|
||||
})
|
||||
}
|
||||
|
||||
export function createNav (ffc) {
|
||||
|
@ -324,9 +324,9 @@ export function createNav (ffc) {
|
|||
]))
|
||||
])
|
||||
, {strict: true}).then((navDocument) => {
|
||||
navDocument = '<?xml version="1.0" encoding="utf-8"?>\n<!DOCTYPE html>\n' + pretty.xml(navDocument)
|
||||
return navDocument
|
||||
})
|
||||
navDocument = '<?xml version="1.0" encoding="utf-8"?>\n<!DOCTYPE html>\n' + pretty.xml(navDocument)
|
||||
return navDocument
|
||||
})
|
||||
}
|
||||
|
||||
export function createNotesNav (ffc) {
|
||||
|
@ -349,9 +349,9 @@ export function createNotesNav (ffc) {
|
|||
]))
|
||||
])
|
||||
, {strict: true}).then((navDocument) => {
|
||||
navDocument = '<?xml version="1.0" encoding="utf-8"?>\n<!DOCTYPE html>\n' + pretty.xml(navDocument)
|
||||
return navDocument
|
||||
})
|
||||
navDocument = '<?xml version="1.0" encoding="utf-8"?>\n<!DOCTYPE html>\n' + pretty.xml(navDocument)
|
||||
return navDocument
|
||||
})
|
||||
}
|
||||
|
||||
export function createCoverPage (ffc) {
|
||||
|
@ -380,9 +380,9 @@ export function createCoverPage (ffc) {
|
|||
m('body#coverpage', {'epub:type': 'frontmatter cover'}, body)
|
||||
])
|
||||
, {strict: true}).then((coverPage) => {
|
||||
coverPage = '<?xml version="1.0" encoding="utf-8"?>\n<!DOCTYPE html>\n' + pretty.xml(coverPage)
|
||||
return coverPage
|
||||
})
|
||||
coverPage = '<?xml version="1.0" encoding="utf-8"?>\n<!DOCTYPE html>\n' + pretty.xml(coverPage)
|
||||
return coverPage
|
||||
})
|
||||
}
|
||||
|
||||
function infoBox (heading, data, title) {
|
||||
|
@ -468,8 +468,8 @@ export function createTitlePage (ffc) {
|
|||
]))
|
||||
])
|
||||
, {strict: true}).then((titlePage) => {
|
||||
titlePage = '<?xml version="1.0" encoding="utf-8"?>\n<!DOCTYPE html>\n' + titlePage
|
||||
titlePage = titlePage.replace(tokenContent, '\n' + ffc.storyInfo.description + '\n')
|
||||
return titlePage
|
||||
})
|
||||
titlePage = '<?xml version="1.0" encoding="utf-8"?>\n<!DOCTYPE html>\n' + titlePage
|
||||
titlePage = titlePage.replace(tokenContent, '\n' + ffc.storyInfo.description + '\n')
|
||||
return titlePage
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue