mirror of
https://github.com/daniel-j/fimfic2epub.git
synced 2024-09-28 07:11:16 +12:00
Fix headings
This commit is contained in:
parent
1a2402445b
commit
f9682974e5
2 changed files with 8 additions and 6 deletions
|
@ -401,6 +401,7 @@ class FimFic2Epub extends EventEmitter {
|
||||||
|
|
||||||
chain = chain.then(template.createChapter.bind(null, this, {
|
chain = chain.then(template.createChapter.bind(null, this, {
|
||||||
title: ch.title,
|
title: ch.title,
|
||||||
|
addHeadings: this.options.addChapterHeadings,
|
||||||
link: this.options.addCommentsLink ? ch.link : null,
|
link: this.options.addCommentsLink ? ch.link : null,
|
||||||
linkNotes: this.options.includeAuthorNotes && this.options.useAuthorNotesIndex && chapter.notes ? 'note_' + zeroFill(3, i + 1) + '.xhtml' : null,
|
linkNotes: this.options.includeAuthorNotes && this.options.useAuthorNotesIndex && chapter.notes ? 'note_' + zeroFill(3, i + 1) + '.xhtml' : null,
|
||||||
content: content,
|
content: content,
|
||||||
|
@ -417,6 +418,7 @@ class FimFic2Epub extends EventEmitter {
|
||||||
if (this.options.includeAuthorNotes && this.options.useAuthorNotesIndex && chapter.notes) {
|
if (this.options.includeAuthorNotes && this.options.useAuthorNotesIndex && chapter.notes) {
|
||||||
chain = chain.then(template.createChapter.bind(null, this, {
|
chain = chain.then(template.createChapter.bind(null, this, {
|
||||||
title: 'Author\'s Note: ' + ch.title,
|
title: 'Author\'s Note: ' + ch.title,
|
||||||
|
addHeadings: true,
|
||||||
content: chapter.notes,
|
content: chapter.notes,
|
||||||
index: i
|
index: i
|
||||||
}, true)).then((html) => {
|
}, true)).then((html) => {
|
||||||
|
|
|
@ -66,7 +66,7 @@ function chapterBars (chapters, currentChapter = -1, highlightCurrent = false) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function createChapter (ffc, ch, isNotesChapter) {
|
export function createChapter (ffc, ch, isNotesChapter) {
|
||||||
let {content, notes, notesFirst, title, link, linkNotes, index} = ch
|
let {content, notes, notesFirst, title, link, linkNotes, index, addHeadings} = ch
|
||||||
|
|
||||||
let sections = [
|
let sections = [
|
||||||
m.trust(content || ''),
|
m.trust(content || ''),
|
||||||
|
@ -91,7 +91,7 @@ export function createChapter (ffc, ch, isNotesChapter) {
|
||||||
m('title', title)
|
m('title', title)
|
||||||
]),
|
]),
|
||||||
m('body', {'epub:type': 'bodymatter chapter'}, m('div', [
|
m('body', {'epub:type': 'bodymatter chapter'}, m('div', [
|
||||||
ffc.options.addChapterHeadings || !linkNotes ? m('.chapter-title', [
|
addHeadings ? m('.chapter-title', [
|
||||||
!isNotesChapter ? m('aside.info',
|
!isNotesChapter ? m('aside.info',
|
||||||
m('span.label', ffc.options.wordsPerMinute ? calcReadingTime(ffc, ffc.storyInfo.chapters[index].realWordCount) : ''),
|
m('span.label', ffc.options.wordsPerMinute ? calcReadingTime(ffc, ffc.storyInfo.chapters[index].realWordCount) : ''),
|
||||||
m('span.label', ffc.storyInfo.chapters[index].realWordCount.toLocaleString('en-GB') + ' words')
|
m('span.label', ffc.storyInfo.chapters[index].realWordCount.toLocaleString('en-GB') + ' words')
|
||||||
|
@ -435,8 +435,8 @@ export function createTitlePage (ffc) {
|
||||||
m('body#titlepage', {'epub:type': 'frontmatter titlepage'}, m('div', [
|
m('body#titlepage', {'epub:type': 'frontmatter titlepage'}, m('div', [
|
||||||
m('header.title', [
|
m('header.title', [
|
||||||
m('div', {className: 'content-rating content-rating-' + ffc.storyInfo.content_rating_text.toLowerCase()}, ffc.storyInfo.content_rating_text.charAt(0).toUpperCase()),
|
m('div', {className: 'content-rating content-rating-' + ffc.storyInfo.content_rating_text.toLowerCase()}, ffc.storyInfo.content_rating_text.charAt(0).toUpperCase()),
|
||||||
m('.story_name', ffc.storyInfo.title + ' '),
|
m('span.story_name', ffc.storyInfo.title + ' '),
|
||||||
m('.author', ['by ', m('b', ffc.storyInfo.author.name)])
|
m('span.author', ['by ', m('b', ffc.storyInfo.author.name)])
|
||||||
]),
|
]),
|
||||||
// m('hr'),
|
// m('hr'),
|
||||||
m('.tags', ffc.tags.filter((tag) => tag.type !== 'character').map((tag) =>
|
m('.tags', ffc.tags.filter((tag) => tag.type !== 'character').map((tag) =>
|
||||||
|
@ -451,11 +451,11 @@ export function createTitlePage (ffc) {
|
||||||
]), m('hr.old')] : null,
|
]), m('hr.old')] : null,
|
||||||
m('#description', tokenContent),
|
m('#description', tokenContent),
|
||||||
m('.bottom', [
|
m('.bottom', [
|
||||||
m('div', {className: 'completed-status completed-status-' + ffc.storyInfo.status.toLowerCase()}, [
|
m('section', {className: 'completed-status completed-status-' + ffc.storyInfo.status.toLowerCase()}, [
|
||||||
m('i.fa.fa-fw.fa-' + completedIcon[ffc.storyInfo.status.toLowerCase()], ' '),
|
m('i.fa.fa-fw.fa-' + completedIcon[ffc.storyInfo.status.toLowerCase()], ' '),
|
||||||
ffc.storyInfo.status
|
ffc.storyInfo.status
|
||||||
]),
|
]),
|
||||||
ffc.storyInfo.publishDate && infoBox('First Published', prettyDate(new Date(ffc.storyInfo.publishDate * 1000))),
|
ffc.storyInfo.publishDate && infoBox('Published', prettyDate(new Date(ffc.storyInfo.publishDate * 1000))),
|
||||||
infoBox('Last Modified', prettyDate(new Date(ffc.storyInfo.date_modified * 1000))),
|
infoBox('Last Modified', prettyDate(new Date(ffc.storyInfo.date_modified * 1000))),
|
||||||
ffc.totalWordCount ? infoBox('Word Count', ffc.totalWordCount.toLocaleString('en-GB')) : null,
|
ffc.totalWordCount ? infoBox('Word Count', ffc.totalWordCount.toLocaleString('en-GB')) : null,
|
||||||
ffc.options.wordsPerMinute ? infoBox('Time to Read', calcReadingTime(ffc), 'Estimated with ' + Math.round(ffc.options.wordsPerMinute) + ' words per minute') : null,
|
ffc.options.wordsPerMinute ? infoBox('Time to Read', calcReadingTime(ffc), 'Estimated with ' + Math.round(ffc.options.wordsPerMinute) + ' words per minute') : null,
|
||||||
|
|
Loading…
Reference in a new issue