ref. https://github.com/haroldtreen/epub-press-clients/tree/master/packages/epub-press-js#usage
you can use bookmarkleter
const onload = ()=>{ | |
const EpubPress = window.EpubPress; | |
const ebook = new EpubPress({ | |
title: document.title, | |
description: 'generated by EpubPress', // TODO Pick from meta tag | |
urls: [location.href] | |
}); | |
alert('Please wait to start downloading'); | |
ebook.publish().then(() =>{ | |
ebook.download(); // Default epub | |
// or ebook.email('[email protected]') | |
}).then(() => { | |
alert('Success!'); | |
}).catch((error) => { | |
alert(`Error: ${error}`); | |
}); | |
}; | |
const onerror = ()=>{ | |
const fallback = ''; | |
const url = `${fallback}?title=${document.title}&url=${location.href}`; | |
window.open(url) | |
}; | |
const s = document.createElement('script'); | |
s.src = 'https://cdn.jsdelivr.net/npm/[email protected]/build/index.min.js'; | |
s.onload = onload; | |
s.onerror = onerror; | |
document.body.appendChild(s); |