author 1.1.5.alpha → 1.1.6.alpha

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZDE0ODkwNmFhODlhNDE2Njk1Mjc2Njk5NmZmMGM4ZTZjMjlkYWY3OA==
4
+ YjhjZGIwNmM5YWNhMzY0YmYwMjk3NjQ5MmM1NzZmZWQzNjVmNmIxZA==
5
5
  data.tar.gz: !binary |-
6
- NTM4MzIyYTY5ZDI0ODk4ZWY5MmI0N2I3NDgzMTljZGM5Mjc2YWY2Yw==
6
+ NjgzYmIxNTYwYWFjODFjOGQxZWI4OThiOGNhYTE5MGE2YmZlMGIxNg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YmQ2MWY1OGQzMjczMmE0ODY0ZmI1YjFhNTVlNGZkYmE4NzUxODliZjk2Y2I4
10
- MmYyMjIzMWFiMGFlNTA3YWIxMzgzZWVlNTk1ZWRhYTM3M2UzYzMxMjI3ZDhm
11
- MTRiZjliZmUwNTRhZjk1YTBhZTIzN2Q3Y2YyNzdmMjAzZDRjNTY=
9
+ ZTdhNGYzYjcyMDlhM2QwNDBlOGFmNTFhZWM4YjRjNzViN2U1MTMwNzRkNjZi
10
+ YjIxN2QwOGRlNTNmYjhmNzk4ZmQ2MTM0MDExMWEwMmViNGYxMjQ5ODVlMGI0
11
+ NTQ2MzE3ZWIzMTc1NzEzZmVkMTEzNjc0MWRmNzQwMjIyZTg4YTM=
12
12
  data.tar.gz: !binary |-
13
- YjAwODA1YzUxNGRmNjVhMzEzOTdiZGRkMjQzMzViMmRkNzQyMGUyMTgxZDA1
14
- MmM0OGNhOWYyN2Y3MTgwOWMwMWNmODc5NTQyY2RkOTk5ZmFjZTQyM2U1ZWFh
15
- Y2FhMDI3YWQ5Nzc3N2Q5ZTEzYzBjODYwY2E3MTc5MmVhYmM0MDk=
13
+ MWY3Y2YxMGU0YmM0MDgwMjc2YjQ1YTZmNzE0ZmJkN2FlMTc0OTQ3ZjY0MzFh
14
+ M2Q2MTMwODIyM2I3NDBlZDlkNjAwYTUwZGMxM2ZiNTViNTNhMDlkMWIzYzg5
15
+ NmEzNDczMGMxNGNkZWM3MWU2YzZmMWZhY2RmODA2NzdlNjAxNmQ=
data/README.md CHANGED
@@ -24,33 +24,26 @@ Thus, Author was born.
24
24
 
25
25
  ## Installation
26
26
 
27
- Add this line to your application's Gemfile:
28
-
29
- gem 'author'
30
-
31
- And then execute:
32
-
33
- $ bundle
34
-
35
- Or install it yourself with:
36
-
37
27
  $ gem install author
38
28
 
39
- ## Quick Start Guide
29
+ ## Usage
40
30
 
41
31
  $ author new mybook
42
32
  $ cd mybook
43
33
 
44
34
  Add your chapters to the `chapters/` folder. Name them whatever you want. Then, in the
45
35
  `outline.txt` file, simply list the chapters in the order you want them to appear in the
46
- finished book:
36
+ finished book. Here's an example of what `outline.txt` should look like:
47
37
 
48
38
  preface.md
49
39
  about-the-author.md
50
40
  who-is-this-for.md
51
41
  chapter-1.md
52
42
 
53
- Once you've done that, just run one of the following commands:
43
+ In order to create ePubs, you will need to specify a few things. Open up `config.yml` and
44
+ modify the settings that are listed.
45
+
46
+ When you're ready to build your ebook, just run one of the following commands:
54
47
 
55
48
  author build xhtml
56
49
  author build pdf
@@ -60,9 +53,27 @@ Once you've done that, just run one of the following commands:
60
53
 
61
54
  That's it!
62
55
 
63
- ## Full Tutorial
56
+ ## Extras
57
+
58
+ One of the nice things about using Kramdown is that it provides a way to generate a table
59
+ of contents [TOC]. If you would like to add a TOC to your book, simply add a file to the
60
+ `chapters/` folder - might I suggest `toc.md` - and include the following:
61
+
62
+ ```
63
+ ## Table of Contents
64
+ {:.no_toc}
65
+
66
+ * this will be replaced
67
+ {:toc}
68
+ ```
69
+
70
+ Then, in the `outline.txt` file, just make sure the file with that information is
71
+ the first one listed.
64
72
 
65
- Coming soon.
73
+ For anyone wanting to write books that involve a lot of code, I have built a plugin
74
+ called `awesome_codeblock`. You can specify quite a few options that will make your
75
+ codeblocks, well, more awesome. Check out `lib/author/plugins/awesome_codeblock.rb`
76
+ for all the details.
66
77
 
67
78
  ## Dependencies
68
79
 
data/TODO.md ADDED
@@ -0,0 +1,4 @@
1
+ # TODO
2
+
3
+ - Add the ability to include a cover image.
4
+ - Add the ability to include images in the finished book formats.
@@ -34,6 +34,18 @@ module Author
34
34
  Author::Exporters::Epub.export
35
35
  end
36
36
 
37
+ desc "all", "Build everything"
38
+ def all
39
+ say "Building the XHTMl site"
40
+ Author::Exporters::XHTML.export
41
+ say "Building PDF"
42
+ Author::Exporters::PDF.export
43
+ say "Building the .mobi file"
44
+ Author::Exporters::Mobi.export
45
+ say "Building the epub file"
46
+ Author::Exporters::Epub.export
47
+ end
48
+
37
49
  end
38
50
  end
39
51
  end
@@ -22,21 +22,28 @@
22
22
  # You can set the language of the code block. The default is `:text` but you can specify
23
23
  # any of the code formats that CodeRay supports.
24
24
  #
25
- # {% awesome_codeblock lang:"ruby" %}
25
+ # {% awesome_codeblock lang:ruby %}
26
26
  # code goes here
27
27
  # {% endawesome_codeblock %}
28
28
  #
29
29
  # You can choose to add line numbers as well. Refer to the documentation for
30
30
  # CodeRay::Encoder::HTML for values that can be passed in.
31
31
  #
32
- # {% awesome_codeblock line_number_format:"inline" %}
32
+ # {% awesome_codeblock show_line_numbers:true %}
33
33
  # code goes here
34
34
  # {% endawesome_codeblock %}
35
35
  #
36
36
  # You can choose to highlight specific lines within your code block as well. Just supply
37
37
  # a comma separated list of line numbers.
38
38
  #
39
- # {% awesome_codeblock lines_to_highlight:"2,3,4,7" %}
39
+ # {% awesome_codeblock highlight:"2,3,4,7" %}
40
+ # code goes here
41
+ # ...
42
+ # {% endawesome_codeblock %}
43
+ #
44
+ # If you want your line numbers to start at a specific number, you can do that too!
45
+ #
46
+ # {% awesome_codeblock start_at:25 %}
40
47
  # code goes here
41
48
  # ...
42
49
  # {% endawesome_codeblock %}
@@ -92,7 +99,7 @@ module Author
92
99
  wrapped_code = ''
93
100
  code.strip.split("\n").each_with_index do |line, index|
94
101
  index += starting_line_number
95
- line = " " if line.empty?
102
+ line = line.empty? ? "&nbsp" : CodeRay.scan(line, language.to_sym).html
96
103
  lines += %Q[<div class="line-number#{' highlight' if lines_to_highlight && lines_to_highlight.include?(index)}">#{index}</div>]
97
104
  wrapped_code += %Q[<div class="code-part#{' highlight' if lines_to_highlight && lines_to_highlight.include?(index)}">#{line}</div>]
98
105
  end
@@ -1,3 +1,3 @@
1
1
  module Author
2
- VERSION = "1.1.5.alpha"
2
+ VERSION = "1.1.6.alpha"
3
3
  end
@@ -22,4 +22,8 @@ describe Author::Commands::Builder do
22
22
  expect(output).to_include "epub"
23
23
  end
24
24
 
25
+ it "should respond to all" do
26
+ expect(output).to_include "all"
27
+ end
28
+
25
29
  end
@@ -10,7 +10,7 @@ describe Author::Plugins::AwesomeCodeblock do
10
10
  it "should process the block into pretty code" do
11
11
  using_liquid_templates do
12
12
  rendered = liquid.parse(IO.read('no_options.md')).render
13
- expect(rendered).to_include %q[puts "I'm awesome!"]
13
+ expect(rendered).to_include %q[puts &quot;I'm awesome!&quot;]
14
14
  expect(rendered).to_include %Q[<figure class="code text"><div class="CodeRay"><table class="code">]
15
15
  expect(rendered).to_not_include %q[<figcaption class='code-header'><span>]
16
16
  expect(rendered).to_not_include %q[<div class="line-number">]
@@ -8,7 +8,7 @@
8
8
  <div id="contents">
9
9
  <h2 id="this-is-chapter-one">This is chapter one</h2>
10
10
 
11
- <p>Liquid test </p>
11
+ <p>Liquid test {{ foo }}</p>
12
12
 
13
13
  <h2 id="this-is-chapter-two">This is chapter two</h2>
14
14
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: author
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.5.alpha
4
+ version: 1.1.6.alpha
5
5
  platform: ruby
6
6
  authors:
7
7
  - Terry Schmidt
@@ -192,6 +192,7 @@ files:
192
192
  - LICENSE.txt
193
193
  - README.md
194
194
  - Rakefile
195
+ - TODO.md
195
196
  - author.gemspec
196
197
  - bin/author
197
198
  - lib/author.rb