ebookbinder 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.aspell.pws +10 -0
- data/Changelog +3 -0
- data/README.md +8 -2
- data/Rakefile +16 -2
- data/ebookbinder.gemspec +9 -5
- data/lib/ebookbinder/ebook_base.rb +0 -2
- data/lib/ebookbinder/epub2.rb +2 -1
- data/lib/ebookbinder/epub3.rb +2 -2
- data/lib/ebookbinder/version.rb +1 -1
- data/lib/ebookbinder.rb +1 -0
- data/regtest/epub2.rb +17 -0
- data/regtest/epub2.yml +77 -0
- data/regtest/epub3.rb +17 -0
- data/regtest/epub3.yml +45 -0
- metadata +37 -10
- /data/{test → examples}/epub2/Rakefile +0 -0
- /data/{test → examples}/epub2/src/01.xhtml +0 -0
- /data/{test → examples}/epub2/src/02.xhtml +0 -0
- /data/{test → examples}/epub3/Rakefile +0 -0
- /data/{test → examples}/epub3/src/01.xhtml +0 -0
- /data/{test → examples}/epub3/src/02.xhtml +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf3679fa9fe0db4a7f242b7defb30fd07f3217ffd3e4ffcbec1a842e30ced7fa
|
4
|
+
data.tar.gz: 28b58dec10fae2974d4a6bee7068a02d4154bedcc2924a2a9594f11d6740fa05
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2c97daecd67e300a6c1f2b8082d0c12b66d6c135c234eb498b126970a2b40701fdbc09b411f780cb43cfd5b0805a681b71383d9c7e4cbae0b95afed88330b0c
|
7
|
+
data.tar.gz: 2859f0a4ad5488ca9c7c7637ea3443059e685993ff1a4768a57cad714385720c8218789cf235c29f9256afeec0c72f619bb4d27a8e7eae909cd1efb728346309
|
data/.aspell.pws
ADDED
data/Changelog
CHANGED
data/README.md
CHANGED
@@ -4,14 +4,20 @@
|
|
4
4
|
## Description
|
5
5
|
|
6
6
|
This library should help to make ebooks as easy as possible. It interprets an
|
7
|
-
XHTML structure and generate a corresponding ebook on base of easy
|
7
|
+
XHTML structure and generate a corresponding ebook on base of easy assumptions.
|
8
|
+
|
9
|
+
|
10
|
+
## Usage
|
11
|
+
|
12
|
+
To understand how Ebookbinder works have a look at the examples directory.
|
13
|
+
There are examples of the actual implemented functionality.
|
8
14
|
|
9
15
|
|
10
16
|
## Requirements
|
11
17
|
|
12
18
|
To use rake check it needs an actual version of
|
13
19
|
[epubcheck](https://www.w3.org/publishing/epubcheck/) accessible on the
|
14
|
-
|
20
|
+
command line via `epubcheck`.
|
15
21
|
|
16
22
|
|
17
23
|
## Versioning
|
data/Rakefile
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
require 'rim/tire'
|
4
|
+
require 'rim/regtest'
|
4
5
|
require 'rim/version'
|
5
6
|
require_relative 'lib/ebookbinder/version'
|
6
7
|
|
@@ -8,7 +9,20 @@ Rim.setup do |r|
|
|
8
9
|
r.name = 'ebookbinder'
|
9
10
|
r.authors = 'Jan Friedrich'
|
10
11
|
r.email = 'janfri26@gmail.com'
|
12
|
+
r.homepage = 'https://github.com/janfri/ebookbinder'
|
13
|
+
r.license = 'MIT'
|
14
|
+
r.summary = 'This library should help to make ebooks as easy as possible. It interprets an XHTML structure and generate a corresponding ebook on base of easy asumptions.'
|
11
15
|
r.version = Ebookbinder::VERSION
|
12
|
-
r.
|
13
|
-
|
16
|
+
r.install_message = %q{
|
17
|
+
+-----------------------------------------------------------------------+
|
18
|
+
| To run rake check you need epubcheck installed and accessible via |
|
19
|
+
| `epubcheck` on the command line. |
|
20
|
+
| |
|
21
|
+
| https://www.w3.org/publishing/epubcheck/ |
|
22
|
+
+-----------------------------------------------------------------------+
|
23
|
+
}
|
24
|
+
r.gem_files += FileList.new('examples/*/Rakefile', 'examples/*/src/**/*.*')
|
14
25
|
end
|
26
|
+
|
27
|
+
task :test => :regtest
|
28
|
+
task :default => :regtest
|
data/ebookbinder.gemspec
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: ebookbinder 1.0.
|
2
|
+
# stub: ebookbinder 1.0.1 ruby lib
|
3
3
|
#
|
4
4
|
# This file is automatically generated by rim.
|
5
5
|
# PLEASE DO NOT EDIT IT DIRECTLY!
|
@@ -7,20 +7,24 @@
|
|
7
7
|
|
8
8
|
Gem::Specification.new do |s|
|
9
9
|
s.name = "ebookbinder"
|
10
|
-
s.version = "1.0.
|
10
|
+
s.version = "1.0.1"
|
11
11
|
|
12
12
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
13
13
|
s.require_paths = ["lib"]
|
14
14
|
s.authors = ["Jan Friedrich"]
|
15
|
-
s.date = "2024-03-
|
15
|
+
s.date = "2024-03-05"
|
16
16
|
s.description = ""
|
17
17
|
s.email = "janfri26@gmail.com"
|
18
|
-
s.files = ["Changelog", "Gemfile", "LICENSE", "README.md", "Rakefile", "ebookbinder.gemspec", "lib/ebookbinder.rb", "lib/ebookbinder/ebook_base.rb", "lib/ebookbinder/epub2.rb", "lib/ebookbinder/epub3.rb", "lib/ebookbinder/epub_base.rb", "lib/ebookbinder/version.rb", "
|
18
|
+
s.files = ["./.aspell.pws", "Changelog", "Gemfile", "LICENSE", "README.md", "Rakefile", "ebookbinder.gemspec", "examples/epub2/Rakefile", "examples/epub2/src/01.xhtml", "examples/epub2/src/02.xhtml", "examples/epub3/Rakefile", "examples/epub3/src/01.xhtml", "examples/epub3/src/02.xhtml", "lib/ebookbinder", "lib/ebookbinder.rb", "lib/ebookbinder/ebook_base.rb", "lib/ebookbinder/epub2.rb", "lib/ebookbinder/epub3.rb", "lib/ebookbinder/epub_base.rb", "lib/ebookbinder/version.rb", "regtest/epub2.rb", "regtest/epub2.yml", "regtest/epub3.rb", "regtest/epub3.yml"]
|
19
|
+
s.homepage = "https://github.com/janfri/ebookbinder"
|
20
|
+
s.licenses = ["MIT"]
|
21
|
+
s.post_install_message = "\n+-----------------------------------------------------------------------+\n| To run rake check you need epubcheck installed and accessible via |\n| `epubcheck` on the command line. |\n| |\n| https://www.w3.org/publishing/epubcheck/ |\n+-----------------------------------------------------------------------+\n "
|
19
22
|
s.rubygems_version = "3.6.0.dev"
|
20
|
-
s.summary = ""
|
23
|
+
s.summary = "This library should help to make ebooks as easy as possible. It interprets an XHTML structure and generate a corresponding ebook on base of easy asumptions."
|
21
24
|
|
22
25
|
s.specification_version = 4
|
23
26
|
|
24
27
|
s.add_development_dependency(%q<rake>, [">= 0"])
|
25
28
|
s.add_development_dependency(%q<rim>, ["~> 2.17"])
|
29
|
+
s.add_development_dependency(%q<regtest>, ["~> 2"])
|
26
30
|
end
|
data/lib/ebookbinder/epub2.rb
CHANGED
@@ -52,6 +52,7 @@ module Ebookbinder
|
|
52
52
|
end
|
53
53
|
|
54
54
|
def generate_ncx_file
|
55
|
+
puts "generate #{ncx_filename}" if verbose
|
55
56
|
builder = Nokogiri::XML::Builder.new(encoding: 'UTF-8') do |xml|
|
56
57
|
xml.ncx(xmlns: 'http://www.daisy.org/z3986/2005/ncx/', version: '2005-1') do
|
57
58
|
xml.head do
|
@@ -128,7 +129,7 @@ module Ebookbinder
|
|
128
129
|
root = Dir.pwd
|
129
130
|
epub_filename_fullpath = File.join(root, epub_filename)
|
130
131
|
cd epub_dir do
|
131
|
-
sh "zip -
|
132
|
+
sh "zip -Xqr9D \"#{epub_filename_fullpath}\" mimetype *"
|
132
133
|
end
|
133
134
|
end
|
134
135
|
|
data/lib/ebookbinder/epub3.rb
CHANGED
@@ -53,7 +53,7 @@ module Ebookbinder
|
|
53
53
|
end
|
54
54
|
|
55
55
|
def generate_nav_file
|
56
|
-
puts "generate #{nav_filename}"
|
56
|
+
puts "generate #{nav_filename}" if verbose
|
57
57
|
builder = Nokogiri::XML::Builder.new(encoding: 'UTF-8') do |xml|
|
58
58
|
xml.html(xmlns: 'http://www.w3.org/1999/xhtml') do
|
59
59
|
xml.head do
|
@@ -123,7 +123,7 @@ module Ebookbinder
|
|
123
123
|
root = Dir.pwd
|
124
124
|
epub_filename_fullpath = File.join(root, epub_filename)
|
125
125
|
cd epub_dir do
|
126
|
-
sh "zip -
|
126
|
+
sh "zip -Xqr9D \"#{epub_filename_fullpath}\" mimetype *"
|
127
127
|
end
|
128
128
|
end
|
129
129
|
|
data/lib/ebookbinder/version.rb
CHANGED
data/lib/ebookbinder.rb
CHANGED
data/regtest/epub2.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'regtest'
|
4
|
+
|
5
|
+
EPUB2_DIR = File.join(__dir__, '../examples/epub2/build/epub2')
|
6
|
+
|
7
|
+
Dir.chdir(EPUB2_DIR) do
|
8
|
+
system('rake -s clobber build')
|
9
|
+
end
|
10
|
+
|
11
|
+
%w(toc.ncx).each do |fn|
|
12
|
+
|
13
|
+
Regtest.sample fn do
|
14
|
+
File.read File.join(EPUB2_DIR, fn)
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
data/regtest/epub2.yml
ADDED
@@ -0,0 +1,77 @@
|
|
1
|
+
---
|
2
|
+
sample: toc.ncx
|
3
|
+
result: |
|
4
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
5
|
+
<ncx xmlns="http://www.daisy.org/z3986/2005/ncx/" version="2005-1">
|
6
|
+
<head>
|
7
|
+
<meta name="dtb:uid" content="79590ed992de79754671e01316da8f2a"/>
|
8
|
+
<meta name="dtb:depth" content="2"/>
|
9
|
+
<meta name="dtb:totalPageCount" content="0"/>
|
10
|
+
<meta name="dtb:maxPageNumber" content="0"/>
|
11
|
+
</head>
|
12
|
+
<docTitle>
|
13
|
+
<text>Test Book in EPUB 2</text>
|
14
|
+
</docTitle>
|
15
|
+
<navMap>
|
16
|
+
<navPoint id="id_0001" playOrder="1">
|
17
|
+
<navLabel>
|
18
|
+
<text>H1 number 1</text>
|
19
|
+
</navLabel>
|
20
|
+
<content src="01.xhtml#id1"/>
|
21
|
+
</navPoint>
|
22
|
+
<navPoint id="id_0002" playOrder="2">
|
23
|
+
<navLabel>
|
24
|
+
<text>H1 number 2</text>
|
25
|
+
</navLabel>
|
26
|
+
<content src="01.xhtml#id2"/>
|
27
|
+
</navPoint>
|
28
|
+
<navPoint id="id_0003" playOrder="3">
|
29
|
+
<navLabel>
|
30
|
+
<text>H1 number 3</text>
|
31
|
+
</navLabel>
|
32
|
+
<content src="01.xhtml#id3"/>
|
33
|
+
</navPoint>
|
34
|
+
<navPoint id="id_0004" playOrder="4">
|
35
|
+
<navLabel>
|
36
|
+
<text>H1 number 4</text>
|
37
|
+
</navLabel>
|
38
|
+
<content src="01.xhtml#id4"/>
|
39
|
+
</navPoint>
|
40
|
+
<navPoint id="id_0005" playOrder="5">
|
41
|
+
<navLabel>
|
42
|
+
<text>H1 number 5</text>
|
43
|
+
</navLabel>
|
44
|
+
<content src="01.xhtml#id5"/>
|
45
|
+
</navPoint>
|
46
|
+
<navPoint id="id_0006" playOrder="6">
|
47
|
+
<navLabel>
|
48
|
+
<text>H1 number 1</text>
|
49
|
+
</navLabel>
|
50
|
+
<content src="02.xhtml#id1"/>
|
51
|
+
</navPoint>
|
52
|
+
<navPoint id="id_0007" playOrder="7">
|
53
|
+
<navLabel>
|
54
|
+
<text>H1 number 2</text>
|
55
|
+
</navLabel>
|
56
|
+
<content src="02.xhtml#id2"/>
|
57
|
+
</navPoint>
|
58
|
+
<navPoint id="id_0008" playOrder="8">
|
59
|
+
<navLabel>
|
60
|
+
<text>H1 number 3</text>
|
61
|
+
</navLabel>
|
62
|
+
<content src="02.xhtml#id3"/>
|
63
|
+
</navPoint>
|
64
|
+
<navPoint id="id_0009" playOrder="9">
|
65
|
+
<navLabel>
|
66
|
+
<text>H1 number 4</text>
|
67
|
+
</navLabel>
|
68
|
+
<content src="02.xhtml#id4"/>
|
69
|
+
</navPoint>
|
70
|
+
<navPoint id="id_0010" playOrder="10">
|
71
|
+
<navLabel>
|
72
|
+
<text>H1 number 5</text>
|
73
|
+
</navLabel>
|
74
|
+
<content src="02.xhtml#id5"/>
|
75
|
+
</navPoint>
|
76
|
+
</navMap>
|
77
|
+
</ncx>
|
data/regtest/epub3.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'regtest'
|
4
|
+
|
5
|
+
EPUB3_DIR = File.join(__dir__, '../examples/epub3/build/epub3')
|
6
|
+
|
7
|
+
Dir.chdir(EPUB3_DIR) do
|
8
|
+
system('rake -s clobber build')
|
9
|
+
end
|
10
|
+
|
11
|
+
%w(nav.xhtml).each do |fn|
|
12
|
+
|
13
|
+
Regtest.sample fn do
|
14
|
+
File.read File.join(EPUB3_DIR, fn)
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
data/regtest/epub3.yml
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
---
|
2
|
+
sample: nav.xhtml
|
3
|
+
result: |
|
4
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
5
|
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
6
|
+
<head>
|
7
|
+
<title>Test Book in EPUB 3</title>
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
<nav xmlns:epub="http://www.idpf.org/2007/ops" epub:type="toc" id="toc">
|
11
|
+
<ol>
|
12
|
+
<li>
|
13
|
+
<a href="01.xhtml#id1">H1 number 1</a>
|
14
|
+
</li>
|
15
|
+
<li>
|
16
|
+
<a href="01.xhtml#id2">H1 number 2</a>
|
17
|
+
</li>
|
18
|
+
<li>
|
19
|
+
<a href="01.xhtml#id3">H1 number 3</a>
|
20
|
+
</li>
|
21
|
+
<li>
|
22
|
+
<a href="01.xhtml#id4">H1 number 4</a>
|
23
|
+
</li>
|
24
|
+
<li>
|
25
|
+
<a href="01.xhtml#id5">H1 number 5</a>
|
26
|
+
</li>
|
27
|
+
<li>
|
28
|
+
<a href="02.xhtml#id1">H1 number 1</a>
|
29
|
+
</li>
|
30
|
+
<li>
|
31
|
+
<a href="02.xhtml#id2">H1 number 2</a>
|
32
|
+
</li>
|
33
|
+
<li>
|
34
|
+
<a href="02.xhtml#id3">H1 number 3</a>
|
35
|
+
</li>
|
36
|
+
<li>
|
37
|
+
<a href="02.xhtml#id4">H1 number 4</a>
|
38
|
+
</li>
|
39
|
+
<li>
|
40
|
+
<a href="02.xhtml#id5">H1 number 5</a>
|
41
|
+
</li>
|
42
|
+
</ol>
|
43
|
+
</nav>
|
44
|
+
</body>
|
45
|
+
</html>
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ebookbinder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Friedrich
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2024-03-
|
10
|
+
date: 2024-03-05 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: rake
|
@@ -37,32 +37,58 @@ dependencies:
|
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
39
|
version: '2.17'
|
40
|
+
- !ruby/object:Gem::Dependency
|
41
|
+
name: regtest
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - "~>"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '2'
|
47
|
+
type: :development
|
48
|
+
prerelease: false
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - "~>"
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '2'
|
40
54
|
description: ''
|
41
55
|
email: janfri26@gmail.com
|
42
56
|
executables: []
|
43
57
|
extensions: []
|
44
58
|
extra_rdoc_files: []
|
45
59
|
files:
|
60
|
+
- "./.aspell.pws"
|
46
61
|
- Changelog
|
47
62
|
- Gemfile
|
48
63
|
- LICENSE
|
49
64
|
- README.md
|
50
65
|
- Rakefile
|
51
66
|
- ebookbinder.gemspec
|
67
|
+
- examples/epub2/Rakefile
|
68
|
+
- examples/epub2/src/01.xhtml
|
69
|
+
- examples/epub2/src/02.xhtml
|
70
|
+
- examples/epub3/Rakefile
|
71
|
+
- examples/epub3/src/01.xhtml
|
72
|
+
- examples/epub3/src/02.xhtml
|
52
73
|
- lib/ebookbinder.rb
|
53
74
|
- lib/ebookbinder/ebook_base.rb
|
54
75
|
- lib/ebookbinder/epub2.rb
|
55
76
|
- lib/ebookbinder/epub3.rb
|
56
77
|
- lib/ebookbinder/epub_base.rb
|
57
78
|
- lib/ebookbinder/version.rb
|
58
|
-
-
|
59
|
-
-
|
60
|
-
-
|
61
|
-
-
|
62
|
-
|
63
|
-
|
64
|
-
|
79
|
+
- regtest/epub2.rb
|
80
|
+
- regtest/epub2.yml
|
81
|
+
- regtest/epub3.rb
|
82
|
+
- regtest/epub3.yml
|
83
|
+
homepage: https://github.com/janfri/ebookbinder
|
84
|
+
licenses:
|
85
|
+
- MIT
|
65
86
|
metadata: {}
|
87
|
+
post_install_message: "\n+-----------------------------------------------------------------------+\n|
|
88
|
+
To run rake check you need epubcheck installed and accessible via |\n| `epubcheck`
|
89
|
+
on the command line. |\n| |\n|
|
90
|
+
https://www.w3.org/publishing/epubcheck/ |\n+-----------------------------------------------------------------------+\n
|
91
|
+
\ "
|
66
92
|
rdoc_options: []
|
67
93
|
require_paths:
|
68
94
|
- lib
|
@@ -79,5 +105,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
79
105
|
requirements: []
|
80
106
|
rubygems_version: 3.6.0.dev
|
81
107
|
specification_version: 4
|
82
|
-
summary:
|
108
|
+
summary: This library should help to make ebooks as easy as possible. It interprets
|
109
|
+
an XHTML structure and generate a corresponding ebook on base of easy asumptions.
|
83
110
|
test_files: []
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|