const start = 1;
module.exports = {
opf: function (info, list) {
return new Promise(resolve => {
function item(list) {
let html = '';
list.forEach(key => {
if (startAndEnd(key)) {
html += `
`;
}
});
return html;
}
function itemref(list) {
let html = '';
list.forEach(key => {
if (startAndEnd(key)) {
html += `
`;
}
});
return html;
}
let html = `
${info.author}
zh
${info.name}
${info.time}
urn:uuid:${info.uid}
${item(list)}
${itemref(list)}
`;
resolve(html);
});
},
tocNcx: function (info, list) {
return new Promise(resolve => {
function navPoint(list) {
let page = '';
list.forEach(key => {
if (startAndEnd(key)) {
page += `
${key.title}
`
}
})
return page
}
const html = `
${info.name}
制作信息
${navPoint(list)}
`;
resolve(html)
})
},
book: function (info) {
return new Promise(resolve => {
const html = `
${info.name}
${info.author} / 著
排版/制作:飞鼠
www.mebook.cc
`
resolve(html)
})
},
page: function (item, content) {
return new Promise(resolve => {
function page(content) {
let contents = content.split('\n');
let html = ''
contents.forEach(key => {
html += `
${key}
`
})
return html
}
const html = `
${content.title}
${page(content.page)}
`;
resolve(html);
});
},
name: '末世之全能大师',
author: '秦小词',
uid: '',
time: ''
};
function startAndEnd(item) {
return item.index > 0 && item.index < 605;
}