bookmaker 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,130 @@
1
+ bookmaker
2
+ =========
3
+
4
+ Bookmaker provides authors a free, ruby-based production toolchain for self-published paper and electronic books using the [LaTeX](http://www.latex-project.org/) document preparation system. The code base borrows heavily from [Kitabu](https://github.com/fnando/kitabu), while replacing [Prince](http://princexml.com) as the PDF generator (due to licensing issues).
5
+
6
+ Bookmaker requires familiarity with LaTeX. Many TeX features are lacking when exporting to HTML, EPUB or MOBI.
7
+
8
+ What Does Bookmaker Provide?
9
+ ----------------------------
10
+
11
+ * Write using LaTeX
12
+ * Paper Support: Book-quality PDF output (6"x9") using [Memoir](http://www.ctan.org/tex-archive/macros/latex/contrib/memoir), suitable for publishing via [Createspace](https://www.createspace.com).
13
+ * Electronic Support: HTML, Epub and Mobi output (using [kindlegen](http://kindlegen.s3.amazonaws.com)).
14
+ * Table of Contents automatically generated from chapter titles
15
+
16
+ Installation
17
+ -------------
18
+
19
+ To install Bookmaker, you’ll need a working [Ruby](http://www.ruby-lang.org) 1.9+ installation.
20
+
21
+ gem install bookmaker
22
+
23
+ <!--
24
+
25
+ After installing Bookmaker, run the following command to check your external
26
+ dependencies.
27
+
28
+ $ bookmaker check
29
+
30
+ KindleGen: Converts ePub e-books into .mobi files.
31
+ Installed.
32
+
33
+ html2text: Converts HTML documents into plain text.
34
+ Not installed.
35
+
36
+ pygments.rb: A generic syntax highlight. If installed, replaces CodeRay.
37
+ Not installed.
38
+
39
+ There's no requirements here; just make sure you cleared the correct dependency based
40
+ on the formats you want to export to.
41
+
42
+ -->
43
+
44
+ How to Use Bookmaker
45
+ --------------------
46
+
47
+ To create a new Bookmaker project, execute the following on the command line:
48
+
49
+ $ bookmaker new mybook
50
+
51
+ This command creates a directory <tt>mybook</tt> with the following structure:
52
+
53
+ mybook
54
+ ├── _bookmaker.yml
55
+ ├── output
56
+ ├── templates
57
+ │ ├── epub
58
+ │ │ ├── cover.erb
59
+ │ │ ├── cover.png
60
+ │ │ ├── page.erb
61
+ │ │ └── user.css
62
+ │ └── html
63
+ │ ├── layout.css
64
+ │ ├── layout.erb
65
+ │ ├── syntax.css
66
+ │ └── user.css
67
+ └── text
68
+ └── 01_Chapter
69
+ └──01_Welcome.md
70
+
71
+ The <tt>_bookmaker.yml</tt> file holds the project's metadata. Update the relevant fields.
72
+
73
+ Now it's time to write your e-book. All your book content will be placed on the text directory. Bookmaker requires you to separate your book into chapters. A chapter is nothing but a directory that holds lots of text files. The e-book will be generated using every folder/file alphabetically. So be sure to use a sequential numbering as the name. Here's a sample:
74
+
75
+ * text
76
+ * 01_Introduction
77
+ * 01_introduction.tex
78
+ * 02_What_is_Ruby_on_Rails
79
+ * 01_MVC.tex
80
+ * 02_DRY.tex
81
+ * 03_Convention_Over_Configuration.tex
82
+ * 03_Installing_Ruby_on_Rails
83
+ * 01_Installing.tex
84
+ * 02_Mac_OS_X_instructions.tex
85
+ * 03_Windows_instructions.tex
86
+ * 04_Ubuntu_Linux_instructions.tex
87
+
88
+ Please note, **Kitabu** allows multiple file formats. **Bookmaker** only allows <tt>.tex</tt>.
89
+
90
+ You'll want to see your progress eventually; it's time for you to generate the book PDF. Run the command <tt>bookmaker export</tt> and your book will be created on the <tt>output</tt> directory.
91
+
92
+ Bookmaker can generate a Table of Contents (TOC) based on your h2-h6 tags. The h1 tag is discarded because it's meant to be the book title.
93
+
94
+ To print the TOC, you need to print a variable called +toc+, using the eRb tag.
95
+
96
+ <%= toc %>
97
+
98
+
99
+ ### References
100
+
101
+ * [LaTeX](http://en.wikipedia.org/wiki/LaTeX) [http://www.latex-project.org/](http://www.latex-project.org/)
102
+
103
+ ## Samples
104
+
105
+ ## Maintainer
106
+
107
+ * Ben Wilson [http://dausha.net](http://dausha.net)
108
+
109
+ ## License
110
+
111
+ (The MIT License)
112
+
113
+ Permission is hereby granted, free of charge, to any person obtaining
114
+ a copy of this software and associated documentation files (the
115
+ 'Software'), to deal in the Software without restriction, including
116
+ without limitation the rights to use, copy, modify, merge, publish,
117
+ distribute, sublicense, and/or sell copies of the Software, and to
118
+ permit persons to whom the Software is furnished to do so, subject to
119
+ the following conditions:
120
+
121
+ The above copyright notice and this permission notice shall be
122
+ included in all copies or substantial portions of the Software.
123
+
124
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
125
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
126
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
127
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
128
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
129
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
130
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -24,14 +24,7 @@ Gem::Specification.new do |s|
24
24
  s.add_development_dependency "cucumber"
25
25
  s.add_dependency "eeepub"
26
26
  s.add_dependency "kramdown"
27
- s.add_dependency "thor"
28
- # s.add_dependency "erb"
29
- # s.add_dependency "logger"
27
+ s.add_dependency "thor"
30
28
  s.add_dependency "nokogiri"
31
29
  s.add_dependency "notifier"
32
- # s.add_dependency "open3"
33
- # s.add_dependency "optparse"
34
- # s.add_dependency "ostruct"
35
- # s.add_dependency "tempfile"
36
- # s.add_dependency "pathname"
37
30
  end
@@ -1,5 +1,6 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  require 'thor'
3
+ require 'bookmaker/version'
3
4
  module Bookmaker
4
5
  class Cli < Thor
5
6
  FORMATS = %w[pdf draft proof html epub mobi txt]
@@ -16,8 +17,9 @@ module Bookmaker
16
17
  end
17
18
 
18
19
  desc "create", "Start new work"
20
+ map %w(create new) => :create
19
21
  def create(path)
20
- puts "A Million Monkeys Writing Your Masterpiece."
22
+ puts "Bookmaker -- A Million Monkeys Writing Your Masterpiece."
21
23
  generator = Generator.new
22
24
  generator.destination_root = path.squish.gsub(' ','-')
23
25
  generator.invoke_all
@@ -16,6 +16,7 @@ module Bookmaker
16
16
 
17
17
  copy_file "html.erb", "templates/html/layout.erb"
18
18
  copy_file "user.css", "templates/html/user.css"
19
+ copy_file "layout.css", "templates/html/layout.css"
19
20
  copy_file "syntax.css", "templates/html/syntax.css"
20
21
 
21
22
  copy_file "epub.erb", "templates/epub/page.erb"
@@ -2,7 +2,7 @@ module Bookmaker
2
2
  module Parser
3
3
  class Epub < Base
4
4
  def sections
5
- @sections ||= html.css("div.section").each_with_index.map do |chapter, index|
5
+ @sections ||= html.css("div.chapter").each_with_index.map do |chapter, index|
6
6
  OpenStruct.new({
7
7
  :index => index,
8
8
  :filename => "section_#{index}.html",
@@ -11,10 +11,8 @@ module Bookmaker
11
11
  })
12
12
  end
13
13
  end
14
-
15
14
  def epub; @epub ||= EeePub.make ;end
16
15
  def html; @html ||= Nokogiri::HTML(html_path.read); end
17
-
18
16
  def parse
19
17
  puts "-- Exporting EPUB"
20
18
  epub.title config["title"]
@@ -24,12 +22,16 @@ module Bookmaker
24
22
  epub.date config["published_at"]
25
23
  epub.uid config["uid"]
26
24
  epub.identifier config["identifier"]["id"], :scheme => config["identifier"]["type"]
27
- epub.cover_page cover_image if cover_image && File.exist?(cover_image)
28
-
25
+ if cover_image.nil?
26
+ puts " - Consider adding a cover images in /images."
27
+ else
28
+ epub.cover cover_image
29
+ end
29
30
  write_sections!
30
- write_toc!
31
-
32
- epub.files sections.map(&:filepath) + assets
31
+ write_toc! #
32
+ # ap cover_page + sections.map(&:filepath) + assets
33
+ # exit
34
+ epub.files cover_page + sections.map(&:filepath) + assets
33
35
  epub.nav navigation
34
36
 
35
37
  epub.save(epub_path)
@@ -38,7 +40,9 @@ module Bookmaker
38
40
  p $!, $@
39
41
  false
40
42
  end
41
-
43
+ def cover_page
44
+ Dir[root_dir.join("templates/epub/cover.html")]
45
+ end
42
46
  def write_toc!
43
47
  toc = TOC::Epub.new(navigation)
44
48
  File.open(toc_path, "w") do |file|
@@ -96,13 +100,14 @@ module Bookmaker
96
100
  @assets ||= begin
97
101
  assets = Dir[root_dir.join("templates/epub/*.css")]
98
102
  assets += Dir[root_dir.join("images/**/*.{jpg,png,gif}")]
103
+ assets += # Dir[root_dir.join("templates/epub/cover.html")]
99
104
  assets
100
105
  end
101
106
  end
102
107
 
103
108
  def cover_image
104
- path = Dir[root_dir.join("templates/epub/cover.{jpg,png,gif}").to_s].first
105
- return path if path && File.exist?(path)
109
+ path = Dir[root_dir.join("images/cover.{jpg,png,gif}").to_s].first
110
+ return File.basename(path) if path && File.exist?(path)
106
111
  end
107
112
 
108
113
  def navigation
@@ -5,10 +5,15 @@ module Bookmaker
5
5
  def content
6
6
  raw = []
7
7
  entries.keys.each do |chapter|
8
- text = "<h2>#{chapter.split(/_/)[1].gsub('-',' ')}</h2>"
8
+ text = "<h2>#{chapter.split(/_/)[1].gsub('-',' ').titleize}</h2>"
9
9
  sections = []
10
10
  entries[chapter].each do |section|
11
- sections << "<p>#{read_content(section)[0].split(/\n{2,}/).map{|a| a.gsub("\n",' ').chomp}.join("</p>\n\n<p>")}</p>"
11
+ sections << "<p>#{read_content(section)[0].split(/\n{2,}/).map do |s|
12
+ s.gsub!(/%.*/, '')
13
+ s.squish
14
+ # s.gsub!("\n", ' ')
15
+ # s.chomp
16
+ end.join("</p>\n\n<p>")}</p>"
12
17
  end
13
18
  text << sections.join("\n\n<hr />\n\n")
14
19
  raw << "<div class='chapter'>\n#{text}\n</div>\n"
@@ -33,19 +38,26 @@ module Bookmaker
33
38
  def parse_layout(chapters)
34
39
  output = ''
35
40
  chapters.each do |text|
36
- text.gsub!(/%.*/,'')
37
- text.gsub!(/``(.*?)''/m) { "&ldquo;#{$1}&rdquo;"}
41
+ # text.gsub!("{%", "{")
42
+ # text.gsub!(/%.*/,'')
43
+ text.gsub!(/``(.*?'?)''/) { "&ldquo;#{$1}&rdquo;"}
44
+ text.gsub!(/``/, "&ldquo;")
45
+ text.gsub!(/\b'\b/) { "&#39;" }
46
+ text.gsub!(/`(.*?)'/) { "&lsquo;#{$1}&rsquo;"}
38
47
  # \{([^\}]+?)\} Within the curly braces.
39
- text.gsub!(/\\begin\{quote\}(.*?)\\end\{quote\}/m) { "<blockquote>#{$1}</blockquote>"}
48
+ text.gsub!(/\\Dash\{\}/, "&mdash;")
49
+ text.gsub!(/\\begin\{quote\}(.*?)\\end\{quote\}/m) { "<blockquote>#{$1.strip}</blockquote>"}
40
50
  text.gsub!(/<\/blockquote>\s+?<blockquote>/m, "\n")
41
- text.gsub!(/\\begin\{([^\}]+?)\}(.*?)\\end\{[^\}]+?\}/m) { "<div class='#{$1}'>#{$2}</div>"}
42
- text.gsub!(/\\section\{([^\}]+?)\}/m) { "<h3>#{$1}</h3>"}
43
- text.gsub!(/\\emph\{([^\}]+?)\}/m) { "<em>#{$1}</em>"}
44
- text.gsub!(/\\(.*?)\{([^\}]+?)\}/) { "<span class='#{$1}'>#{$2}</span>"}
51
+ text.gsub!(/\\begin\{([^\}]+?)\}(.*?)\\end\{[^\}]+?\}/m) { "<div class='#{$1.strip}'>#{$2.strip}</div>"}
52
+ text.gsub!(/\\section\{([^\}]+?)\}/m) { "<h3>#{$1.strip}</h3>"}
53
+ text.gsub!(/\\emph\{([^\}]+?)\}/m) { "<em>#{$1.strip}</em>"}
54
+ text.gsub!(/\\thought\{([^\}]+?)\}/m) { "<em>#{$1.strip}</em>"}
55
+ text.gsub!(/\\(.*?)\{([^\}]+?)\}/) { "<span class='#{$1}'>#{$2.strip}</span>"}
56
+ text.gsub!(/\\(.*?)\{([^\}]+?)\}/) { "<span class='#{$1}'>#{$2.strip}</span>"}
45
57
  text.gsub!(/<\/span>\{[^\}]+?}/, "</span>")
46
- text.gsub!(/<p><h([1-6])>(.*?)<\/h[1-6]><\/p>/) { "<h#{$1}>#{$2}</h#{$1}>"}
47
- text.gsub!(/\\Dash\{\}/, "&mdash;")
48
- text.gsub!(/\b'\b/) { "&#39;" }
58
+ text.gsub!(/<p><h([1-6])>(.*?)<\/h[1-6]><\/p>/) { "<h#{$1}>#{$2.strip}</h#{$1}>"}
59
+ text.gsub!(/(\S+)~(\S+)/) { "#{$1}&nbsp;#{$2}"}
60
+ # text.gsub!(/> +/, ">")
49
61
  output << text
50
62
  end
51
63
  output.gsub!(/\n\n+/, "\n\n")
@@ -5,8 +5,10 @@ module Bookmaker
5
5
  puts "-- Exporting MOBI"
6
6
  spawn_command ["kindlegen", epub_file.to_s,]
7
7
  true
8
+ rescue Exception
9
+ p $!, $@
10
+ false
8
11
  end
9
-
10
12
  def epub_file
11
13
  root_dir.join("output/#{name}.epub")
12
14
  end
@@ -1,3 +1,3 @@
1
1
  module Bookmaker
2
- VERSION = "0.4.0"
2
+ VERSION = "0.5.0"
3
3
  end
@@ -1,42 +1,45 @@
1
1
  <?xml version="1.0" encoding="utf-8" ?>
2
2
  <html xmlns="http://www.w3.org/1999/xhtml">
3
3
  <head>
4
- <title></title>
4
+ <title><%= title %></title>
5
5
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
6
  <meta name="generator" content="Bookmaker Gem" />
7
- <meta name="originator" content="<%= author %>" />
7
+ <meta name="author" content="<%= authors.to_sentence %>" />
8
+ <meta name="subject" content="<%= subject %>" />
9
+ <meta name="keywords" content="<%= keywords %>" />
10
+ <meta name="date" content="<%= published_at %>" />
11
+
8
12
  <!-- charset=utf-8,html,xhtml -->
9
13
  <meta name="date" content="<%= published_at %>" />
10
- <meta name="dc:Title" content="<%= title %>" />
11
- <style><!--
12
- /* Eliminate all default margin and padding settings */
13
- html,body,div,h1,h2,h3,h4,h5,p,blockquote {margin: 0; padding: 0.01em;}
14
14
 
15
- p {text-indent: 1.25em; margin-top: 0; margin-bottom: 0;}
16
-
17
- /* For chapter headings ( page break before recommended) */
18
- h1 { margin-top: 1em; }
19
- h2 { margin-top: 0.8em; }
20
- h3 { margin-top: 0.7em; }
21
- h4, h5, h6 { margin-top: 0.5em; }
22
- p {
23
- text-indent: 0; /* no indentation for the first line */
24
- margin-top: 0.3em; /* adjust top margin for paragraph */
25
- }
26
-
27
- /* Styles for list elements */
28
- /* Style for block quotes */
29
- blockquote {
30
- margin-top: 1em;
31
- margin-bottom: 1em;
32
- margin-left: 3em;
33
- margin-right: 3em;
34
- font-style: italic;
35
- }
36
- -->
37
- </style>
15
+ <link rel="stylesheet" type="text/css" href="../templates/html/layout.css"/>
16
+ <link rel="stylesheet" type="text/css" href="../templates/html/syntax.css"/>
17
+ <link rel="stylesheet" type="text/css" href="../templates/html/user.css"/>
38
18
  </head>
39
19
  <body>
40
- <%= contents %>
20
+ <div class="frontcover container">
21
+ <div>
22
+ <h1><%= title %></h1>
23
+ <p class="description"><%= subject %></p>
24
+ <p class="authors"><%= authors.to_sentence %></p>
25
+ </div>
26
+ </div>
27
+
28
+ <div class="table-of-contents">
29
+ <h2 class="no-toc">Content</h2>
30
+ <div id="toc">
31
+ <%= toc %>
32
+ </div>
33
+ </div>
34
+ <div id='chapters'>
35
+ <%= contents %>
36
+ </div>
37
+ <div class="imprint container">
38
+ <div>
39
+ <h2><%= title %></h2>
40
+ <p><%= authors.to_sentence %></p>
41
+ <p><%= copyright %></p>
42
+ </div>
43
+ </div>
41
44
  </body>
42
45
  </html>
@@ -0,0 +1,352 @@
1
+ /* ============ */
2
+ /* = DEFAULTS = */
3
+ /* ============ */
4
+ html * {
5
+ font: normal normal normal 12pt/normal Constantia, Palatino, "Palatino Linotype", "Palatino LT STD", Georgia, serif;
6
+ }
7
+
8
+ /* ========= */
9
+ /* = PAGES = */
10
+ /* ========= */
11
+ @page {
12
+ margin: 12mm 16mm 10mm 16mm;
13
+ size: 7in 9.25in landscape;
14
+
15
+ @footnotes {
16
+ border-top: thin solid black;
17
+ margin-left: 30%;
18
+ margin-top: 0.6em;
19
+ padding-top: 0.3em;
20
+ }
21
+
22
+ @bottom-right {
23
+ color: #000;
24
+ content: counter(page);
25
+ font-family: helvetica, arial, sans-serif;
26
+ font-size: 12px;
27
+ margin-top: -10px;
28
+ margin-right: -40px;
29
+ }
30
+ }
31
+
32
+ @page toc {
33
+ margin-right: 6mm;
34
+
35
+ @bottom-right {
36
+ content: "";
37
+ }
38
+ }
39
+
40
+ @page cover {
41
+ margin: 0;
42
+
43
+ @bottom-right {
44
+ content: "";
45
+ }
46
+ }
47
+
48
+ /* ============= */
49
+ /* = BOOKMARKS = */
50
+ /* ============= */
51
+ h1, h2, h3, h4, h5, h6 {
52
+ }
53
+
54
+ .frontcover h1 { }
55
+ .chapter h2 { }
56
+ .chapter h3 { }
57
+ .chapter h4 { }
58
+ .chapter h5 { }
59
+ .chapter h6 { }
60
+
61
+ /* ============= */
62
+ /* = CONTAINER = */
63
+ /* ============= */
64
+ div.container {
65
+ height: 7in;
66
+ left: 0;
67
+ page: cover;
68
+ position: absolute;
69
+ top: 0;
70
+ width: 9.25in;
71
+ z-index: -1;
72
+ }
73
+
74
+ /* ============== */
75
+ /* = FRONTCOVER = */
76
+ /* ============== */
77
+ div.frontcover {
78
+ background: #fff;
79
+ }
80
+
81
+ div.frontcover div {
82
+ left: 1in;
83
+ padding-top: 0.25in;
84
+ position: absolute;
85
+ top: 2.5in;
86
+ width: 7.25in;
87
+ }
88
+
89
+ div.frontcover h1 {
90
+ color: #f00;
91
+ font-size: 46pt;
92
+ }
93
+
94
+ div.frontcover p {
95
+ font-size: 18pt;
96
+ }
97
+
98
+ div.frontcover p.description {
99
+ color: #666;
100
+ font: italic normal normal 14pt/normal Baskerville, "Hoefler Text", Garamond, "Times New Roman", serif;
101
+ margin-top: -.1in;
102
+ }
103
+
104
+ div.frontcover p.authors {
105
+ color: #000;
106
+ font-style: italic;
107
+ position: absolute;
108
+ top: 0;
109
+ }
110
+
111
+ div.frontcover * {
112
+ margin: 0;
113
+ }
114
+
115
+ /* =========== */
116
+ /* = CHAPTER = */
117
+ /* =========== */
118
+ #chapters {
119
+ counter-reset: page 1;
120
+ counter-reset: chapter;
121
+ page-break-before: always;
122
+ }
123
+
124
+ .chapter {
125
+ color: #444;
126
+ counter-reset: footnote 0;
127
+ page-break-after: always;
128
+ }
129
+
130
+ .chapter a {
131
+ color: #0AE;
132
+ text-decoration: none;
133
+ }
134
+
135
+ .chapter h2,
136
+ .chapter h3,
137
+ .chapter h4,
138
+ .chapter h5 {
139
+ margin: 25pt 0 15pt 0;
140
+ }
141
+
142
+ .chapter h2 {
143
+ color: #222;
144
+ counter-increment: chapter;
145
+ font-size: 36pt;
146
+ line-height: 1;
147
+ string-set: header "Chapter " counter(chapter) ": " content();
148
+ }
149
+
150
+ .chapter h2::before {
151
+ content: "Chapter " counter(chapter);
152
+ color: #999;
153
+ display: block;
154
+ font-size: 18pt;
155
+ letter-spacing: 0;
156
+ margin-bottom: .2em;
157
+ white-space: pre;
158
+ }
159
+
160
+ .chapter h3,
161
+ .chapter h5 {
162
+ font-family: "helvetica", arial, sans-serif;
163
+ }
164
+
165
+ .chapter h3 {
166
+ color: #b62f32;
167
+ font-size: 28px;
168
+ }
169
+
170
+ .chapter h4 {
171
+ font-size: 18px;
172
+ font-family: "helvetica neue", "arial narrow", sans-serif;
173
+ }
174
+
175
+ .chapter h5 {
176
+ font-size: 15px;
177
+ }
178
+
179
+ .chapter h6 {
180
+ font-size: 15px;
181
+ font-weight: normal;
182
+ text-transform: uppercase;
183
+ }
184
+
185
+ /* =========== */
186
+ /* = IMPRINT = */
187
+ /* =========== */
188
+ .imprint {
189
+ background: #E2E7E2;
190
+ page: cover;
191
+ string-set: header "";
192
+ }
193
+
194
+ .imprint, .imprint * {
195
+ color: #5b5b5b;
196
+ }
197
+
198
+ .imprint * {
199
+ font-family: "Lucida Grande", arial, sans-serif;
200
+ font-size: 10pt;
201
+ margin: 0 0 2pt 0;
202
+ }
203
+
204
+ .imprint div {
205
+ left: 0.5in;
206
+ position: absolute;
207
+ bottom: 0.3in;
208
+ }
209
+
210
+ /* ========== */
211
+ /* = CODING = */
212
+ /* ========== */
213
+ pre, code {
214
+ color: #090;
215
+ font-family: monaco, monospace;
216
+ font-size: 9pt;
217
+ }
218
+
219
+ pre, pre code {
220
+ font-size: 8pt;
221
+ line-height: 1.4;
222
+ padding-left: 25pt;
223
+ }
224
+
225
+ /* ========= */
226
+ /* = TABLE = */
227
+ /* ========= */
228
+ table {
229
+ border-collapse: collapse;
230
+ }
231
+
232
+ thead th {
233
+ background: #e9e9e9;
234
+ }
235
+
236
+ th, td {
237
+ border: 1px solid #ccc;
238
+ font-size: 11pt;
239
+ padding: 5pt;
240
+ }
241
+
242
+ /* ========= */
243
+ /* = LISTS = */
244
+ /* ========= */
245
+ li {
246
+ margin-bottom: 8pt;
247
+ }
248
+
249
+ li ul,
250
+ li ol {
251
+ margin-left: 15pt;
252
+ }
253
+
254
+ /* ========== */
255
+ /* = FIGURE = */
256
+ /* ========== */
257
+ .figure img:after {
258
+ content: attr("alt");
259
+ display: block;
260
+ font-size: 10pt;
261
+ }
262
+
263
+ img {
264
+ max-width: none;
265
+ prince-image-resolution: 96dpi;
266
+ }
267
+
268
+ .figure {
269
+ float: right;
270
+ margin: 0 0 20pt 20pt;
271
+ overflow: auto;
272
+ text-align: center;
273
+ }
274
+
275
+ /* ===================== */
276
+ /* = TABLE OF CONTENTS = */
277
+ /* ===================== */
278
+ div.table-of-contents {
279
+ page: toc;
280
+ }
281
+
282
+ div.table-of-contents h2 {
283
+ font-size: 36pt;
284
+ }
285
+
286
+ div.table-of-contents a {
287
+ font-size: 11pt;
288
+ text-decoration: none;
289
+ }
290
+
291
+ div.table-of-contents div.level2 a {
292
+ color: #000;
293
+ font-weight: bold;
294
+ }
295
+
296
+ div.table-of-contents #toc {
297
+ column-count: 2;
298
+ column-fill: auto;
299
+ column-gap: 5%;
300
+ column-rule: none;
301
+ column-width: 45%;
302
+ }
303
+
304
+ div.table-of-contents #toc div {
305
+ padding-bottom: 10px;
306
+ }
307
+
308
+ div.table-of-contents div.level3 {
309
+ margin-left: 20px;
310
+ }
311
+
312
+ div.table-of-contents #toc div.level3 a {
313
+ color: #555;
314
+ }
315
+
316
+ div.table-of-contents div a::before {
317
+ color: #888;
318
+ content: target-counter(attr(href), page) " ";
319
+ float: left;
320
+ font-weight: normal;
321
+ font-size: 11pt !important;
322
+ margin-right: 4px;
323
+ width: 40px;
324
+ }
325
+
326
+ div.table-of-contents div.level3 a::before {
327
+ width: 20px;
328
+ }
329
+
330
+ div.table-of-contents div.level4,
331
+ div.table-of-contents div.level5,
332
+ div.table-of-contents div.level6 {
333
+ display: none;
334
+ }
335
+
336
+ /* ===================== */
337
+ /* = OTHER TEXT TWEAKS = */
338
+ /* ===================== */
339
+ acronym:after {
340
+ content: " (" attr(title) ")";
341
+ }
342
+
343
+ /* ============= */
344
+ /* = HIGHLIGHT = */
345
+ /* ============= */
346
+ .highlight {
347
+ font-size: 20pt;
348
+ }
349
+
350
+ .highlight strong {
351
+ color: #b62f32;
352
+ }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bookmaker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2013-03-03 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
16
- requirement: &2160139320 !ruby/object:Gem::Requirement
16
+ requirement: &2152975100 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2160139320
24
+ version_requirements: *2152975100
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: aruba
27
- requirement: &2160124400 !ruby/object:Gem::Requirement
27
+ requirement: &2152974500 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *2160124400
35
+ version_requirements: *2152974500
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: cucumber
38
- requirement: &2160122120 !ruby/object:Gem::Requirement
38
+ requirement: &2152973980 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *2160122120
46
+ version_requirements: *2152973980
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: eeepub
49
- requirement: &2160109740 !ruby/object:Gem::Requirement
49
+ requirement: &2152973460 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *2160109740
57
+ version_requirements: *2152973460
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: kramdown
60
- requirement: &2160104920 !ruby/object:Gem::Requirement
60
+ requirement: &2152972380 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *2160104920
68
+ version_requirements: *2152972380
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: thor
71
- requirement: &2160073380 !ruby/object:Gem::Requirement
71
+ requirement: &2152971600 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *2160073380
79
+ version_requirements: *2152971600
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: nokogiri
82
- requirement: &2160069400 !ruby/object:Gem::Requirement
82
+ requirement: &2152970760 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: '0'
88
88
  type: :runtime
89
89
  prerelease: false
90
- version_requirements: *2160069400
90
+ version_requirements: *2152970760
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: notifier
93
- requirement: &2152320600 !ruby/object:Gem::Requirement
93
+ requirement: &2152969440 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ! '>='
@@ -98,7 +98,7 @@ dependencies:
98
98
  version: '0'
99
99
  type: :runtime
100
100
  prerelease: false
101
- version_requirements: *2152320600
101
+ version_requirements: *2152969440
102
102
  description: ! 'ODO: Write a gem description'
103
103
  email:
104
104
  - dausha@gmail.com
@@ -109,8 +109,8 @@ extra_rdoc_files: []
109
109
  files:
110
110
  - .gitignore
111
111
  - Gemfile
112
+ - README.md
112
113
  - Rakefile
113
- - Readme.md
114
114
  - bin/bookmaker
115
115
  - bookmaker.gemspec
116
116
  - features/basic.feature
@@ -139,6 +139,7 @@ files:
139
139
  - templates/epub.erb
140
140
  - templates/html.erb
141
141
  - templates/latex.erb
142
+ - templates/layout.css
142
143
  - templates/sample.md
143
144
  - templates/syntax.css
144
145
  - templates/user.css
data/Readme.md DELETED
File without changes