mirror of
https://github.com/alexadam/save-as-ebook.git
synced 2025-09-15 03:39:51 +00:00
misc
This commit is contained in:
parent
a5c547c011
commit
9446f47d44
2 changed files with 13 additions and 5 deletions
|
@ -32,6 +32,13 @@ Save a web page/selection as an eBook (.epub format) - a Chrome/Firefox/Opera We
|
||||||
3. Select the extension's directory
|
3. Select the extension's directory
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Convert .epub to .mobi
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo apt-get install calibre
|
||||||
|
ebook-convert "book.epub" "book.mobi"
|
||||||
|
```
|
||||||
|
|
||||||
## To-Do
|
## To-Do
|
||||||
- fix all 'epubcheck' errors (https://github.com/IDPF/epubcheck)
|
- fix all 'epubcheck' errors (https://github.com/IDPF/epubcheck)
|
||||||
- * there are some issues with relative URLs
|
- * there are some issues with relative URLs
|
||||||
|
@ -47,6 +54,7 @@ Save a web page/selection as an eBook (.epub format) - a Chrome/Firefox/Opera We
|
||||||
- add settings & options page (ui/ux)
|
- add settings & options page (ui/ux)
|
||||||
|
|
||||||
## Credits
|
## Credits
|
||||||
|
- http://ebooks.stackexchange.com/questions/1183/what-is-the-minimum-required-content-for-a-valid-epub
|
||||||
- https://github.com/blowsie/Pure-JavaScript-HTML5-Parser
|
- https://github.com/blowsie/Pure-JavaScript-HTML5-Parser
|
||||||
- https://stuk.github.io/jszip/
|
- https://stuk.github.io/jszip/
|
||||||
- http://johnny.github.io/jquery-sortable/
|
- http://johnny.github.io/jquery-sortable/
|
||||||
|
|
|
@ -2,7 +2,7 @@ var cssFileName = 'ebook.css';
|
||||||
|
|
||||||
function getImagesIndex(allImages) {
|
function getImagesIndex(allImages) {
|
||||||
return allImages.reduce(function(prev, elem, index) {
|
return allImages.reduce(function(prev, elem, index) {
|
||||||
return prev + '\n' + '<item href="images/' + elem.filename + '" id="img' + index + '" media-type="image/' + getFileExtension(elem.filename) + '"/>';
|
return prev + '\n' + '<item href="images/' + elem.filename + '" id="img' + elem.filename + '" media-type="image/' + getFileExtension(elem.filename) + '"/>';
|
||||||
}, '');
|
}, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ function _buildEbook(allPages) {
|
||||||
'<meta name="dtb:depth" content="1"/>' +
|
'<meta name="dtb:depth" content="1"/>' +
|
||||||
'</head>' +
|
'</head>' +
|
||||||
'<docTitle>' +
|
'<docTitle>' +
|
||||||
'<text></text>' +
|
'<text>' + ebookName + '</text>' +
|
||||||
'</docTitle>' +
|
'</docTitle>' +
|
||||||
'<navMap>' +
|
'<navMap>' +
|
||||||
allPages.reduce(function(prev, page, index) {
|
allPages.reduce(function(prev, page, index) {
|
||||||
|
@ -99,7 +99,7 @@ function _buildEbook(allPages) {
|
||||||
'<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">' +
|
'<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">' +
|
||||||
'<head>' +
|
'<head>' +
|
||||||
'<title>' + page.title + '</title>' +
|
'<title>' + page.title + '</title>' +
|
||||||
'<link href="' + cssFileName + '" rel="stylesheet" type="text/css" />' +
|
'<link href="../' + cssFileName + '" rel="stylesheet" type="text/css" />' +
|
||||||
'</head><body>' +
|
'</head><body>' +
|
||||||
page.content +
|
page.content +
|
||||||
'</body></html>'
|
'</body></html>'
|
||||||
|
@ -110,9 +110,9 @@ function _buildEbook(allPages) {
|
||||||
'<?xml version="1.0" encoding="UTF-8" ?>' +
|
'<?xml version="1.0" encoding="UTF-8" ?>' +
|
||||||
'<package xmlns="http://www.idpf.org/2007/opf" xmlns:dc="http://purl.org/dc/elements/1.1/" unique-identifier="db-id" version="3.0">' +
|
'<package xmlns="http://www.idpf.org/2007/opf" xmlns:dc="http://purl.org/dc/elements/1.1/" unique-identifier="db-id" version="3.0">' +
|
||||||
'<metadata>' +
|
'<metadata>' +
|
||||||
'<dc:title id="t1">Title</dc:title>' +
|
'<dc:title id="t1">'+ ebookName + '</dc:title>' +
|
||||||
'<dc:identifier id="db-id">isbn</dc:identifier>' +
|
'<dc:identifier id="db-id">isbn</dc:identifier>' +
|
||||||
'<meta property="dcterms:modified">2014-03-27T09:14:09Z</meta>' +
|
'<meta property="dcterms:modified">' + new Date().toISOString() + '</meta>' +
|
||||||
'<dc:language>en</dc:language>' +
|
'<dc:language>en</dc:language>' +
|
||||||
'</metadata>' +
|
'</metadata>' +
|
||||||
'<manifest>' +
|
'<manifest>' +
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue