asciibook 0.0.4 → 0.1.0.pre.beta

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fb4347a438a375868d0a2173c66ea9519341d167eb4a2ea963cb54d614c3cac4
4
- data.tar.gz: c1f4dadda074a10b9a4431dbbf2ef975083b8c1c25beb316e547c918671b910b
3
+ metadata.gz: 8b07fb3fa60753fd80a3856b4f6bb8fd5015b195511b5cb619de9b1bc9fa4714
4
+ data.tar.gz: 7c0e8160d3bfa813422878c3355954443c287496e676681853cd35d93c5d5a2e
5
5
  SHA512:
6
- metadata.gz: d0bf598a7570cacd63f6939c55a115f28651b375d87711a08486a6419af87947521ab12ada2b6984efacc3716d3226411f62109b552f877ddd4090c9e1095cad
7
- data.tar.gz: 0db9909fc5f9cb62775d5d3452522090e79567352cbdd433b9d1162e97bec5a9e0989245f637551c26b5b6cab47d87c8e5f894127ea2969b4f1fbddec0fb5094
6
+ metadata.gz: 4322ee85e1049cda3e4400886deba30ead2c7882ab5d3636f49a3a362ea26d71cbce58e5316f9b89fc23cc3228368620365efe66ae95956c052b954b6762de5f
7
+ data.tar.gz: b947adeb15ea25dc9168e245cd98e16dd5ff93b861cef4091071784b503bb9a2be2d9a7018e39cac868720351897fe45e2d4826b25438e84dc7c0505ab297f7c
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, EPUB and MOBI.
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:
@@ -1,9 +1,9 @@
1
1
  source: book.adoc
2
+
2
3
  # formats:
3
4
  # - html
4
5
  # - pdf
5
6
  # - epub
6
- # - mobi
7
7
  #
8
8
  # theme_dir:
9
9
  # template_dir:
@@ -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 mobi)
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
@@ -115,6 +115,7 @@ module Asciibook
115
115
  if @book.cover_image_path
116
116
  prepare_cover
117
117
  command << 'cover' << 'cover.html'
118
+ command << '--allow' << File.expand_path(@tmp_dir)
118
119
  end
119
120
 
120
121
  @book.pages.each do |page|
@@ -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/mobi'
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|
@@ -38,11 +38,11 @@ module Asciibook
38
38
  File.open(File.join(dir, 'asciibook.yml'), 'w') do |file|
39
39
  file.write <<~EOF
40
40
  source: #{filename}
41
+
41
42
  # formats:
42
43
  # - html
43
44
  # - pdf
44
45
  # - epub
45
- # - mobi
46
46
  #
47
47
  # theme_dir:
48
48
  # template_dir:
@@ -61,12 +61,12 @@ module Asciibook
61
61
  p.command(:build) do |c|
62
62
  c.description 'Build book'
63
63
  c.syntax 'build [FILE|DIR]'
64
- c.option :formats, '--format FORMAT1[,FORMAT2[,FORMAT3...]]', Array, 'Formats you want to build, allow: html,pdf,epub,mobi, default is all.'
64
+ c.option :formats, '--format FORMAT1[,FORMAT2[,FORMAT3...]]', Array, 'Formats you want to build, allow: html,pdf,epub, default is all.'
65
65
  c.option :theme_dir, '--theme-dir DIR', 'Theme dir.'
66
66
  c.option :template_dir, '--template-dir DIR', 'Template dir.'
67
67
  c.option :dest_dir, '--dest-dir DIR', 'Destination dir.'
68
68
  c.option :page_level, '--page-level NUM', Integer, 'Page split base on section level, default is 1.'
69
- c.option :plugins, '-r', '--require PLUGIN1[,PLUGIN2[,PLUGIN3...]]', Array, 'Require plugins'
69
+ c.option :plugins, '--plugin PLUGIN1[,PLUGIN2[,PLUGIN3...]]', Array, 'Require ruby gem or ruby script plugin.'
70
70
  c.action do |args, options|
71
71
  source = args[0] || '.'
72
72
  if File.directory?(source)
@@ -1,3 +1,3 @@
1
1
  module Asciibook
2
- VERSION = "0.0.4"
2
+ VERSION = "0.1.0-beta"
3
3
  end
data/lib/asciibook.rb CHANGED
@@ -18,7 +18,6 @@ require "asciibook/builders/base_builder"
18
18
  require "asciibook/builders/html_builder"
19
19
  require "asciibook/builders/pdf_builder"
20
20
  require "asciibook/builders/epub_builder"
21
- require "asciibook/builders/mobi_builder"
22
21
 
23
22
  module Asciibook
24
23
  end
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
4
+ version: 0.1.0.pre.beta
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rei
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-12-17 00:00:00.000000000 Z
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: '3.0'
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: '3.0'
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
@@ -215,11 +211,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
215
211
  version: '0'
216
212
  required_rubygems_version: !ruby/object:Gem::Requirement
217
213
  requirements:
218
- - - ">="
214
+ - - ">"
219
215
  - !ruby/object:Gem::Version
220
- version: '0'
216
+ version: 1.3.1
221
217
  requirements: []
222
- rubygems_version: 3.1.6
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; }
@@ -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
@@ -1,2 +0,0 @@
1
- body {
2
- }