docrails_kindle 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,10 +1,28 @@
1
1
  # docrails_kindle
2
2
 
3
- This gem lets you generate a Kindle version of the [Ruby on Rails Guides][railsguide] with
4
- working section and article navigation.
3
+ This gem lets you generate a Kindle version of the [Ruby on Rails
4
+ Guides][railsguide] with working section and article navigation.
5
5
 
6
6
  [railsguide]:http://guides.rubyonrails.org/
7
7
 
8
+ ![screen](https://github.com/danchoi/docrails_kindle/raw/master/images/screen1-sm.gif)
9
+
10
+ The DocRails project does provide its own experimental Rake task to generate a
11
+ Kindle version of the Rails Guides. However, its section and article
12
+ navigation doesn't work correctly (at least on a Kindle Touch).
13
+
14
+ ## Download Guide
15
+
16
+ If you just want to download the ebook I generated with this tool, here it is:
17
+
18
+ [Download Rails Guides ebook][mobi]
19
+
20
+ [mobi]:https://github.com/danchoi/docrails_kindle/raw/master/mobi/rails-guide.2012-01-18.mobi
21
+
22
+ But to keep up with updates to the Rails Guides, you may want to periodically
23
+ generate the Rails Guides ebook yourself. For this, please read on.
24
+
25
+
8
26
  ## Install
9
27
 
10
28
  gem install docrails_kindle
@@ -26,7 +44,7 @@ Download [KindleGen 2][kindlegen] and put it on your PATH.
26
44
 
27
45
  The output document will be called something like
28
46
  `rails-guide.2012-11-18.mobi`. Don't confuse it with the other mobi document
29
- that gets generated by `rake genereate_guides`, which looks like
47
+ that gets generated by `rake generate_guides`, which looks like
30
48
  `ruby_on_rails_guides_16c5f48.mobi`.
31
49
 
32
50
  You can transfer this mobi file to your Kindle.
@@ -34,11 +52,12 @@ You can transfer this mobi file to your Kindle.
34
52
 
35
53
  ## Contribute
36
54
 
37
- This program is a rough prototype. Some internal links may not work. Other
38
- defects in the resulting ebook may exist. Please file issues.
55
+ This program is a rough prototype. Some internal links may not work. The css
56
+ styling may need to be improved. Other bugs may exist. Please file issues or
57
+ fork and submit pull requests.
39
58
 
40
- Also, if the `docsrails` team would like to incorporate this into their
41
- `rake` tasks code, please take and modify my code as you see fit.
59
+ Also, if the DocsRails team would like to incorporate and adapt this code for
60
+ their project, please go for it.
42
61
 
43
62
 
44
63
  ## Author
@@ -1,7 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- # take toc.ncx
4
-
5
3
  require 'nokogiri'
6
4
  require 'fileutils'
7
5
  require 'yaml'
@@ -94,7 +92,7 @@ x = Nokogiri::XML(File.open("rails_guides.opf")).remove_namespaces!
94
92
 
95
93
  document = {
96
94
  'doc_uuid' => x.at("package")['unique-identifier'],
97
- 'title' => x.at("title").inner_text,
95
+ 'title' => x.at("title").inner_text.gsub(/\(.*$/, " v2"),
98
96
  'publisher' => x.at("publisher").inner_text,
99
97
  'author' => x.at("creator").inner_text,
100
98
  'subject' => x.at("subject").inner_text,
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "docrails_kindle"
6
- s.version = '0.0.2'
6
+ s.version = '0.0.3'
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.required_ruby_version = '>= 1.9.0'
9
9
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docrails_kindle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-01-18 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri
16
- requirement: &21775660 !ruby/object:Gem::Requirement
16
+ requirement: &23725740 !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: *21775660
24
+ version_requirements: *23725740
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: kindlerb
27
- requirement: &21775180 !ruby/object:Gem::Requirement
27
+ requirement: &23725280 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *21775180
35
+ version_requirements: *23725280
36
36
  description: Read Rails Guides for your Kindle
37
37
  email:
38
38
  - dhchoi@gmail.com