mirror of
https://github.com/daniel-j/fimfic2epub.git
synced 2024-09-30 00:56:13 +13:00
Don't make wakeup interval configurable from cli
This commit is contained in:
parent
37b8a6671c
commit
c538156fa0
1 changed files with 9 additions and 17 deletions
|
@ -14,7 +14,7 @@ const args = require('commander')
|
||||||
.option('-i, --notes-index', 'Create an index with all author notes at the end of the ebook')
|
.option('-i, --notes-index', 'Create an index with all author notes at the end of the ebook')
|
||||||
.option('-p, --paragraphs <style>', 'Select a paragraph style <spaced|indented|indentedall|both>', 'spaced')
|
.option('-p, --paragraphs <style>', 'Select a paragraph style <spaced|indented|indentedall|both>', 'spaced')
|
||||||
.option('-j, --join-subjects', 'Join dc:subjects to a single value')
|
.option('-j, --join-subjects', 'Join dc:subjects to a single value')
|
||||||
.option('-r, --reading-ease [wakeup-interval]', 'Calculate Flesch reading ease, optional thread wakeup interval in ms (default: 50)')
|
.option('-r, --reading-ease', 'Calculate Flesch reading ease')
|
||||||
.option('-C, --cover <url>', 'Set cover image url')
|
.option('-C, --cover <url>', 'Set cover image url')
|
||||||
.parse(process.argv)
|
.parse(process.argv)
|
||||||
|
|
||||||
|
@ -23,6 +23,13 @@ if (args.args.length < 1) {
|
||||||
process.exit(1)
|
process.exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const outputStdout = args.args[1] === '-' || args.args[1] === '/dev/stdout'
|
||||||
|
|
||||||
|
if (outputStdout) {
|
||||||
|
console.log = console.error
|
||||||
|
console.log('Outputting to stdout')
|
||||||
|
}
|
||||||
|
|
||||||
// use a mock DOM so we can run mithril on the server
|
// use a mock DOM so we can run mithril on the server
|
||||||
require('mithril/test-utils/browserMock')(global)
|
require('mithril/test-utils/browserMock')(global)
|
||||||
|
|
||||||
|
@ -41,25 +48,10 @@ const ffc = new FimFic2Epub(STORY_ID, {
|
||||||
paragraphStyle: args.paragraphs,
|
paragraphStyle: args.paragraphs,
|
||||||
joinSubjects: !!args.joinSubjects,
|
joinSubjects: !!args.joinSubjects,
|
||||||
calculateReadingEase: !!args.readingEase,
|
calculateReadingEase: !!args.readingEase,
|
||||||
readingEaseWakeupInterval: typeof args.readingEase === 'boolean' ? 50 : +args.readingEase
|
readingEaseWakeupInterval: 800
|
||||||
})
|
})
|
||||||
ffc.coverUrl = args.cover
|
ffc.coverUrl = args.cover
|
||||||
|
|
||||||
const outputStdout = args.args[1] === '-' || args.args[1] === '/dev/stdout'
|
|
||||||
|
|
||||||
if (outputStdout) {
|
|
||||||
console.log = console.error
|
|
||||||
console.log('Outputting to stdout')
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
ffc.on('progress', (percent, status) => {
|
|
||||||
if (status) {
|
|
||||||
console.log('fimfic2epub: ' + status)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
*/
|
|
||||||
|
|
||||||
ffc.fetchMetadata()
|
ffc.fetchMetadata()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
if (args.title) {
|
if (args.title) {
|
||||||
|
|
Loading…
Reference in a new issue