module.exports = {
opf: function (name, list) {
return new Promise(resolve => {
function page1(list) {
let html = '';
list.forEach(key => {
if (key.index > 2666) {
html += ` `;
}
});
return html;
}
function page2(list) {
let html = '';
list.forEach(key => {
if (key.index > 2666) {
html += `
`;
}
});
return html;
}
let html = `
${name}
zh
Amazon.com
Amazon.com
Amazon.com
../images/cover.jpg
${page1(list)}
${page2(list)}
`;
resolve(html);
});
},
toc: function (list) {
return new Promise(resolve => {
function page() {
let html = '';
list.forEach(key => {
if (key.index > 2666) {
html += `
${key.title}`;
}
});
return html;
}
let html = `
TOC
目录
`;
resolve(html);
});
},
ncx: function (name, list) {
return new Promise(resolve => {
function page() {
let html = '';
list.forEach(key => {
if (key.index > 2666) {
html += `${key.title}`;
}
});
return html;
}
let html = `
${name}
Content
${page()}
`;
resolve(html);
});
},
page: function (item, content) {
return new Promise(resolve => {
const html = `
${content.title}
${content.page}
`;
resolve(html);
});
}
};