rpub 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +1 -1
- data/.rspec +0 -1
- data/.travis.yml +3 -4
- data/.yardopts +1 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +70 -46
- data/Guardfile +6 -0
- data/HISTORY.md +10 -0
- data/README.md +1 -1
- data/Rakefile +7 -2
- data/bin/rpub +64 -1
- data/doc/.gitignore +8 -0
- data/doc/api/Rpub.html +339 -0
- data/doc/api/Rpub/Book.html +983 -0
- data/doc/api/Rpub/Chapter.html +737 -0
- data/doc/api/Rpub/Command.html +356 -0
- data/doc/api/Rpub/Commands.html +117 -0
- data/doc/api/Rpub/Commands/Clean.html +216 -0
- data/doc/api/Rpub/Commands/Compile.html +218 -0
- data/doc/api/Rpub/Commands/Generate.html +242 -0
- data/doc/api/Rpub/Commands/Package.html +230 -0
- data/doc/api/Rpub/Commands/Preview.html +216 -0
- data/doc/api/Rpub/Commands/Stats.html +226 -0
- data/doc/api/Rpub/Compressor.html +687 -0
- data/doc/api/Rpub/Context.html +553 -0
- data/doc/api/Rpub/Document.html +647 -0
- data/doc/api/Rpub/Document/OutlineElement.html +388 -0
- data/doc/api/Rpub/Epub.html +465 -0
- data/doc/api/Rpub/Epub/Container.html +224 -0
- data/doc/api/Rpub/Epub/Content.html +344 -0
- data/doc/api/Rpub/Epub/Cover.html +236 -0
- data/doc/api/Rpub/Epub/HtmlToc.html +240 -0
- data/doc/api/Rpub/Epub/Toc.html +244 -0
- data/doc/api/Rpub/FilesystemSource.html +544 -0
- data/doc/api/Rpub/HashDelegation.html +281 -0
- data/doc/api/Rpub/HashDelegation/ClassMethods.html +175 -0
- data/doc/api/Rpub/MediaType.html +192 -0
- data/doc/api/Rpub/Preview.html +464 -0
- data/doc/api/Rpub/XmlFile.html +457 -0
- data/doc/api/_index.html +405 -0
- data/doc/api/class_list.html +54 -0
- data/doc/api/css/common.css +1 -0
- data/doc/api/css/full_list.css +57 -0
- data/doc/api/css/style.css +339 -0
- data/doc/api/file.HISTORY.html +131 -0
- data/doc/api/file.LICENSE.html +92 -0
- data/doc/api/file.README.html +337 -0
- data/doc/api/file_list.html +62 -0
- data/doc/api/frames.html +26 -0
- data/doc/api/index.html +337 -0
- data/doc/api/js/app.js +219 -0
- data/doc/api/js/full_list.js +178 -0
- data/doc/api/js/jquery.js +4 -0
- data/doc/api/method_list.html +533 -0
- data/doc/api/top-level-namespace.html +112 -0
- data/doc/index.html +312 -0
- data/doc/javascripts/scale.fix.js +17 -0
- data/doc/params.json +1 -0
- data/doc/stylesheets/pygment_trac.css +69 -0
- data/doc/stylesheets/styles.css +255 -0
- data/features/clean.feature +31 -0
- data/features/compile.feature +49 -0
- data/features/embedded_assets.feature +51 -0
- data/features/generate.feature +63 -0
- data/features/layout.feature +41 -0
- data/features/package.feature +30 -0
- data/features/previews.feature +66 -0
- data/features/stats.feature +18 -0
- data/features/step_definitions/general_steps.rb +60 -0
- data/features/styles.feature +33 -0
- data/features/support/env.rb +7 -0
- data/features/table_of_contents.feature +35 -0
- data/lib/rpub.rb +28 -31
- data/lib/rpub/book.rb +9 -16
- data/lib/rpub/chapter.rb +4 -54
- data/lib/rpub/command.rb +32 -0
- data/lib/rpub/commands/clean.rb +4 -49
- data/lib/rpub/commands/compile.rb +4 -49
- data/lib/rpub/commands/generate.rb +10 -67
- data/lib/rpub/commands/package.rb +9 -37
- data/lib/rpub/commands/preview.rb +4 -54
- data/lib/rpub/commands/stats.rb +6 -10
- data/lib/rpub/compressor.rb +3 -3
- data/lib/rpub/context.rb +48 -0
- data/lib/rpub/document.rb +68 -0
- data/lib/rpub/epub.rb +8 -7
- data/lib/rpub/epub/content.rb +9 -30
- data/lib/rpub/epub/cover.rb +1 -8
- data/lib/rpub/epub/html_toc.rb +4 -9
- data/lib/rpub/epub/toc.rb +16 -13
- data/lib/rpub/filesystem_source.rb +47 -0
- data/lib/rpub/media_type.rb +16 -0
- data/lib/rpub/preview.rb +29 -0
- data/lib/rpub/version.rb +1 -1
- data/lib/rpub/xml_file.rb +4 -1
- data/rpub.gemspec +6 -7
- data/spec/rpub/book_spec.rb +45 -45
- data/spec/rpub/chapter_spec.rb +87 -22
- data/spec/rpub/epub/container_spec.rb +3 -5
- data/spec/rpub/epub/content_spec.rb +62 -41
- data/spec/rpub/epub/cover_spec.rb +3 -5
- data/spec/rpub/epub/html_toc_spec.rb +8 -8
- data/spec/rpub/epub/toc_spec.rb +20 -22
- data/spec/rpub_spec.rb +1 -3
- data/spec/spec_helper.rb +28 -0
- data/support/config.yml +1 -0
- data/support/styles.css +3 -3
- metadata +131 -120
- data/lib/rpub/commander.rb +0 -23
- data/lib/rpub/commands/base.rb +0 -33
- data/lib/rpub/commands/help.rb +0 -37
- data/lib/rpub/commands/main.rb +0 -45
- data/lib/rpub/compilation_helpers.rb +0 -73
- data/lib/rpub/subclass_tracker.rb +0 -53
- data/spec/rpub/commands/clean_spec.rb +0 -46
- data/spec/rpub/commands/generate_spec.rb +0 -52
- data/spec/rpub/commands/main_spec.rb +0 -26
- data/spec/rpub/commands/package_spec.rb +0 -33
- data/spec/rpub/commands/preview_spec.rb +0 -43
@@ -0,0 +1,92 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
6
|
+
<title>
|
7
|
+
File: LICENSE
|
8
|
+
|
9
|
+
— Rpub, a simple ePub generator library in Ruby
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
19
|
+
relpath = '';
|
20
|
+
framesUrl = "frames.html#!file.LICENSE.html";
|
21
|
+
</script>
|
22
|
+
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
25
|
+
|
26
|
+
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
27
|
+
|
28
|
+
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<div id="header">
|
32
|
+
<div id="menu">
|
33
|
+
|
34
|
+
<a href="_index.html">Index</a> »
|
35
|
+
<span class="title">File: LICENSE</span>
|
36
|
+
|
37
|
+
|
38
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
39
|
+
</div>
|
40
|
+
|
41
|
+
<div id="search">
|
42
|
+
|
43
|
+
<a class="full_list_link" id="class_list_link"
|
44
|
+
href="class_list.html">
|
45
|
+
Class List
|
46
|
+
</a>
|
47
|
+
|
48
|
+
<a class="full_list_link" id="method_list_link"
|
49
|
+
href="method_list.html">
|
50
|
+
Method List
|
51
|
+
</a>
|
52
|
+
|
53
|
+
<a class="full_list_link" id="file_list_link"
|
54
|
+
href="file_list.html">
|
55
|
+
File List
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<iframe id="search_frame"></iframe>
|
63
|
+
|
64
|
+
<div id="content"><div id='filecontents'><p>Copyright (C) 2012 Arjan van der Gaag</p>
|
65
|
+
|
66
|
+
<p>Permission is hereby granted, free of charge, to any person obtaining a copy of
|
67
|
+
this software and associated documentation files (the “Software”), to deal in
|
68
|
+
the Software without restriction, including without limitation the rights to
|
69
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
70
|
+
of the Software, and to permit persons to whom the Software is furnished to do
|
71
|
+
so, subject to the following conditions:</p>
|
72
|
+
|
73
|
+
<p>The above copyright notice and this permission notice shall be included in all
|
74
|
+
copies or substantial portions of the Software.</p>
|
75
|
+
|
76
|
+
<p>THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
77
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
78
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
79
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
80
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
81
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
82
|
+
SOFTWARE.</p>
|
83
|
+
</div></div>
|
84
|
+
|
85
|
+
<div id="footer">
|
86
|
+
Generated on Thu Aug 14 19:54:32 2014 by
|
87
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
88
|
+
0.8.7.4 (ruby-2.1.2).
|
89
|
+
</div>
|
90
|
+
|
91
|
+
</body>
|
92
|
+
</html>
|
@@ -0,0 +1,337 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
6
|
+
<title>
|
7
|
+
File: README
|
8
|
+
|
9
|
+
— Rpub, a simple ePub generator library in Ruby
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
19
|
+
relpath = '';
|
20
|
+
framesUrl = "frames.html#!file.README.html";
|
21
|
+
</script>
|
22
|
+
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
25
|
+
|
26
|
+
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
27
|
+
|
28
|
+
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<div id="header">
|
32
|
+
<div id="menu">
|
33
|
+
|
34
|
+
<a href="_index.html">Index</a> »
|
35
|
+
<span class="title">File: README</span>
|
36
|
+
|
37
|
+
|
38
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
39
|
+
</div>
|
40
|
+
|
41
|
+
<div id="search">
|
42
|
+
|
43
|
+
<a class="full_list_link" id="class_list_link"
|
44
|
+
href="class_list.html">
|
45
|
+
Class List
|
46
|
+
</a>
|
47
|
+
|
48
|
+
<a class="full_list_link" id="method_list_link"
|
49
|
+
href="method_list.html">
|
50
|
+
Method List
|
51
|
+
</a>
|
52
|
+
|
53
|
+
<a class="full_list_link" id="file_list_link"
|
54
|
+
href="file_list.html">
|
55
|
+
File List
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<iframe id="search_frame"></iframe>
|
63
|
+
|
64
|
+
<div id="content"><div id='filecontents'><h1 id="rpub----an-epub-generator-in-ruby-build-statushttpssecuretravis-ciorgavdgaagrpubpngbranchmasterhttptravis-ciorgavdgaagrpub-coverage-statushttpscoverallsioreposavdgaagrpubbadgepnghttpscoverallsioravdgaagrpub">Rpub – an ePub generator in Ruby <a href="http://travis-ci.org/avdgaag/rpub"><img src="https://secure.travis-ci.org/avdgaag/rpub.png?branch=master" alt="Build Status" /></a> <a href="https://coveralls.io/r/avdgaag/rpub"><img src="https://coveralls.io/repos/avdgaag/rpub/badge.png" alt="Coverage Status" /></a></h1>
|
65
|
+
|
66
|
+
<h2 id="introduction">Introduction</h2>
|
67
|
+
|
68
|
+
<p>Rpub is a command-line tool that generates a collection of plain text input
|
69
|
+
files into an eBook in ePub format. It provides several related functions to
|
70
|
+
make working with ePub files a little easier:</p>
|
71
|
+
|
72
|
+
<ul>
|
73
|
+
<li>Generation of table of contents</li>
|
74
|
+
<li>Packaging your eBook in an archive with additional README file</li>
|
75
|
+
<li>Embedding fonts</li>
|
76
|
+
<li>Easy previewing as you write</li>
|
77
|
+
<li>.mobi compatibility</li>
|
78
|
+
</ul>
|
79
|
+
|
80
|
+
<h2 id="installation">Installation</h2>
|
81
|
+
|
82
|
+
<p>Rpub is distributed as a Ruby gem, which should be installed on most Macs and
|
83
|
+
Linux systems. Once you have ensured you have a working installation of Ruby
|
84
|
+
and Ruby gems, install the gem as follows from the command line:</p>
|
85
|
+
|
86
|
+
<pre class="code ruby"><code class="ruby">$ gem install rpub
|
87
|
+
</code></pre>
|
88
|
+
|
89
|
+
<p>You can verify the gem has installed correctly by checking its version number:</p>
|
90
|
+
|
91
|
+
<pre class="code ruby"><code class="ruby">$ rpub -v
|
92
|
+
</code></pre>
|
93
|
+
|
94
|
+
<p>If this generates an error, something has gone wrong. You should see something
|
95
|
+
along the lines of <code>rpub 1.0.0</code>.</p>
|
96
|
+
|
97
|
+
<h2 id="usage">Usage</h2>
|
98
|
+
|
99
|
+
<h3 id="basics">Basics</h3>
|
100
|
+
|
101
|
+
<p>ePubs are basically collections of HTML files, combined in a single archive
|
102
|
+
according to a set of predefined rules. Rpub generates these files for you from
|
103
|
+
simple text files written in <a href="http://daringfireball.net/projects/markdown">Markdown</a>, a very readable markup language created
|
104
|
+
by <a href="http://daringfireball.net">John Gruber</a>. This very README file is an example of a Markdown document.</p>
|
105
|
+
|
106
|
+
<p>The idea is you write several Markdown files using your favourite text editor,
|
107
|
+
and save them as plain text in your project directory. Usually you would write
|
108
|
+
one file per chapter. By invoking the <code>rpub</code> program you convert those files to
|
109
|
+
HTML and combine them in an ePub archive:</p>
|
110
|
+
|
111
|
+
<pre class="code ruby"><code class="ruby">$ rpub compile
|
112
|
+
Generating my-new-book-0.1.0.epub... Done!
|
113
|
+
</code></pre>
|
114
|
+
|
115
|
+
<p>After you have run the <code>rpub compile</code> command, you will find a new <code>.epub</code> file
|
116
|
+
in your project directory. The name of this file depends on the title of your
|
117
|
+
book, and its version number. You can set these values, as well as a few others,
|
118
|
+
in a special configuration file called <code>config.yml</code>:</p>
|
119
|
+
|
120
|
+
<pre class="code ruby"><code class="ruby">---
|
121
|
+
author: Your Name
|
122
|
+
title: My new book
|
123
|
+
version: 0.1.0
|
124
|
+
</code></pre>
|
125
|
+
|
126
|
+
<p>This file is written in <a href="http://yaml.org">YAML</a> and sets basic properties of
|
127
|
+
your book project.</p>
|
128
|
+
|
129
|
+
<p>Since regenerating your ePub file and opening it in a suitable reader
|
130
|
+
application is cumbersome, Rpub can generate a simple preview document for you:</p>
|
131
|
+
|
132
|
+
<pre class="code ruby"><code class="ruby">$ rpub preview
|
133
|
+
</code></pre>
|
134
|
+
|
135
|
+
<p>This will generate a new HTML file in your project directory with a name similar
|
136
|
+
to your ePub file. This is the entire text of your book as a single web page for
|
137
|
+
easy viewing in any browser.</p>
|
138
|
+
|
139
|
+
<h3 id="generating-a-mobi-file">Generating a .mobi file</h3>
|
140
|
+
|
141
|
+
<p>Since the ePub and Mobipocket file formats are very (<em>very</em>) similar it is
|
142
|
+
quite easy to create a <code>.mobi</code> version of your book, suitable for reading on
|
143
|
+
Amazon’s Kindle. To do so, you will need to install the <a href="http://www.amazon.com/gp/feature.html?ie=UTF8&docId=1000765211">kindlegen program
|
144
|
+
Amazon provides</a>.</p>
|
145
|
+
|
146
|
+
<p>Here’s how it works:</p>
|
147
|
+
|
148
|
+
<ol>
|
149
|
+
<li>Install <code>kindlegen</code> (<a href="http://www.amazon.com/gp/feature.html?ie=UTF8&docId=1000765211">download it here</a>)</li>
|
150
|
+
<li>Compile your book as usual using <code>rpub compile</code></li>
|
151
|
+
<li>Compile <code>my-book.epub</code> to <code>my-book.mobi</code>: <code>kindlegen my-book.epub</code>.</li>
|
152
|
+
</ol>
|
153
|
+
|
154
|
+
<p>Optionally, include your <code>my-book.mobi</code> in your package by adding it to your
|
155
|
+
list of packaged files (see “Packaging for distribution”).</p>
|
156
|
+
|
157
|
+
<h3 id="advanced-features">Advanced features</h3>
|
158
|
+
|
159
|
+
<h4 id="packaging-for-distribution">Packaging for distribution</h4>
|
160
|
+
|
161
|
+
<p>Often you want to distribute your ebook over the internet, along with some
|
162
|
+
extra files. You’ll probably want to include a README file, a license or
|
163
|
+
references to extra online resources. A <code>package</code> task is defined to generate a
|
164
|
+
single compressed archive file from your generated ebook along with such
|
165
|
+
additional files.</p>
|
166
|
+
|
167
|
+
<p>You list the files to include with your ebook in your <code>config.yml</code> file, along
|
168
|
+
with the resulting packaged file name:</p>
|
169
|
+
|
170
|
+
<pre class="code ruby"><code class="ruby">---
|
171
|
+
package_file: mybook.zip
|
172
|
+
package:
|
173
|
+
- README
|
174
|
+
- license.txt
|
175
|
+
- code-samples.rb
|
176
|
+
</code></pre>
|
177
|
+
|
178
|
+
<p>All the filenames listed under <code>package</code> are looked up in the root of your
|
179
|
+
project directory. These files will be combined with the ebook in the
|
180
|
+
<code>mybook.zip</code> file in your project directory.</p>
|
181
|
+
|
182
|
+
<h4 id="automatic-table-of-contents">Automatic table of contents</h4>
|
183
|
+
|
184
|
+
<p>Rpub automatically generates a table of contents for you, if you want it to. It
|
185
|
+
does this by scanning all your markdown files for headings and listing them on
|
186
|
+
a single page in the ebook. Each entry in the table of contents is linked to
|
187
|
+
its appropriate heading in the chapter, and has various hooks for your
|
188
|
+
stylesheet to determine its formatting.</p>
|
189
|
+
|
190
|
+
<p>To enable the automatic generation of a table of contents, add the following
|
191
|
+
configuration to your <code>config.yml</code> file:</p>
|
192
|
+
|
193
|
+
<pre class="code ruby"><code class="ruby">toc: true
|
194
|
+
</code></pre>
|
195
|
+
|
196
|
+
<p>Note that this only affects the human-readable table of contents, represented
|
197
|
+
as a page in your book. Rpub will alway generate the .epub table of contents
|
198
|
+
for you, which contains the machine-readable references to your chapters. It
|
199
|
+
will, by default, reference all chapter titles and subheadings for you, but
|
200
|
+
you can customize the number of levels that will be included using the
|
201
|
+
following in your <code>config.yml</code> file:</p>
|
202
|
+
|
203
|
+
<pre class="code ruby"><code class="ruby">max_level: 3
|
204
|
+
</code></pre>
|
205
|
+
|
206
|
+
<h4 id="custom-layout-and-styles">Custom layout and styles</h4>
|
207
|
+
|
208
|
+
<p>When you compile a set of Markdown files to an ePub file, rpub uses a default
|
209
|
+
HTML layout and set of styles to determine the look and feel of the book. These
|
210
|
+
will do fine for most cases, but you can provide your own, if you are so
|
211
|
+
inclined.</p>
|
212
|
+
|
213
|
+
<p>Simply define a <code>layout.html</code> and/or <code>styles.css</code> in your project directory.
|
214
|
+
Your HTML file will be parsed with Erb, an so you can include your writing
|
215
|
+
using the <code>@body</code> instance variable:</p>
|
216
|
+
|
217
|
+
<pre class="code ruby"><code class="ruby"><html>
|
218
|
+
<body>
|
219
|
+
<%= @body %>
|
220
|
+
</body>
|
221
|
+
</html>
|
222
|
+
</code></pre>
|
223
|
+
|
224
|
+
<p><strong>Note 1</strong>: this feature is actually provided by the <a href="http://kramdown.rubyforge.org">Kramdown gem</a>,
|
225
|
+
so have a look at <a href="https://github.com/gettalong/kramdown/blob/master/data/kramdown/document.html">the standard Kramdown document template</a> to see some
|
226
|
+
nifty tricks.</p>
|
227
|
+
|
228
|
+
<p><strong>Note 2</strong>: despite the name ‘html’ and <code>.html</code> extension, your file actually has
|
229
|
+
to be XHTML-compliant.</p>
|
230
|
+
|
231
|
+
<p>You can also provide custom layouts or styles to use when invoking the <code>compile</code>
|
232
|
+
or <code>preview</code> commands, using the <code>-l</code> or <code>-s</code> options:</p>
|
233
|
+
|
234
|
+
<pre class="code ruby"><code class="ruby">$ rpub compile -l /tmp/my-layout.html
|
235
|
+
</code></pre>
|
236
|
+
|
237
|
+
<p>If you like the default layout or styles, but want to adapt them, you can copy
|
238
|
+
those files into your project using the <code>generate</code> subcommand:</p>
|
239
|
+
|
240
|
+
<pre class="code ruby"><code class="ruby">$ rpub generate
|
241
|
+
</code></pre>
|
242
|
+
|
243
|
+
<h3 id="command-reference">Command reference</h3>
|
244
|
+
|
245
|
+
<dl>
|
246
|
+
<dt><code>rpub compile</code></dt>
|
247
|
+
<dd>generate .epub file</dd>
|
248
|
+
<dt><code>rpub package</code></dt>
|
249
|
+
<dd>create zip file with compiled book and other listed files</dd>
|
250
|
+
<dt><code>rpub preview</code></dt>
|
251
|
+
<dd>generate preview HTML file</dd>
|
252
|
+
<dt><code>rpub generate</code></dt>
|
253
|
+
<dd>copy default layout.html, styles.css and config.yml</dd>
|
254
|
+
<dt><code>rpub help</code></dt>
|
255
|
+
<dd>get help on subcommands</dd>
|
256
|
+
<dt><code>rpub clean</code></dt>
|
257
|
+
<dd>remove generated files</dd>
|
258
|
+
</dl>
|
259
|
+
|
260
|
+
<h3 id="configuration-reference">Configuration reference</h3>
|
261
|
+
|
262
|
+
<dl>
|
263
|
+
<dt><code>title</code></dt>
|
264
|
+
<dd>the book title (string)</dd>
|
265
|
+
<dt><code>descrption</code></dt>
|
266
|
+
<dd>one-line summary of the book (string)</dd>
|
267
|
+
<dt><code>creator</code></dt>
|
268
|
+
<dd>author name (string)</dd>
|
269
|
+
<dt><code>publisher</code></dt>
|
270
|
+
<dd>publisher name (string)</dd>
|
271
|
+
<dt><code>subject</code></dt>
|
272
|
+
<dd>book subject/category (string)</dd>
|
273
|
+
<dt><code>language</code></dt>
|
274
|
+
<dd>language code of the book contents, e.g. ‘en’ (string)</dd>
|
275
|
+
<dt><code>rights</code></dt>
|
276
|
+
<dd>copyright line (string)</dd>
|
277
|
+
<dt><code>version</code></dt>
|
278
|
+
<dd>version number of the book to include in the .epub filename (string)</dd>
|
279
|
+
<dt><code>toc</code></dt>
|
280
|
+
<dd>whether to generate a table of contents as book page (boolean, default false)</dd>
|
281
|
+
<dt><code>max_level</code></dt>
|
282
|
+
<dd>the maximum depth of the .epub table of contents (number, default 2)</dd>
|
283
|
+
<dt><code>ignore</code></dt>
|
284
|
+
<dd>list of files not to include in the epub, that otherwise would (array)</dd>
|
285
|
+
<dt><code>package</code></dt>
|
286
|
+
<dd>list of files to be included in the archive created by the package task (array)</dd>
|
287
|
+
</dl>
|
288
|
+
|
289
|
+
<h3 id="examples">Examples</h3>
|
290
|
+
|
291
|
+
<p>See the <a href="https://github.com/avdgaag/rpub/tree/master/example">examples directory</a> for two example projects.</p>
|
292
|
+
|
293
|
+
<h3 id="documentation">Documentation</h3>
|
294
|
+
|
295
|
+
<p>See the inline <a href="http://rubydoc.info/github/avdgaag/rpub/master/frames">API docs</a> for more information.</p>
|
296
|
+
|
297
|
+
<h2 id="other">Other</h2>
|
298
|
+
|
299
|
+
<h3 id="note-on-patchespull-requests">Note on Patches/Pull Requests</h3>
|
300
|
+
|
301
|
+
<ol>
|
302
|
+
<li>Fork the project.</li>
|
303
|
+
<li>Make your feature addition or bug fix.</li>
|
304
|
+
<li>Add tests for it. This is important so I don’t break it in a future version
|
305
|
+
unintentionally.</li>
|
306
|
+
<li>Commit, do not mess with rakefile, version, or history. (if you want to have
|
307
|
+
your own version, that is fine but bump version in a commit by itself I can
|
308
|
+
ignore when I pull)</li>
|
309
|
+
<li>Send me a pull request. Bonus points for topic branches.</li>
|
310
|
+
</ol>
|
311
|
+
|
312
|
+
<h3 id="issues">Issues</h3>
|
313
|
+
|
314
|
+
<p>Please report any issues, defects or suggestions in the <a href="https://github.com/avdgaag/rpub/issues">Github issue
|
315
|
+
tracker</a>.</p>
|
316
|
+
|
317
|
+
<h3 id="what-has-changed">What has changed?</h3>
|
318
|
+
|
319
|
+
<p>See the <a href="https://github.com/avdgaag/rpub/blob/master/HISTORY.md">HISTORY</a> file for a detailed changelog.</p>
|
320
|
+
|
321
|
+
<h3 id="credits">Credits</h3>
|
322
|
+
|
323
|
+
<p>Created by: Arjan van der Gaag<br />
|
324
|
+
URL: <a href="http://arjanvandergaag.nl">http://arjanvandergaag.nl</a><br />
|
325
|
+
Project homepage: <a href="http://avdgaag.github.com/rpub">http://avdgaag.github.com/rpub</a><br />
|
326
|
+
Date: april 2012<br />
|
327
|
+
License: <a href="https://github.com/avdgaag/rpub/LICENSE">MIT-license</a> (same as Ruby)</p>
|
328
|
+
</div></div>
|
329
|
+
|
330
|
+
<div id="footer">
|
331
|
+
Generated on Thu Aug 14 19:54:32 2014 by
|
332
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
333
|
+
0.8.7.4 (ruby-2.1.2).
|
334
|
+
</div>
|
335
|
+
|
336
|
+
</body>
|
337
|
+
</html>
|
@@ -0,0 +1,62 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
|
7
|
+
<link rel="stylesheet" href="css/full_list.css" type="text/css" media="screen" charset="utf-8" />
|
8
|
+
|
9
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
14
|
+
|
15
|
+
<script type="text/javascript" charset="utf-8" src="js/full_list.js"></script>
|
16
|
+
|
17
|
+
|
18
|
+
<title>File List</title>
|
19
|
+
<base id="base_target" target="_parent" />
|
20
|
+
</head>
|
21
|
+
<body>
|
22
|
+
<script type="text/javascript" charset="utf-8">
|
23
|
+
if (window.top.frames.main) {
|
24
|
+
document.getElementById('base_target').target = 'main';
|
25
|
+
document.body.className = 'frames';
|
26
|
+
}
|
27
|
+
</script>
|
28
|
+
<div id="content">
|
29
|
+
<h1 id="full_list_header">File List</h1>
|
30
|
+
<div id="nav">
|
31
|
+
|
32
|
+
<span><a target="_self" href="class_list.html">
|
33
|
+
Classes
|
34
|
+
</a></span>
|
35
|
+
|
36
|
+
<span><a target="_self" href="method_list.html">
|
37
|
+
Methods
|
38
|
+
</a></span>
|
39
|
+
|
40
|
+
<span><a target="_self" href="file_list.html">
|
41
|
+
Files
|
42
|
+
</a></span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
<div id="search">Search: <input type="text" /></div>
|
46
|
+
|
47
|
+
<ul id="full_list" class="file">
|
48
|
+
|
49
|
+
|
50
|
+
<li class="r1"><span class="object_link"><a href="index.html" title="README">README</a></a></li>
|
51
|
+
|
52
|
+
|
53
|
+
<li class="r2"><span class="object_link"><a href="file.HISTORY.html" title="HISTORY">HISTORY</a></a></li>
|
54
|
+
|
55
|
+
|
56
|
+
<li class="r1"><span class="object_link"><a href="file.LICENSE.html" title="LICENSE">LICENSE</a></a></li>
|
57
|
+
|
58
|
+
|
59
|
+
</ul>
|
60
|
+
</div>
|
61
|
+
</body>
|
62
|
+
</html>
|