From 69cc645c70bdbd4e0a43f176a66197d6b07d1dd7 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Sat, 24 Dec 2011 17:26:18 -0800 Subject: [PATCH] (draft) guides for the Kindle and Kindle apps [Mip Earson & Xavier Noria] --- .../images/rails_guides_kindle_cover.jpg | Bin 0 -> 31785 bytes railties/guides/assets/stylesheets/kindle.css | 11 ++ railties/guides/rails_guides/generator.rb | 114 ++++++++--- railties/guides/rails_guides/helpers.rb | 8 + railties/guides/source/_license.html.erb | 2 + railties/guides/source/_welcome.html.erb | 21 ++ railties/guides/source/documents.yaml | 153 +++++++++++++++ railties/guides/source/index.html.erb | 185 +----------------- railties/guides/source/kindle/KINDLE.md | 26 +++ .../guides/source/kindle/copyright.html.erb | 1 + railties/guides/source/kindle/layout.html.erb | 27 +++ .../guides/source/kindle/rails_guides.opf.erb | 52 +++++ railties/guides/source/kindle/toc.html.erb | 24 +++ railties/guides/source/kindle/toc.ncx.erb | 64 ++++++ .../guides/source/kindle/welcome.html.erb | 5 + railties/guides/source/layout.html.erb | 3 +- 16 files changed, 491 insertions(+), 205 deletions(-) create mode 100644 railties/guides/assets/images/rails_guides_kindle_cover.jpg create mode 100644 railties/guides/assets/stylesheets/kindle.css create mode 100644 railties/guides/source/_license.html.erb create mode 100644 railties/guides/source/_welcome.html.erb create mode 100644 railties/guides/source/documents.yaml create mode 100644 railties/guides/source/kindle/KINDLE.md create mode 100644 railties/guides/source/kindle/copyright.html.erb create mode 100644 railties/guides/source/kindle/layout.html.erb create mode 100644 railties/guides/source/kindle/rails_guides.opf.erb create mode 100644 railties/guides/source/kindle/toc.html.erb create mode 100644 railties/guides/source/kindle/toc.ncx.erb create mode 100644 railties/guides/source/kindle/welcome.html.erb diff --git a/railties/guides/assets/images/rails_guides_kindle_cover.jpg b/railties/guides/assets/images/rails_guides_kindle_cover.jpg new file mode 100644 index 0000000000000000000000000000000000000000..9eb16720a9429b178d1246eeba88726d49f7cc7b GIT binary patch literal 31785 zcmeFZc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#LA&%`q?X=nNV zFxkgmnY!9gN2yQgt#5q!K9wmKP@&PWL(C(kzXa9WTvBj0WCd4`-X-ZNXZESVu@YVY ziKa+n_pMolLKn4WJ7QTDz@B2V-4Peyqz|dE7SPdmo&}0ur3yXFAq136bjk+51pC&!JZA z$>(F({GHFK6Dp(&fAH?as(&WB-i$Ho3E-HJ&KA7tOW0?P;B8i}TX1!RMeD?9E{IT; z;FRz0?r0v?k=HE)lbOMJ_T|=w>jZkt>y`a|w=&`Co`9>*iqGotsD=Iz-?DOPlZWO_ zg9Ge6%Fm>Vh%-Zta!mv|*hztjd0dmLAqx^+c8jDCa@MKyF6W$LyIrl!{OvVNbZq2c zA4_oQ^PjzHb?eX`XkC~At%n*$=y#FfAuxPjQQy#q7|jF?&1T8FK59MC1*G14nrMtr z705R6=MDAP-r6R#TJKX!M~r55n`z+U=?c zIZ@5nkFx7~lqo~g>m4ZB>5mV(BhDM9gFd$p|F;%aeH+pk6XnQ&i}CD2s{s3zV^=E*rpE$anAkE8-ErzEd~*U?-U_`Be7;bw-S8#o z9?Lpet& #{output_dir}/kindlegen.out 2>&1" + puts "Guides compiled as Kindle book to #{kindle_output_file}" + puts "(kindlegen log at #{output_dir}/kindlegen.out)." + end + + def kindle_output_file + "rails_guides_#@version%s.mobi" % (@lang.present? ? ".#@lang" : '') + end + + def initialize_dirs(output) + @guides_dir = File.join(File.dirname(__FILE__), '..') + @source_dir = "#@guides_dir/source/#@lang" + @output_dir = output || "#@guides_dir/output/#@lang" + end + + def create_output_dir_if_needed + FileUtils.mkdir_p(output_dir) end def generate_guides @@ -105,6 +145,13 @@ module RailsGuides def guides_to_generate guides = Dir.entries(source_dir).grep(GUIDES_RE) + + if kindle? + Dir.entries("#{source_dir}/kindle").grep(GUIDES_RE).map do |entry| + guides << "kindle/#{entry}" + end + end + ENV.key?('ONLY') ? select_only(guides) : guides end @@ -120,36 +167,47 @@ module RailsGuides end def output_file_for(guide) - guide.sub(GUIDES_RE, '.html') + if guide =~/\.textile$/ + guide.sub(/\.textile$/, '.html') + else + guide.sub(/\.erb$/, '') + end + end + + def output_path_for(output_file) + File.join(output_dir, File.basename(output_file)) end def generate?(source_file, output_file) fin = File.join(source_dir, source_file) - fout = File.join(output_dir, output_file) + fout = output_path_for(output_file) all || !File.exists?(fout) || File.mtime(fout) < File.mtime(fin) end def generate_guide(guide, output_file) - puts "Generating #{output_file}" - File.open(File.join(output_dir, output_file), 'w') do |f| - view = ActionView::Base.new(source_dir, :edge => edge) + output_path = output_path_for(output_file) + puts "Generating #{guide} as #{output_file}" + layout = guide.start_with?('kindle/') ? 'kindle/layout' : 'layout' + + File.open(output_path, 'w') do |f| + view = ActionView::Base.new(source_dir, :version => @version) view.extend(Helpers) - if guide =~ /\.html\.erb$/ + if guide =~ /\.(\w+)\.erb$/ # Generate the special pages like the home. # Passing a template handler in the template name is deprecated. So pass the file name without the extension. - result = view.render(:layout => 'layout', :file => $`) + result = view.render(:layout => layout, :formats => [$1], :file => $`) else body = File.read(File.join(source_dir, guide)) body = set_header_section(body, view) body = set_index(body, view) - result = view.render(:layout => 'layout', :text => textile(body)) + result = view.render(:layout => layout, :text => textile(body)) warn_about_broken_links(result) if @warnings end - f.write result + f.write(result) end end diff --git a/railties/guides/rails_guides/helpers.rb b/railties/guides/rails_guides/helpers.rb index 463df8a7a8..45ad9b9588 100644 --- a/railties/guides/rails_guides/helpers.rb +++ b/railties/guides/rails_guides/helpers.rb @@ -11,6 +11,14 @@ module RailsGuides result << content_tag(:dd, capture(&block)) result end + + def documents_by_section + @documents_by_section ||= YAML.load_file(File.expand_path('../../source/documents.yaml', __FILE__)) + end + + def documents_flat + documents_by_section.map {|section| section['documents']}.flatten + end def author(name, nick, image = 'credits_pic_blank.gif', &block) image = "images/#{image}" diff --git a/railties/guides/source/_license.html.erb b/railties/guides/source/_license.html.erb new file mode 100644 index 0000000000..00b4466f50 --- /dev/null +++ b/railties/guides/source/_license.html.erb @@ -0,0 +1,2 @@ +

This work is licensed under a Creative Commons Attribution-Share Alike 3.0 License

+

"Rails", "Ruby on Rails", and the Rails logo are trademarks of David Heinemeier Hansson. All rights reserved.

diff --git a/railties/guides/source/_welcome.html.erb b/railties/guides/source/_welcome.html.erb new file mode 100644 index 0000000000..a5ceeee5f2 --- /dev/null +++ b/railties/guides/source/_welcome.html.erb @@ -0,0 +1,21 @@ +

Ruby on Rails Guides (<%= @version %>)

+ +<% if @edge %> +

+ These are Edge Guides, based on the current + master branch. +

+

+ If you are looking for the ones for the stable version please check + http://guides.rubyonrails.org instead. +

+<% else %> +

+ These are the new guides for Rails 3. The guides for Rails 2.3 are still available + at http://guides.rubyonrails.org/v2.3.11/. +

+<% end %> +

+ These guides are designed to make you immediately productive with Rails, + and to help you understand how all of the pieces fit together. +

diff --git a/railties/guides/source/documents.yaml b/railties/guides/source/documents.yaml new file mode 100644 index 0000000000..dccfefb4fb --- /dev/null +++ b/railties/guides/source/documents.yaml @@ -0,0 +1,153 @@ +- + name: Start Here + documents: + - + name: Getting Started with Rails + url: getting_started.html + description: Everything you need to know to install Rails and create your first application. +- + name: Models + documents: + - + name: Rails Database Migrations + url: migrations.html + description: This guide covers how you can use Active Record migrations to alter your database in a structured and organized manner. + - + name: Active Record Validations and Callbacks + url: active_record_validations_callbacks.html + description: This guide covers how you can use Active Record validations and callbacks. + - + name: Active Record Associations + url: association_basics.html + description: This guide covers all the associations provided by Active Record. + - + name: Active Record Query Interface + url: active_record_querying.html + description: This guide covers the database query interface provided by Active Record. +- + name: Views + documents: + - + name: Layouts and Rendering in Rails + url: layouts_and_rendering.html + description: This guide covers the basic layout features of Action Controller and Action View, including rendering and redirecting, using content_for blocks, and working with partials. + - + name: Action View Form Helpers + url: form_helpers.html + description: Guide to using built-in Form helpers. +- + name: Controllers + documents: + - + name: Action Controller Overview + url: action_controller_overview.html + description: This guide covers how controllers work and how they fit into the request cycle in your application. It includes sessions, filters, and cookies, data streaming, and dealing with exceptions raised by a request, among other topics. + - + name: Rails Routing from the Outside In + url: routing.html + description: This guide covers the user-facing features of Rails routing. If you want to understand how to use routing in your own Rails applications, start here. +- + name: Digging Deeper + documents: + - + name: Active Support Core Extensions + url: active_support_core_extensions.html + description: This guide documents the Ruby core extensions defined in Active Support. + - + name: Rails Internationalization API + url: i18n.html + description: This guide covers how to add internationalization to your applications. Your application will be able to translate content to different languages, change pluralization rules, use correct date formats for each country and so on. + - + name: Action Mailer Basics + url: action_mailer_basics.html + work_in_progress: true + description: This guide describes how to use Action Mailer to send and receive emails. + - + name: Testing Rails Applications + url: testing.html + work_in_progress: true + description: This is a rather comprehensive guide to doing both unit and functional tests in Rails. It covers everything from 'What is a test?' to the testing APIs. Enjoy. + - + name: Securing Rails Applications + url: security.html + description: This guide describes common security problems in web applications and how to avoid them with Rails. + - + name: Debugging Rails Applications + url: debugging_rails_applications.html + description: This guide describes how to debug Rails applications. It covers the different ways of achieving this and how to understand what is happening "behind the scenes" of your code. + - + name: Performance Testing Rails Applications + url: performance_testing.html + description: This guide covers the various ways of performance testing a Ruby on Rails application. + - + name: Configuring Rails Applications + url: configuring.html + description: This guide covers the basic configuration settings for a Rails application. + - + name: Rails Command Line Tools and Rake tasks + url: command_line.html + description: This guide covers the command line tools and rake tasks provided by Rails. + - + name: Caching with Rails + work_in_progress: true + url: caching_with_rails.html + description: Various caching techniques provided by Rails. + - + name: Asset Pipeline + url: asset_pipeline.html + description: This guide documents the asset pipeline. + - + name: The Rails Initialization Process + work_in_progress: true + url: initialization.html + description: This guide explains the internals of the Rails initialization process as of Rails 3.1 +- + name: Extending Rails + documents: + - + name: The Basics of Creating Rails Plugins + work_in_progress: true + url: plugins.html + description: This guide covers how to build a plugin to extend the functionality of Rails. + - + name: Rails on Rack + url: rails_on_rack.html + description: This guide covers Rails integration with Rack and interfacing with other Rack components. + - + name: Creating and Customizing Rails Generators + url: generators.html + description: This guide covers the process of adding a brand new generator to your extension or providing an alternative to an element of a built-in Rails generator (such as providing alternative test stubs for the scaffold generator). +- + name: Contributing to Ruby on Rails + documents: + - + name: Contributing to Ruby on Rails + url: contributing_to_ruby_on_rails.html + description: Rails is not 'somebody else's framework.' This guide covers a variety of ways that you can get involved in the ongoing development of Rails. + - + name: API Documentation Guidelines + url: api_documentation_guidelines.html + description: This guide documents the Ruby on Rails API documentation guidelines. + - + name: Ruby on Rails Guides Guidelines + url: ruby_on_rails_guides_guidelines.html + description: This guide documents the Ruby on Rails guides guidelines. +- + name: Release Notes + documents: + - + name: Ruby on Rails 3.1 Release Notes + url: 3_1_release_notes.html + description: Release notes for Rails 3.1. + - + name: Ruby on Rails 3.0 Release Notes + url: 3_0_release_notes.html + description: Release notes for Rails 3.0. + - + name: Ruby on Rails 2.3 Release Notes + url: 2_3_release_notes.html + description: Release notes for Rails 2.3. + - + name: Ruby on Rails 2.2 Release Notes + url: 2_2_release_notes.html + description: Release notes for Rails 2.2. diff --git a/railties/guides/source/index.html.erb b/railties/guides/source/index.html.erb index c9a8c4fa5c..da1a37015b 100644 --- a/railties/guides/source/index.html.erb +++ b/railties/guides/source/index.html.erb @@ -3,28 +3,7 @@ Ruby on Rails Guides <% end %> <% content_for :header_section do %> -

Ruby on Rails Guides (<%= ENV['RAILS_VERSION'] || 'edge' %>)

- -<% if @edge %> -

- These are Edge Guides, based on the current - master branch. -

-

- If you are looking for the ones for the stable version please check - http://guides.rubyonrails.org instead. -

-<% else %> -

- These are the new guides for Rails 3. The guides for Rails 2.3 are still available - at http://guides.rubyonrails.org/v2.3.11/. -

-<% end %> -

- These guides are designed to make you immediately productive with Rails, - and to help you understand how all of the pieces fit together. -

- +<%= render 'welcome' %> <% end %> <% content_for :index_section do %> @@ -35,157 +14,13 @@ Ruby on Rails Guides <% end %> -

Start Here

- -
-<%= guide('Getting Started with Rails', 'getting_started.html') do %> -

Everything you need to know to install Rails and create your first application.

+<% documents_by_section.each do |section| %> +

<%= section['name'] %>

+
+ <% section['documents'].each do |document| %> + <%= guide(document['name'], document['url'], :work_in_progress => document['work_in_progress']) do %> +

<%= document['description'] %>

+ <% end %> + <% end %> +
<% end %> -
- -

Models

- -
-<%= guide("Rails Database Migrations", 'migrations.html') do %> -

This guide covers how you can use Active Record migrations to alter your database in a structured and organized manner.

-<% end %> - -<%= guide("Active Record Validations and Callbacks", 'active_record_validations_callbacks.html') do %> -

This guide covers how you can use Active Record validations and callbacks.

-<% end %> - -<%= guide("Active Record Associations", 'association_basics.html') do %> -

This guide covers all the associations provided by Active Record.

-<% end %> - -<%= guide("Active Record Query Interface", 'active_record_querying.html') do %> -

This guide covers the database query interface provided by Active Record.

-<% end %> -
- -

Views

- -
-<%= guide("Layouts and Rendering in Rails", 'layouts_and_rendering.html') do %> -

This guide covers the basic layout features of Action Controller and Action View, including rendering and redirecting, using content_for blocks, and working with partials.

-<% end %> - -<%= guide("Action View Form Helpers", 'form_helpers.html', :work_in_progress => true) do %> -

Guide to using built-in Form helpers.

-<% end %> -
- -

Controllers

- -
-<%= guide("Action Controller Overview", 'action_controller_overview.html') do %> -

This guide covers how controllers work and how they fit into the request cycle in your application. It includes sessions, filters, and cookies, data streaming, and dealing with exceptions raised by a request, among other topics.

-<% end %> - -<%= guide("Rails Routing from the Outside In", 'routing.html') do %> -

This guide covers the user-facing features of Rails routing. If you want to understand how to use routing in your own Rails applications, start here.

-<% end %> -
- -

Digging Deeper

- -
- -<%= guide("Active Support Core Extensions", 'active_support_core_extensions.html') do %> -

This guide documents the Ruby core extensions defined in Active Support.

-<% end %> - -<%= guide("Rails Internationalization API", 'i18n.html') do %> -

This guide covers how to add internationalization to your applications. Your application will be able to translate content to different languages, change pluralization rules, use correct date formats for each country and so on.

-<% end %> - -<%= guide("Action Mailer Basics", 'action_mailer_basics.html', :work_in_progress => true) do %> -

This guide describes how to use Action Mailer to send and receive emails.

-<% end %> - -<%= guide("Testing Rails Applications", 'testing.html', :work_in_progress => true) do %> -

This is a rather comprehensive guide to doing both unit and functional tests in Rails. It covers everything from "What is a test?" to the testing APIs. Enjoy.

-<% end %> - -<%= guide("Securing Rails Applications", 'security.html') do %> -

This guide describes common security problems in web applications and how to avoid them with Rails.

-<% end %> - -<%= guide("Debugging Rails Applications", 'debugging_rails_applications.html') do %> -

This guide describes how to debug Rails applications. It covers the different ways of achieving this and how to understand what is happening "behind the scenes" of your code.

-<% end %> - -<%= guide("Performance Testing Rails Applications", 'performance_testing.html') do %> -

This guide covers the various ways of performance testing a Ruby on Rails application.

-<% end %> - -<%= guide("Configuring Rails Applications", 'configuring.html') do %> -

This guide covers the basic configuration settings for a Rails application.

-<% end %> - -<%= guide("Rails Command Line Tools and Rake tasks", 'command_line.html') do %> -

This guide covers the command line tools and rake tasks provided by Rails.

-<% end %> - -<%= guide("Caching with Rails", 'caching_with_rails.html', :work_in_progress => true) do %> -

Various caching techniques provided by Rails.

-<% end %> - -<%= guide('Asset Pipeline', 'asset_pipeline.html') do %> -

This guide documents the asset pipeline.

-<% end %> -
- -

Extending Rails

- -
- <%= guide("The Basics of Creating Rails Plugins", 'plugins.html', :work_in_progress => true) do %> -

This guide covers how to build a plugin to extend the functionality of Rails.

- <% end %> - - <%= guide("Rails on Rack", 'rails_on_rack.html') do %> -

This guide covers Rails integration with Rack and interfacing with other Rack components.

- <% end %> - - <%= guide("Creating and Customizing Rails Generators", 'generators.html') do %> -

This guide covers the process of adding a brand new generator to your extension - or providing an alternative to an element of a built-in Rails generator (such as - providing alternative test stubs for the scaffold generator).

- <% end %> -
- -

Contributing to Ruby on Rails

- -
- <%= guide("Contributing to Ruby on Rails", 'contributing_to_ruby_on_rails.html') do %> -

Rails is not "somebody else's framework." This guide covers a variety of ways that you can get involved in the ongoing development of Rails.

- <% end %> - - <%= guide('API Documentation Guidelines', 'api_documentation_guidelines.html') do %> -

This guide documents the Ruby on Rails API documentation guidelines.

- <% end %> - - <%= guide('Ruby on Rails Guides Guidelines', 'ruby_on_rails_guides_guidelines.html') do %> -

This guide documents the Ruby on Rails guides guidelines.

- <% end %> -
- -

Release Notes

- -
-<%= guide("Ruby on Rails 3.1 Release Notes", '3_1_release_notes.html') do %> -

Release notes for Rails 3.1.

-<% end %> - -<%= guide("Ruby on Rails 3.0 Release Notes", '3_0_release_notes.html') do %> -

Release notes for Rails 3.0.

-<% end %> - -<%= guide("Ruby on Rails 2.3 Release Notes", '2_3_release_notes.html') do %> -

Release notes for Rails 2.3.

-<% end %> - -<%= guide("Ruby on Rails 2.2 Release Notes", '2_2_release_notes.html') do %> -

Release notes for Rails 2.2.

-<% end %> -
diff --git a/railties/guides/source/kindle/KINDLE.md b/railties/guides/source/kindle/KINDLE.md new file mode 100644 index 0000000000..a7d9a4e4cf --- /dev/null +++ b/railties/guides/source/kindle/KINDLE.md @@ -0,0 +1,26 @@ +# Rails Guides on the Kindle + + +## Synopsis + + 1. Obtain `kindlegen` from the link below and put the binary in your path + 2. Run `KINDLE=1 rake generate_guides` to generate the guides and compile the `.mobi` file + 3. Copy `output/kindle/rails_guides.mobi` to your Kindle + +## Resources + + * [StackOverflow: Kindle Periodical Format](http://stackoverflow.com/questions/5379565/kindle-periodical-format) + * Example Periodical [.ncx](https://gist.github.com/808c971ed087b839d462) and [.opf](https://gist.github.com/d6349aa8488eca2ee6d0) + * [Kindle Publishing guidelines](http://kindlegen.s3.amazonaws.com/AmazonKindlePublishingGuidelines.pdf) + * [KindleGen & Kindle Previewer](http://www.amazon.com/gp/feature.html?ie=UTF8&docId=1000234621) + +## TODO + +### Post release + + * Integrate generated Kindle document in to published HTML guides + * Tweak heading styles (most docs use h3/h4/h5, which end up being smaller than the text under it) + * Tweak table styles (smaller text? Many of the tables are unusable on a Kindle in portrait mode) + * Have the HTML/XML TOC 'drill down' into the TOCs of the individual guides + * `.epub` generation. + diff --git a/railties/guides/source/kindle/copyright.html.erb b/railties/guides/source/kindle/copyright.html.erb new file mode 100644 index 0000000000..bd51d87383 --- /dev/null +++ b/railties/guides/source/kindle/copyright.html.erb @@ -0,0 +1 @@ +<%= render 'license' %> \ No newline at end of file diff --git a/railties/guides/source/kindle/layout.html.erb b/railties/guides/source/kindle/layout.html.erb new file mode 100644 index 0000000000..f0a286210b --- /dev/null +++ b/railties/guides/source/kindle/layout.html.erb @@ -0,0 +1,27 @@ + + + + + + +<%= yield(:page_title) || 'Ruby on Rails Guides' %> + + + + + + + <% if content_for? :header_section %> + <%= yield :header_section %> +
+ <% end %> + + <% if content_for? :index_section %> + <%= yield :index_section %> +
+ <% end %> + + <%= yield.html_safe %> + + diff --git a/railties/guides/source/kindle/rails_guides.opf.erb b/railties/guides/source/kindle/rails_guides.opf.erb new file mode 100644 index 0000000000..4e07664fd0 --- /dev/null +++ b/railties/guides/source/kindle/rails_guides.opf.erb @@ -0,0 +1,52 @@ + + + + + + + + Ruby on Rails Guides (<%= @version %>) + + en-us + Ruby on Rails + Ruby on Rails + Reference + <%= Time.now.strftime('%Y-%m-%d') %> + + These guides are designed to make you immediately productive with Rails, and to help you understand how all of the pieces fit together. + + + + + + + + + <% documents_flat.each do |document| %> + + <% end %> + + <% %w{toc.html credits.html welcome.html copyright.html}.each do |url| %> + + <% end %> + + + + + + + + + + + + <% documents_flat.each do |document| %> + + <% end %> + + + + + + + diff --git a/railties/guides/source/kindle/toc.html.erb b/railties/guides/source/kindle/toc.html.erb new file mode 100644 index 0000000000..e013797dee --- /dev/null +++ b/railties/guides/source/kindle/toc.html.erb @@ -0,0 +1,24 @@ +<% content_for :page_title do %> +Ruby on Rails Guides +<% end %> + +

Table of Contents

+
+ +<% documents_by_section.each_with_index do |section, i| %> +

<%= "#{i + 1}." %> <%= section['name'] %>

+
    + <% section['documents'].each do |document| %> +
  • + <%= document['name'] %> + <% if document['work_in_progress']%>(WIP)<% end %> +
  • + <% end %> +
+<% end %> +
+
diff --git a/railties/guides/source/kindle/toc.ncx.erb b/railties/guides/source/kindle/toc.ncx.erb new file mode 100644 index 0000000000..2c6d8e3bdf --- /dev/null +++ b/railties/guides/source/kindle/toc.ncx.erb @@ -0,0 +1,64 @@ + + + + + + + + + + +Ruby on Rails Guides +docrails + + + + Table of Contents + + + + + + Introduction + + + + + + Welcome + + + + + Credits + + + + Copyright & License + + + + + <% play_order = 4 %> + <% documents_by_section.each_with_index do |section, section_no| %> + + + <%= section['name'] %> + + + + <% section['documents'].each_with_index do |document, document_no| %> + + + <%= document['name'] %> + + + + <% end %> + + <% end %> + + + + diff --git a/railties/guides/source/kindle/welcome.html.erb b/railties/guides/source/kindle/welcome.html.erb new file mode 100644 index 0000000000..e2155ee1de --- /dev/null +++ b/railties/guides/source/kindle/welcome.html.erb @@ -0,0 +1,5 @@ +<%= render 'welcome' %> + +

Kindle Edition

+ +The Kindle Edition of the Rails Guides should be considered a 'work in progress'. Track changes and raise issues at https://github.com/mipearson/rails/tree/guides_for_kindle. \ No newline at end of file diff --git a/railties/guides/source/layout.html.erb b/railties/guides/source/layout.html.erb index 4c979888b7..e69936b43a 100644 --- a/railties/guides/source/layout.html.erb +++ b/railties/guides/source/layout.html.erb @@ -143,8 +143,7 @@