techbook 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 +7 -0
- data/.editorconfig +12 -0
- data/.gitignore +8 -0
- data/.travis.yml +7 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +108 -0
- data/README.md +35 -0
- data/Rakefile +10 -0
- data/TODO.md +3 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/exe/techbook +6 -0
- data/lib/techbook/builder.rb +139 -0
- data/lib/techbook/cli.rb +39 -0
- data/lib/techbook/generator.rb +66 -0
- data/lib/techbook/publisher.rb +7 -0
- data/lib/techbook/version.rb +3 -0
- data/lib/techbook.rb +43 -0
- data/techbook.gemspec +41 -0
- data/templates/01-first-chapter.asc.erb +1 -0
- data/templates/README.md.erb +10 -0
- data/templates/book-theme.yml +5 -0
- data/templates/book.asc.erb +36 -0
- data/templates/gitignore +1 -0
- data/templates/keep +0 -0
- metadata +262 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: b0d111a6290516c5ed3eb29a385bf8a29e83b2a52a792b51879bddd1d5837b59
|
4
|
+
data.tar.gz: f67efe58b64c6bb2aa85ec410273c644a72612fd9d845d8ffddc3df6a9209bc8
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d854242caae6aa6243a727acefd2faef35e8530e0434dff8056464265071e50d0c1bff6c52ed8ae6847ba6155cd13a65f85fdcd674e1e84d43df78664d6ddd8e
|
7
|
+
data.tar.gz: f2d2048abd72843063783c1e3d250475bad1a46d371d42fe0ae2630642c1bea1c3efca5b508451d2c24eca3e49b85b4403afbace13453ea9942f34a8c67d3e46
|
data/.editorconfig
ADDED
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,108 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
techbook (0.1.0)
|
5
|
+
asciidoctor (~> 2.0)
|
6
|
+
asciidoctor-diagram (~> 1.5, >= 1.5.18)
|
7
|
+
asciidoctor-epub3 (~> 1.5.0.alpha.9)
|
8
|
+
asciidoctor-pdf (~> 1.5.0.alpha.18)
|
9
|
+
epubcheck (~> 3.0, >= 3.0.1)
|
10
|
+
kindlegen (~> 3.0, >= 3.0.3)
|
11
|
+
listen (~> 3.1, >= 3.1.5)
|
12
|
+
rouge (~> 3.3)
|
13
|
+
thor (~> 0.20)
|
14
|
+
|
15
|
+
GEM
|
16
|
+
remote: https://rubygems.org/
|
17
|
+
specs:
|
18
|
+
Ascii85 (1.0.3)
|
19
|
+
addressable (2.6.0)
|
20
|
+
public_suffix (>= 2.0.2, < 4.0)
|
21
|
+
afm (0.2.2)
|
22
|
+
asciidoctor (2.0.10)
|
23
|
+
asciidoctor-diagram (1.5.18)
|
24
|
+
asciidoctor (>= 1.5.0, < 3.x)
|
25
|
+
asciidoctor-epub3 (1.5.0.alpha.9)
|
26
|
+
asciidoctor (>= 1.5.0, < 3.0.0)
|
27
|
+
concurrent-ruby (~> 1.1.5)
|
28
|
+
gepub (~> 1.0.2)
|
29
|
+
thread_safe (~> 0.3.6)
|
30
|
+
asciidoctor-pdf (1.5.0.beta.2)
|
31
|
+
asciidoctor (>= 1.5.3, < 3.0.0)
|
32
|
+
concurrent-ruby (~> 1.1.0)
|
33
|
+
prawn (~> 2.2.0)
|
34
|
+
prawn-icon (~> 2.4.0)
|
35
|
+
prawn-svg (~> 0.29.0)
|
36
|
+
prawn-table (~> 0.2.0)
|
37
|
+
prawn-templates (~> 0.1.0)
|
38
|
+
safe_yaml (~> 1.0.0)
|
39
|
+
thread_safe (~> 0.3.0)
|
40
|
+
treetop (~> 1.5.0)
|
41
|
+
concurrent-ruby (1.1.5)
|
42
|
+
css_parser (1.7.0)
|
43
|
+
addressable
|
44
|
+
epubcheck (3.0.1)
|
45
|
+
ffi (1.11.1)
|
46
|
+
gepub (1.0.4)
|
47
|
+
nokogiri (>= 1.8.2, < 1.11)
|
48
|
+
rubyzip (>= 1.1.1)
|
49
|
+
hashery (2.1.2)
|
50
|
+
kindlegen (3.0.3)
|
51
|
+
rake
|
52
|
+
rubyzip
|
53
|
+
listen (3.1.5)
|
54
|
+
rb-fsevent (~> 0.9, >= 0.9.4)
|
55
|
+
rb-inotify (~> 0.9, >= 0.9.7)
|
56
|
+
ruby_dep (~> 1.2)
|
57
|
+
mini_portile2 (2.4.0)
|
58
|
+
minitest (5.11.3)
|
59
|
+
nokogiri (1.10.3)
|
60
|
+
mini_portile2 (~> 2.4.0)
|
61
|
+
pdf-core (0.7.0)
|
62
|
+
pdf-reader (2.2.1)
|
63
|
+
Ascii85 (~> 1.0.0)
|
64
|
+
afm (~> 0.2.1)
|
65
|
+
hashery (~> 2.0)
|
66
|
+
ruby-rc4
|
67
|
+
ttfunk
|
68
|
+
polyglot (0.3.5)
|
69
|
+
prawn (2.2.2)
|
70
|
+
pdf-core (~> 0.7.0)
|
71
|
+
ttfunk (~> 1.5)
|
72
|
+
prawn-icon (2.4.0)
|
73
|
+
prawn (>= 1.1.0, < 3.0.0)
|
74
|
+
prawn-svg (0.29.1)
|
75
|
+
css_parser (~> 1.6)
|
76
|
+
prawn (>= 0.11.1, < 3)
|
77
|
+
prawn-table (0.2.2)
|
78
|
+
prawn (>= 1.3.0, < 3.0.0)
|
79
|
+
prawn-templates (0.1.1)
|
80
|
+
pdf-reader (~> 2.0)
|
81
|
+
prawn (~> 2.2)
|
82
|
+
public_suffix (3.1.1)
|
83
|
+
rake (10.5.0)
|
84
|
+
rb-fsevent (0.10.3)
|
85
|
+
rb-inotify (0.10.0)
|
86
|
+
ffi (~> 1.0)
|
87
|
+
rouge (3.7.0)
|
88
|
+
ruby-rc4 (0.1.5)
|
89
|
+
ruby_dep (1.5.0)
|
90
|
+
rubyzip (1.2.3)
|
91
|
+
safe_yaml (1.0.5)
|
92
|
+
thor (0.20.3)
|
93
|
+
thread_safe (0.3.6)
|
94
|
+
treetop (1.5.3)
|
95
|
+
polyglot (~> 0.3)
|
96
|
+
ttfunk (1.5.1)
|
97
|
+
|
98
|
+
PLATFORMS
|
99
|
+
ruby
|
100
|
+
|
101
|
+
DEPENDENCIES
|
102
|
+
bundler (~> 2.0)
|
103
|
+
minitest (~> 5.0)
|
104
|
+
rake (~> 10.0)
|
105
|
+
techbook!
|
106
|
+
|
107
|
+
BUNDLED WITH
|
108
|
+
2.0.2
|
data/README.md
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
# Techbook
|
2
|
+
|
3
|
+
A simple platfform to write (better) technical books.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Install it yourself as:
|
8
|
+
|
9
|
+
```
|
10
|
+
$ gem install techbook
|
11
|
+
```
|
12
|
+
|
13
|
+
## Usage
|
14
|
+
|
15
|
+
Create techinical books is never been easy. First `generate` files then `build`:
|
16
|
+
|
17
|
+
```
|
18
|
+
$ techbook generate your-book
|
19
|
+
$ cd your-book
|
20
|
+
$ techbook build
|
21
|
+
```
|
22
|
+
|
23
|
+
Any doubt just type `help`:
|
24
|
+
|
25
|
+
```
|
26
|
+
$ techbook help
|
27
|
+
```
|
28
|
+
|
29
|
+
## Development
|
30
|
+
|
31
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests.
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/felipefontoura/techbook.
|
data/Rakefile
ADDED
data/TODO.md
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "techbook"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
data/exe/techbook
ADDED
@@ -0,0 +1,139 @@
|
|
1
|
+
require "techbook"
|
2
|
+
|
3
|
+
require "asciidoctor"
|
4
|
+
require "asciidoctor-pdf"
|
5
|
+
require "asciidoctor-epub3"
|
6
|
+
require "asciidoctor-diagram"
|
7
|
+
require "listen"
|
8
|
+
require "fileutils"
|
9
|
+
|
10
|
+
module Techbook
|
11
|
+
class Builder
|
12
|
+
attr_accessor :basename, :pdf, :html, :epub, :mobi, :output, :file, :path
|
13
|
+
|
14
|
+
def self.run(pdf:, html:, epub:, mobi:, output:, watch:)
|
15
|
+
b = new pdf, html, epub, mobi, output
|
16
|
+
b.build
|
17
|
+
|
18
|
+
if watch
|
19
|
+
Signal.trap("SIGINT") do
|
20
|
+
puts "Bye :)".green
|
21
|
+
exit
|
22
|
+
end
|
23
|
+
|
24
|
+
puts "Watching changes for #{output}".green
|
25
|
+
|
26
|
+
listener = Listen.to(File.join(output, "book")) { b.build }
|
27
|
+
listener.start
|
28
|
+
sleep
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def initialize(pdf, html, epub, mobi, output)
|
33
|
+
@pdf = pdf
|
34
|
+
@html = html
|
35
|
+
@epub = epub
|
36
|
+
@mobi = mobi
|
37
|
+
@output = output
|
38
|
+
|
39
|
+
@basename = File.basename @output
|
40
|
+
@book = File.join @output, "#{@basename}.asc"
|
41
|
+
@path = File.join @output, "build"
|
42
|
+
end
|
43
|
+
|
44
|
+
def build
|
45
|
+
puts "Building book...".yellow
|
46
|
+
|
47
|
+
prepare
|
48
|
+
generate_includes
|
49
|
+
|
50
|
+
build_pdf
|
51
|
+
build_html
|
52
|
+
build_epub
|
53
|
+
build_mobi
|
54
|
+
|
55
|
+
dist
|
56
|
+
clean
|
57
|
+
end
|
58
|
+
|
59
|
+
private
|
60
|
+
|
61
|
+
def prepare
|
62
|
+
FileUtils.mkdir_p File.join(@path, "img")
|
63
|
+
FileUtils.mkdir_p File.join(@path, "src")
|
64
|
+
|
65
|
+
Dir.glob(File.join(@output, "book", "**", "img", "*")).each do |img|
|
66
|
+
FileUtils.copy(img, File.join(@path, "img", File.basename(img)))
|
67
|
+
end
|
68
|
+
|
69
|
+
Dir.glob(File.join(@output, "book", "**", "src", "*")).each do |src|
|
70
|
+
FileUtils.copy(src, File.join(@path, "src", File.basename(src)))
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
def generate_includes
|
75
|
+
content = File.read @book
|
76
|
+
content = content.lines.reject { |line|
|
77
|
+
line =~ /include::/
|
78
|
+
}.join
|
79
|
+
|
80
|
+
Dir.glob(File.join(@output, "book", "*.asc")).each do |file|
|
81
|
+
next unless file =~ /[0-9]+\-/
|
82
|
+
content << "include::#{File.basename(file)}[]\n"
|
83
|
+
end
|
84
|
+
|
85
|
+
File.open(@book, "w") { |file| file.write(content) }
|
86
|
+
end
|
87
|
+
|
88
|
+
def build_pdf
|
89
|
+
puts "[" + (@pdf ? "✓".green : "✕".red) + "] PDF"
|
90
|
+
return unless @pdf
|
91
|
+
|
92
|
+
Asciidoctor.convert_file @book, base_options.merge(backend: "pdf")
|
93
|
+
end
|
94
|
+
|
95
|
+
def build_html
|
96
|
+
puts "[" + (@html ? "✓".green : "✕".red) + "] HTML"
|
97
|
+
return unless @html
|
98
|
+
|
99
|
+
Asciidoctor.convert_file @book, base_options.merge(backend: "html")
|
100
|
+
end
|
101
|
+
|
102
|
+
def build_epub
|
103
|
+
puts "[" + (@epub ? "✓".green : "✕".red) + "] EPUB"
|
104
|
+
return unless @epub
|
105
|
+
|
106
|
+
Asciidoctor.convert_file @book, base_options.merge(backend: "epub3")
|
107
|
+
end
|
108
|
+
|
109
|
+
def build_mobi
|
110
|
+
puts "[" + (@mobi ? "✓".green : "✕".red) + "] MOBI"
|
111
|
+
return unless @mobi
|
112
|
+
|
113
|
+
Asciidoctor.convert_file @book, base_options.merge(ebook_format: "kf8", backend: "epub3")
|
114
|
+
end
|
115
|
+
|
116
|
+
def base_options
|
117
|
+
{ safe: Asciidoctor::SafeMode::UNSAFE,
|
118
|
+
base_dir: File.join(@output, "book"),
|
119
|
+
to_dir: @path }
|
120
|
+
end
|
121
|
+
|
122
|
+
def dist
|
123
|
+
FileUtils.mkdir_p File.join(@output, "dist", "img")
|
124
|
+
FileUtils.mkdir_p File.join(@output, "dist", "src")
|
125
|
+
|
126
|
+
FileUtils.copy_entry File.join(@path, "img"), File.join(@output, "dist", "img")
|
127
|
+
FileUtils.copy_entry File.join(@path, "src"), File.join(@output, "dist", "src")
|
128
|
+
|
129
|
+
FileUtils.copy File.join(@path, "#{@basename}.pdf"), File.join(@output, "dist") if @pdf
|
130
|
+
FileUtils.copy File.join(@path, "#{@basename}.html"), File.join(@output, "dist") if @html
|
131
|
+
FileUtils.copy File.join(@path, "#{@basename}.epub"), File.join(@output, "dist") if @epub
|
132
|
+
FileUtils.copy File.join(@path, "#{@basename}.mobi"), File.join(@output, "dist") if @mobi
|
133
|
+
end
|
134
|
+
|
135
|
+
def clean
|
136
|
+
FileUtils.rm_rf @path
|
137
|
+
end
|
138
|
+
end
|
139
|
+
end
|
data/lib/techbook/cli.rb
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
require "techbook"
|
2
|
+
require "thor"
|
3
|
+
|
4
|
+
module Techbook
|
5
|
+
class CLI < Thor
|
6
|
+
class_option :output, aliases: 'o', default: Dir.pwd
|
7
|
+
|
8
|
+
option :author, aliases: 'a', default: 'Your Name'
|
9
|
+
option :email, aliases: 'e', default: 'you@example.com'
|
10
|
+
option :lang, aliases: 'l', default: 'en'
|
11
|
+
desc "generate NAME", "Create book templates as NAME in specified output."
|
12
|
+
def generate(name)
|
13
|
+
Generator::run name, author: options[:author],
|
14
|
+
email: options[:email],
|
15
|
+
output: options[:output],
|
16
|
+
lang: options[:lang]
|
17
|
+
end
|
18
|
+
|
19
|
+
option :pdf, type: :boolean, default: true
|
20
|
+
option :mobi, type: :boolean
|
21
|
+
option :epub, type: :boolean
|
22
|
+
option :html, type: :boolean
|
23
|
+
option :watch, type: :boolean
|
24
|
+
desc "build", "Build the book."
|
25
|
+
def build
|
26
|
+
Builder.run pdf: options[:pdf],
|
27
|
+
mobi: options[:mobi],
|
28
|
+
epub: options[:epub],
|
29
|
+
html: options[:html],
|
30
|
+
output: options[:output],
|
31
|
+
watch: options[:watch]
|
32
|
+
end
|
33
|
+
|
34
|
+
# desc "publish", "Publish to common hosting services."
|
35
|
+
# def publish
|
36
|
+
# puts "Hello world"
|
37
|
+
# end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,66 @@
|
|
1
|
+
require "techbook"
|
2
|
+
|
3
|
+
require "fileutils"
|
4
|
+
require "erb"
|
5
|
+
|
6
|
+
module Techbook
|
7
|
+
class Generator
|
8
|
+
attr_accessor :name, :author, :email, :path, :basename, :output, :lang
|
9
|
+
|
10
|
+
def self.run(name, author:, email:, output:, lang:)
|
11
|
+
g = new name, author, email, output, lang
|
12
|
+
g.generate
|
13
|
+
end
|
14
|
+
|
15
|
+
def initialize(name, author, email, output, lang)
|
16
|
+
@name = name
|
17
|
+
@author = author
|
18
|
+
@email = email
|
19
|
+
@output = output
|
20
|
+
@lang = lang
|
21
|
+
end
|
22
|
+
|
23
|
+
def generate
|
24
|
+
puts "Generating book as #{@name} in #{@output}...".yellow
|
25
|
+
create_dir
|
26
|
+
copy_files
|
27
|
+
render_files
|
28
|
+
end
|
29
|
+
|
30
|
+
private
|
31
|
+
|
32
|
+
def create_dir
|
33
|
+
@basename = sanitize(@name)
|
34
|
+
@path = File.join @output, @basename
|
35
|
+
FileUtils.mkdir_p File.join(@path, "book", "img")
|
36
|
+
FileUtils.mkdir_p File.join(@path, "book", "src")
|
37
|
+
end
|
38
|
+
|
39
|
+
def copy_files
|
40
|
+
FileUtils.cp File.join(Techbook.root, "templates", "book-theme.yml"), File.join(@path, "#{@basename}-theme.yml")
|
41
|
+
FileUtils.cp File.join(Techbook.root, "templates", "keep"), File.join(@path, "book", "img", ".keep")
|
42
|
+
FileUtils.cp File.join(Techbook.root, "templates", "keep"), File.join(@path, "book", "src", ".keep")
|
43
|
+
FileUtils.cp File.join(Techbook.root, "templates", "gitignore"), File.join(@path, ".gitignore")
|
44
|
+
end
|
45
|
+
|
46
|
+
def render_files
|
47
|
+
layout = File.read File.join(Techbook.root, "templates", "book.asc.erb")
|
48
|
+
File.open(File.join(@path, "#{@basename}.asc"), "w") { |file| file.write(ERB.new(layout).result(binding)) }
|
49
|
+
|
50
|
+
first_chapter = File.read File.join(Techbook.root, "templates", "01-first-chapter.asc.erb")
|
51
|
+
File.open(File.join(@path, "book", "01-first-chapter.asc"), "w") { |file| file.write(ERB.new(first_chapter).result(binding)) }
|
52
|
+
|
53
|
+
readme = File.read File.join(Techbook.root, "templates", "README.md.erb")
|
54
|
+
File.open(File.join(@path, "README.md"), "w") { |file| file.write(ERB.new(readme).result(binding)) }
|
55
|
+
end
|
56
|
+
|
57
|
+
def sanitize(filename)
|
58
|
+
filename.strip do |name|
|
59
|
+
name.gsub!(/^.*(\\|\/)/, '')
|
60
|
+
name.gsub!(/[^0-9A-Za-z.\-]/, '_')
|
61
|
+
end
|
62
|
+
|
63
|
+
filename
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
data/lib/techbook.rb
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
require "techbook/version"
|
2
|
+
require "techbook/generator"
|
3
|
+
require "techbook/builder"
|
4
|
+
require "techbook/publisher"
|
5
|
+
|
6
|
+
module Techbook
|
7
|
+
class Error < StandardError; end
|
8
|
+
|
9
|
+
def self.root
|
10
|
+
File.dirname __dir__
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
class String
|
15
|
+
# colorization
|
16
|
+
def colorize(color_code)
|
17
|
+
"\e[#{color_code}m#{self}\e[0m"
|
18
|
+
end
|
19
|
+
|
20
|
+
def red
|
21
|
+
colorize(31)
|
22
|
+
end
|
23
|
+
|
24
|
+
def green
|
25
|
+
colorize(32)
|
26
|
+
end
|
27
|
+
|
28
|
+
def yellow
|
29
|
+
colorize(33)
|
30
|
+
end
|
31
|
+
|
32
|
+
def blue
|
33
|
+
colorize(34)
|
34
|
+
end
|
35
|
+
|
36
|
+
def pink
|
37
|
+
colorize(35)
|
38
|
+
end
|
39
|
+
|
40
|
+
def light_blue
|
41
|
+
colorize(36)
|
42
|
+
end
|
43
|
+
end
|
data/techbook.gemspec
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
lib = File.expand_path("lib", __dir__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
require "techbook/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "techbook"
|
7
|
+
spec.version = Techbook::VERSION
|
8
|
+
spec.authors = ["Felipe Fontoura"]
|
9
|
+
spec.email = ["contato@devsamurai.com.br"]
|
10
|
+
|
11
|
+
spec.summary = ""
|
12
|
+
spec.description = ""
|
13
|
+
spec.homepage = "https://github.com/felipefontoura/techbook"
|
14
|
+
|
15
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
16
|
+
spec.metadata["source_code_uri"] = "https://github.com/felipefontoura/techbook"
|
17
|
+
spec.metadata["changelog_uri"] = "https://github.com/felipefontoura/techbook"
|
18
|
+
|
19
|
+
# Specify which files should be added to the gem when it is released.
|
20
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
21
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
22
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
23
|
+
end
|
24
|
+
spec.bindir = "exe"
|
25
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
26
|
+
spec.require_paths = ["lib"]
|
27
|
+
|
28
|
+
spec.add_dependency "thor", "~> 0.20"
|
29
|
+
spec.add_dependency "listen", "~> 3.1", ">= 3.1.5"
|
30
|
+
spec.add_dependency "rouge", "~> 3.3"
|
31
|
+
spec.add_dependency "asciidoctor", "~> 2.0"
|
32
|
+
spec.add_dependency "asciidoctor-pdf", "~> 1.5.0.alpha.18"
|
33
|
+
spec.add_dependency "asciidoctor-epub3", "~> 1.5.0.alpha.9"
|
34
|
+
spec.add_dependency "asciidoctor-diagram", "~> 1.5", ">= 1.5.18"
|
35
|
+
spec.add_dependency "epubcheck", "~> 3.0", ">= 3.0.1"
|
36
|
+
spec.add_dependency "kindlegen", "~> 3.0", ">= 3.0.3"
|
37
|
+
|
38
|
+
spec.add_development_dependency "bundler", "~> 2.0"
|
39
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
40
|
+
spec.add_development_dependency "minitest", "~> 5.0"
|
41
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
== My first chapter
|
@@ -0,0 +1,36 @@
|
|
1
|
+
= <%= name %>
|
2
|
+
<%= author %> <<%= email %>>
|
3
|
+
:doctype: book
|
4
|
+
:reproducible:
|
5
|
+
:experimental:
|
6
|
+
:icons: font
|
7
|
+
:toc:
|
8
|
+
:toclevels: 2
|
9
|
+
:toc-placement: preamble
|
10
|
+
ifdef::backend-pdf[]
|
11
|
+
:pdf-theme: <%= basename %>
|
12
|
+
:pdf-themesdir: {docdir}/../
|
13
|
+
// :title-logo-image: img:cover.svg[pdfwidth=4.25in,align=center]
|
14
|
+
:source-highlighter: rouge
|
15
|
+
// :rouge-style: monokai.sublime
|
16
|
+
endif::[]
|
17
|
+
:lang: <%= lang %>
|
18
|
+
:appendix-caption: Appendix
|
19
|
+
:caution-caption: Caution
|
20
|
+
:warning-caption: Warning
|
21
|
+
:chapter-label: Chapter
|
22
|
+
:example-caption: Example
|
23
|
+
:figure-caption: Figure
|
24
|
+
:important-caption: Important
|
25
|
+
:last-update-label: Last update
|
26
|
+
:listing-caption: Code
|
27
|
+
:manname-title: NAME
|
28
|
+
:note-caption: Note
|
29
|
+
:table-caption: Table
|
30
|
+
:tip-caption: Tip
|
31
|
+
:toc-title: Contents
|
32
|
+
:untitled-label: No Title
|
33
|
+
:version-label: Version
|
34
|
+
|
35
|
+
// New chapters will be included automatically here...
|
36
|
+
include::book/01-first-chapter.asc[]
|
data/templates/gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
build
|
data/templates/keep
ADDED
File without changes
|
metadata
ADDED
@@ -0,0 +1,262 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: techbook
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Felipe Fontoura
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-08-05 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: thor
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.20'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0.20'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: listen
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '3.1'
|
34
|
+
- - ">="
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: 3.1.5
|
37
|
+
type: :runtime
|
38
|
+
prerelease: false
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - "~>"
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '3.1'
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 3.1.5
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: rouge
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - "~>"
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '3.3'
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - "~>"
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '3.3'
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: asciidoctor
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - "~>"
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '2.0'
|
68
|
+
type: :runtime
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - "~>"
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '2.0'
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: asciidoctor-pdf
|
77
|
+
requirement: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - "~>"
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: 1.5.0.alpha.18
|
82
|
+
type: :runtime
|
83
|
+
prerelease: false
|
84
|
+
version_requirements: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - "~>"
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: 1.5.0.alpha.18
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
name: asciidoctor-epub3
|
91
|
+
requirement: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - "~>"
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: 1.5.0.alpha.9
|
96
|
+
type: :runtime
|
97
|
+
prerelease: false
|
98
|
+
version_requirements: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - "~>"
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: 1.5.0.alpha.9
|
103
|
+
- !ruby/object:Gem::Dependency
|
104
|
+
name: asciidoctor-diagram
|
105
|
+
requirement: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - "~>"
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '1.5'
|
110
|
+
- - ">="
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
version: 1.5.18
|
113
|
+
type: :runtime
|
114
|
+
prerelease: false
|
115
|
+
version_requirements: !ruby/object:Gem::Requirement
|
116
|
+
requirements:
|
117
|
+
- - "~>"
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: '1.5'
|
120
|
+
- - ">="
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
version: 1.5.18
|
123
|
+
- !ruby/object:Gem::Dependency
|
124
|
+
name: epubcheck
|
125
|
+
requirement: !ruby/object:Gem::Requirement
|
126
|
+
requirements:
|
127
|
+
- - "~>"
|
128
|
+
- !ruby/object:Gem::Version
|
129
|
+
version: '3.0'
|
130
|
+
- - ">="
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: 3.0.1
|
133
|
+
type: :runtime
|
134
|
+
prerelease: false
|
135
|
+
version_requirements: !ruby/object:Gem::Requirement
|
136
|
+
requirements:
|
137
|
+
- - "~>"
|
138
|
+
- !ruby/object:Gem::Version
|
139
|
+
version: '3.0'
|
140
|
+
- - ">="
|
141
|
+
- !ruby/object:Gem::Version
|
142
|
+
version: 3.0.1
|
143
|
+
- !ruby/object:Gem::Dependency
|
144
|
+
name: kindlegen
|
145
|
+
requirement: !ruby/object:Gem::Requirement
|
146
|
+
requirements:
|
147
|
+
- - "~>"
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
version: '3.0'
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: 3.0.3
|
153
|
+
type: :runtime
|
154
|
+
prerelease: false
|
155
|
+
version_requirements: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - "~>"
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '3.0'
|
160
|
+
- - ">="
|
161
|
+
- !ruby/object:Gem::Version
|
162
|
+
version: 3.0.3
|
163
|
+
- !ruby/object:Gem::Dependency
|
164
|
+
name: bundler
|
165
|
+
requirement: !ruby/object:Gem::Requirement
|
166
|
+
requirements:
|
167
|
+
- - "~>"
|
168
|
+
- !ruby/object:Gem::Version
|
169
|
+
version: '2.0'
|
170
|
+
type: :development
|
171
|
+
prerelease: false
|
172
|
+
version_requirements: !ruby/object:Gem::Requirement
|
173
|
+
requirements:
|
174
|
+
- - "~>"
|
175
|
+
- !ruby/object:Gem::Version
|
176
|
+
version: '2.0'
|
177
|
+
- !ruby/object:Gem::Dependency
|
178
|
+
name: rake
|
179
|
+
requirement: !ruby/object:Gem::Requirement
|
180
|
+
requirements:
|
181
|
+
- - "~>"
|
182
|
+
- !ruby/object:Gem::Version
|
183
|
+
version: '10.0'
|
184
|
+
type: :development
|
185
|
+
prerelease: false
|
186
|
+
version_requirements: !ruby/object:Gem::Requirement
|
187
|
+
requirements:
|
188
|
+
- - "~>"
|
189
|
+
- !ruby/object:Gem::Version
|
190
|
+
version: '10.0'
|
191
|
+
- !ruby/object:Gem::Dependency
|
192
|
+
name: minitest
|
193
|
+
requirement: !ruby/object:Gem::Requirement
|
194
|
+
requirements:
|
195
|
+
- - "~>"
|
196
|
+
- !ruby/object:Gem::Version
|
197
|
+
version: '5.0'
|
198
|
+
type: :development
|
199
|
+
prerelease: false
|
200
|
+
version_requirements: !ruby/object:Gem::Requirement
|
201
|
+
requirements:
|
202
|
+
- - "~>"
|
203
|
+
- !ruby/object:Gem::Version
|
204
|
+
version: '5.0'
|
205
|
+
description: ''
|
206
|
+
email:
|
207
|
+
- contato@devsamurai.com.br
|
208
|
+
executables:
|
209
|
+
- techbook
|
210
|
+
extensions: []
|
211
|
+
extra_rdoc_files: []
|
212
|
+
files:
|
213
|
+
- ".editorconfig"
|
214
|
+
- ".gitignore"
|
215
|
+
- ".travis.yml"
|
216
|
+
- Gemfile
|
217
|
+
- Gemfile.lock
|
218
|
+
- README.md
|
219
|
+
- Rakefile
|
220
|
+
- TODO.md
|
221
|
+
- bin/console
|
222
|
+
- bin/setup
|
223
|
+
- exe/techbook
|
224
|
+
- lib/techbook.rb
|
225
|
+
- lib/techbook/builder.rb
|
226
|
+
- lib/techbook/cli.rb
|
227
|
+
- lib/techbook/generator.rb
|
228
|
+
- lib/techbook/publisher.rb
|
229
|
+
- lib/techbook/version.rb
|
230
|
+
- techbook.gemspec
|
231
|
+
- templates/01-first-chapter.asc.erb
|
232
|
+
- templates/README.md.erb
|
233
|
+
- templates/book-theme.yml
|
234
|
+
- templates/book.asc.erb
|
235
|
+
- templates/gitignore
|
236
|
+
- templates/keep
|
237
|
+
homepage: https://github.com/felipefontoura/techbook
|
238
|
+
licenses: []
|
239
|
+
metadata:
|
240
|
+
homepage_uri: https://github.com/felipefontoura/techbook
|
241
|
+
source_code_uri: https://github.com/felipefontoura/techbook
|
242
|
+
changelog_uri: https://github.com/felipefontoura/techbook
|
243
|
+
post_install_message:
|
244
|
+
rdoc_options: []
|
245
|
+
require_paths:
|
246
|
+
- lib
|
247
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
248
|
+
requirements:
|
249
|
+
- - ">="
|
250
|
+
- !ruby/object:Gem::Version
|
251
|
+
version: '0'
|
252
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
253
|
+
requirements:
|
254
|
+
- - ">="
|
255
|
+
- !ruby/object:Gem::Version
|
256
|
+
version: '0'
|
257
|
+
requirements: []
|
258
|
+
rubygems_version: 3.0.4
|
259
|
+
signing_key:
|
260
|
+
specification_version: 4
|
261
|
+
summary: ''
|
262
|
+
test_files: []
|