Compare commits
17 Commits
Author | SHA1 | Date |
---|---|---|
dependabot[bot] | f56e5b4538 | |
dependabot[bot] | df1f0e5519 | |
dependabot[bot] | f64a58dd11 | |
Nemo | 105dad2f76 | |
dependabot[bot] | 65087cf083 | |
dependabot[bot] | aeb21d887d | |
Nemo | ec95b9e5df | |
Nemo | ac1d2c198a | |
Nemo | cafbe67004 | |
Nemo | 668463c1c9 | |
Nemo | a878151b1c | |
Nemo | 72844fdb0f | |
dependabot[bot] | b10bf7fa50 | |
dependabot[bot] | 2b3ef776ee | |
dependabot[bot] | 29134b4382 | |
dependabot[bot] | d458bcddeb | |
Nemo | 95ec206bda |
|
@ -0,0 +1,3 @@
|
|||
ko_fi: captn3m0
|
||||
liberapay: captn3m0
|
||||
github: captn3m0
|
|
@ -0,0 +1,2 @@
|
|||
.editorconfig
|
||||
test.js
|
|
@ -0,0 +1,7 @@
|
|||
Copyright 2021 Abhay Rana
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
20
README.md
20
README.md
|
@ -8,14 +8,17 @@ Currently supports the following providers:
|
|||
|--------|-----|
|
||||
|OpenLibrary|ISBN|
|
||||
|
||||
## Usage
|
||||
## Installation
|
||||
|
||||
```javascript
|
||||
const E = require('epub-metadata-generator')
|
||||
E.write(filepath, ISBN);
|
||||
You can install it from NPM
|
||||
|
||||
```
|
||||
npm i -g epub-metadata-generator
|
||||
```
|
||||
|
||||
Alternatively, you can use the provided command-line-executable:
|
||||
## Usage
|
||||
|
||||
You can use the provided command-line-executable:
|
||||
|
||||
```sh
|
||||
generate-epub-xml 9780596101190 /tmp/9780596101190.xml
|
||||
|
@ -41,6 +44,13 @@ You can use this file in `pandoc` directly:
|
|||
|
||||
`pandoc input.html --epub-metadata=/tmp/9780596101190.xml file.epub`
|
||||
|
||||
Alternatively, you can use the NPM package programatically as well:
|
||||
|
||||
```javascript
|
||||
const E = require('epub-metadata-generator')
|
||||
E.write(filepath, ISBN);
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
Licensed under the [MIT License](https://nemo.mit-license.org/). See LICENSE file for details.
|
||||
|
|
|
@ -48,8 +48,6 @@ module.exports = {
|
|||
});
|
||||
}
|
||||
|
||||
console.log(JSON.stringify(book.details));
|
||||
|
||||
if (undefined !== book.details.covers) {
|
||||
let coverId = book.details.covers[0];
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "epub-metadata-generator",
|
||||
"version": "1.0.0",
|
||||
"version": "1.0.2",
|
||||
"description": "Generates EPUB metadata files from various sources",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
@ -18,10 +18,10 @@
|
|||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"node-isbn-catalogue": "^1.2.3",
|
||||
"xmlbuilder": "^13.0.2"
|
||||
"xmlbuilder": "^15.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"jest": "^25.1.0"
|
||||
"jest": "^27.0.6"
|
||||
},
|
||||
"bin": {
|
||||
"generate-epub-xml": "./cli.js"
|
||||
|
|
2
test.js
2
test.js
|
@ -34,6 +34,6 @@ test("the xml generator to work", () => {
|
|||
};
|
||||
let xml = generator._convert(input, false);
|
||||
expect(xml).toBe(
|
||||
`<?xml version="1.0"?><metadata><dc:identifier opf:scheme="ISBN-13">9780596101190</dc:identifier><dc:identifier opf:scheme="ISBN-10">0596101198</dc:identifier><dc:creator opf:role="aut">Dan Woods</dc:creator><dc:creator opf:role="aut">Gautam Guliani</dc:creator><dc:title id="title">Open Source for the Enterprise</dc:title><dc:title id="subtitle">Managing Risks, Reaping Rewards</dc:title><meta refines="#subtitle" property="title-type">subtitle</meta><dc:language>eng</dc:language><dc:publisher>O'Reilly Media, Inc.</dc:publisher></metadata>`
|
||||
`<?xml version="1.0"?><package unique-identifier="uuid_id" xmlns="http://www.idpf.org/2007/opf"><metadata xmlns:opf="http://www.idpf.org/2007/opf" xmlns:dc="http://purl.org/dc/elements/1.1/"><dc:identifier opf:scheme="ISBN-13">9780596101190</dc:identifier><dc:identifier opf:scheme="ISBN-10">0596101198</dc:identifier><dc:creator opf:role="aut">Dan Woods</dc:creator><dc:creator opf:role="aut">Gautam Guliani</dc:creator><dc:title id="title">Open Source for the Enterprise</dc:title><dc:title id="subtitle">Managing Risks, Reaping Rewards</dc:title><meta refines="#subtitle" property="title-type">subtitle</meta><dc:language>eng</dc:language><dc:publisher>O'Reilly Media, Inc.</dc:publisher><dc:date>2005-07-26</dc:date></metadata></package>`
|
||||
);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue