asciibook 0.0.5 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.adoc +2 -3
- data/book_template/asciibook.yml +0 -1
- data/lib/asciibook/book.rb +1 -5
- data/lib/asciibook/builders/pdf_builder.rb +1 -0
- data/lib/asciibook/command.rb +2 -3
- data/lib/asciibook/version.rb +1 -1
- data/lib/asciibook.rb +0 -1
- metadata +5 -9
- data/lib/asciibook/builders/mobi_builder.rb +0 -21
- data/theme/mobi/fontawesome/solid.css +0 -13
- data/theme/mobi/layout.html +0 -13
- data/theme/mobi/mobi.css +0 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d4f97c2ecd14858e32b49810b5e86d8892562bfc70c83f46f41d89717d48ff11
|
4
|
+
data.tar.gz: 2157a30f4b755fe1850d90d4e56fc5cd6550ab2a0e2b12cef9a85a699c6b5276
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 86fe932253a2c0741b24e84b090a5918736960f94a87644c024ded10cea94b8a03ddf54ad26f3c84d4e8358b149ee5b701f43114fee55552356da04c5e056aac
|
7
|
+
data.tar.gz: a5f1fec4fa3398516cb565188bee7278db927c0105308e88b29ef3e6f3d8dd251c16bc89b96a84eb4a6aec6dbe9a70b76fe1027caa9e3f99ee2f170c05d97618
|
data/README.adoc
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
= Asciibook
|
2
2
|
:toc:
|
3
3
|
|
4
|
-
Asciibook is an Ebook generator for converting AsciiDoc to HTML, PDF
|
4
|
+
Asciibook is an Ebook generator for converting AsciiDoc to HTML, PDF and EPUB.
|
5
5
|
|
6
6
|
== Installation
|
7
7
|
|
@@ -41,8 +41,7 @@ Or generate partial formats:
|
|
41
41
|
|
42
42
|
[source, console]
|
43
43
|
----
|
44
|
-
/asciibook # asciibook build mybook.adoc --format html
|
45
|
-
/asciibook # asciibook build mybook.adoc --format pdf,mobi
|
44
|
+
/asciibook # asciibook build mybook.adoc --format html,pdf,epub
|
46
45
|
----
|
47
46
|
|
48
47
|
If you don't want to type the parameters repeatedly, you can create a configuration file for the document:
|
data/book_template/asciibook.yml
CHANGED
data/lib/asciibook/book.rb
CHANGED
@@ -9,7 +9,7 @@ module Asciibook
|
|
9
9
|
@base_dir = options[:base_dir] || '.'
|
10
10
|
@dest_dir = options[:dest_dir] || File.join(@base_dir, 'build')
|
11
11
|
@theme_dir = options[:theme_dir] || File.expand_path('../../../theme', __FILE__)
|
12
|
-
@formats = options[:formats] || %w(html pdf epub
|
12
|
+
@formats = options[:formats] || %w(html pdf epub)
|
13
13
|
@template_dir = options[:template_dir]
|
14
14
|
|
15
15
|
@page_level = @options[:page_level] || 1
|
@@ -98,10 +98,6 @@ module Asciibook
|
|
98
98
|
if @formats.include?('epub')
|
99
99
|
Builders::EpubBuilder.new(self).build
|
100
100
|
end
|
101
|
-
|
102
|
-
if @formats.include?('mobi')
|
103
|
-
Builders::MobiBuilder.new(self).build
|
104
|
-
end
|
105
101
|
end
|
106
102
|
|
107
103
|
def process_pages
|
data/lib/asciibook/command.rb
CHANGED
@@ -7,7 +7,7 @@ module Asciibook
|
|
7
7
|
p = Mercenary::Program.new(:asciibook)
|
8
8
|
|
9
9
|
p.version Asciibook::VERSION
|
10
|
-
p.description 'Asciibook is a ebook generator from Asciidoc to html/pdf/epub
|
10
|
+
p.description 'Asciibook is a ebook generator from Asciidoc to html/pdf/epub'
|
11
11
|
p.syntax 'asciibook <command> [options]'
|
12
12
|
|
13
13
|
p.command(:new) do |c|
|
@@ -43,7 +43,6 @@ module Asciibook
|
|
43
43
|
# - html
|
44
44
|
# - pdf
|
45
45
|
# - epub
|
46
|
-
# - mobi
|
47
46
|
#
|
48
47
|
# theme_dir:
|
49
48
|
# template_dir:
|
@@ -62,7 +61,7 @@ module Asciibook
|
|
62
61
|
p.command(:build) do |c|
|
63
62
|
c.description 'Build book'
|
64
63
|
c.syntax 'build [FILE|DIR]'
|
65
|
-
c.option :formats, '--format FORMAT1[,FORMAT2[,FORMAT3...]]', Array, 'Formats you want to build, allow: html,pdf,epub,
|
64
|
+
c.option :formats, '--format FORMAT1[,FORMAT2[,FORMAT3...]]', Array, 'Formats you want to build, allow: html,pdf,epub, default is all.'
|
66
65
|
c.option :theme_dir, '--theme-dir DIR', 'Theme dir.'
|
67
66
|
c.option :template_dir, '--template-dir DIR', 'Template dir.'
|
68
67
|
c.option :dest_dir, '--dest-dir DIR', 'Destination dir.'
|
data/lib/asciibook/version.rb
CHANGED
data/lib/asciibook.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: asciibook
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rei
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-02-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciidoctor
|
@@ -86,14 +86,14 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
89
|
+
version: '4.0'
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
96
|
+
version: '4.0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: nokogiri
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -143,7 +143,6 @@ files:
|
|
143
143
|
- lib/asciibook/builders/base_builder.rb
|
144
144
|
- lib/asciibook/builders/epub_builder.rb
|
145
145
|
- lib/asciibook/builders/html_builder.rb
|
146
|
-
- lib/asciibook/builders/mobi_builder.rb
|
147
146
|
- lib/asciibook/builders/pdf_builder.rb
|
148
147
|
- lib/asciibook/command.rb
|
149
148
|
- lib/asciibook/converter.rb
|
@@ -188,9 +187,6 @@ files:
|
|
188
187
|
- theme/html/html.js
|
189
188
|
- theme/html/icon.png
|
190
189
|
- theme/html/layout.html
|
191
|
-
- theme/mobi/fontawesome/solid.css
|
192
|
-
- theme/mobi/layout.html
|
193
|
-
- theme/mobi/mobi.css
|
194
190
|
- theme/pdf/config.yml
|
195
191
|
- theme/pdf/footer.html
|
196
192
|
- theme/pdf/header.html
|
@@ -219,7 +215,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
219
215
|
- !ruby/object:Gem::Version
|
220
216
|
version: '0'
|
221
217
|
requirements: []
|
222
|
-
rubygems_version: 3.1
|
218
|
+
rubygems_version: 3.4.1
|
223
219
|
signing_key:
|
224
220
|
specification_version: 4
|
225
221
|
summary: ''
|
@@ -1,21 +0,0 @@
|
|
1
|
-
module Asciibook
|
2
|
-
module Builders
|
3
|
-
class MobiBuilder < EpubBuilder
|
4
|
-
def initialize(book)
|
5
|
-
super
|
6
|
-
|
7
|
-
@dest_dir = File.join(@book.dest_dir, 'mobi')
|
8
|
-
@theme_dir = File.join(@book.theme_dir, 'mobi')
|
9
|
-
end
|
10
|
-
|
11
|
-
def build
|
12
|
-
super
|
13
|
-
|
14
|
-
epub_file = File.join(@dest_dir, "#{@book.basename}.epub")
|
15
|
-
system 'kindlegen', epub_file
|
16
|
-
|
17
|
-
FileUtils.rm epub_file
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
/* overwrite src value that mobi not support */
|
2
|
-
|
3
|
-
@font-face {
|
4
|
-
font-family: 'Font Awesome 5 Free';
|
5
|
-
font-style: normal;
|
6
|
-
font-weight: 900;
|
7
|
-
font-display: auto;
|
8
|
-
src: url("fa-solid-900.ttf") format("truetype"); }
|
9
|
-
|
10
|
-
.fa,
|
11
|
-
.fas {
|
12
|
-
font-family: 'Font Awesome 5 Free';
|
13
|
-
font-weight: 900; }
|
data/theme/mobi/layout.html
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">
|
3
|
-
<head>
|
4
|
-
<meta http-equiv="Content-Type" content="application/xml+xhtml; charset=UTF-8"/>
|
5
|
-
<title>{{ page.title }} - {{ book.title }}</title>
|
6
|
-
<link rel="stylesheet" type="text/css" href="default.css" />
|
7
|
-
<link rel="stylesheet" type="text/css" href="highlight.css" />
|
8
|
-
<link rel="stylesheet" type="text/css" href="mobi.css" />
|
9
|
-
</head>
|
10
|
-
<body>
|
11
|
-
{{ page.content }}
|
12
|
-
</body>
|
13
|
-
</html>
|
data/theme/mobi/mobi.css
DELETED