aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2010-03-30 23:02:05 +0200
committerXavier Noria <fxn@hashref.com>2010-03-30 23:02:05 +0200
commit0fc1f92ac9ca9ec5d399c652b3f82b044d17ab6c (patch)
treeb5a7a6c5c9c5af32775e12811f47cc87422849c4 /railties
parent155f0be16ba4600e61e331b00e67d281e0550172 (diff)
downloadrails-0fc1f92ac9ca9ec5d399c652b3f82b044d17ab6c.tar.gz
rails-0fc1f92ac9ca9ec5d399c652b3f82b044d17ab6c.tar.bz2
rails-0fc1f92ac9ca9ec5d399c652b3f82b044d17ab6c.zip
<%=izes and adds doctype to guides
Diffstat (limited to 'railties')
-rw-r--r--railties/guides/rails_guides/generator.rb11
-rw-r--r--railties/guides/rails_guides/helpers.rb4
-rw-r--r--railties/guides/source/credits.textile.erb24
-rw-r--r--railties/guides/source/index.textile.erb48
4 files changed, 49 insertions, 38 deletions
diff --git a/railties/guides/rails_guides/generator.rb b/railties/guides/rails_guides/generator.rb
index 670d2bc4db..e30dd2d5f7 100644
--- a/railties/guides/rails_guides/generator.rb
+++ b/railties/guides/rails_guides/generator.rb
@@ -88,6 +88,10 @@ module RailsGuides
warn_about_broken_links(result) if ENV.key?("WARN_BROKEN_LINKS")
end
+ # FIXME: If the doctype is in the layout textile escapes it.
+ # Things should be set up in a way that prevents that, a doctype
+ # belongs to the layout.
+ result = insert_doctype(result)
result = insert_edge_badge(result) if ENV.key?('INSERT_EDGE_BADGE')
f.write result
end
@@ -199,6 +203,13 @@ module RailsGuides
end
end
end
+
+ def insert_doctype(html)
+ <<EOS + html
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+EOS
+ end
def insert_edge_badge(html)
html.sub(/<body[^>]*>/, '\&<img src="images/edge_badge.png" style="position:fixed; right:0px; top:0px; border:none; z-index:100"/>')
diff --git a/railties/guides/rails_guides/helpers.rb b/railties/guides/rails_guides/helpers.rb
index e05793d40e..bf99538696 100644
--- a/railties/guides/rails_guides/helpers.rb
+++ b/railties/guides/rails_guides/helpers.rb
@@ -9,7 +9,7 @@ module RailsGuides
end
result << content_tag(:dd, capture(&block))
- concat(result)
+ result
end
def lh(id, label = "Lighthouse Ticket")
@@ -23,7 +23,7 @@ module RailsGuides
result = content_tag(:img, nil, :src => image, :class => 'left pic', :alt => name)
result << content_tag(:h3, name)
result << content_tag(:p, capture(&block))
- concat content_tag(:div, result, :class => 'clearfix', :id => nick)
+ content_tag(:div, result, :class => 'clearfix', :id => nick)
end
def code(&block)
diff --git a/railties/guides/source/credits.textile.erb b/railties/guides/source/credits.textile.erb
index 28c70f2b39..0c54049e1c 100644
--- a/railties/guides/source/credits.textile.erb
+++ b/railties/guides/source/credits.textile.erb
@@ -7,54 +7,54 @@ p. We'd like to thank the following people for their tireless contributions to t
<h3 class="section">Rails Documentation Team</h3>
-<% author('Mike Gunderloy', 'mgunderloy') do %>
+<%= author('Mike Gunderloy', 'mgunderloy') do %>
Mike Gunderloy is a consultant with "ActionRails":http://www.actionrails.com. He brings 25 years of experience in a variety of languages to bear on his current work with Rails. His near-daily links and other blogging can be found at "A Fresh Cup":http://afreshcup.com and he "twitters":http://twitter.com/MikeG1 too much.
<% end %>
-<% author('Pratik Naik', 'lifo') do %>
+<%= author('Pratik Naik', 'lifo') do %>
Pratik Naik is a Ruby on Rails consultant with "ActionRails":http://www.actionrails.com and also a member of the "Rails core team":http://rubyonrails.org/core. He maintains a blog at "has_many :bugs, :through => :rails":http://m.onkey.org and has an active "twitter account":http://twitter.com/lifo.
<% end %>
-<% author('Xavier Noria', 'fxn', 'fxn.png') do %>
+<%= author('Xavier Noria', 'fxn', 'fxn.png') do %>
Xavier has been into Rails since 2005, he is currently a Rails consultant. Xavier is president of the <a href="http://www.srug.org/">Spanish Ruby Users Group</a> and has been involved in Rails in several ways. He enjoys combining his passion for Rails and his past life as a proofreader of math textbooks. Oh, he also "tweets":http://twitter.com/fxn!
<% end %>
<h3 class="section">Rails Guides Designers</h3>
-<% author('Jason Zimdars', 'jz') do %>
+<%= author('Jason Zimdars', 'jz') do %>
Jason Zimdars is an experienced creative director and web designer who has lead UI and UX design for numerous websites and web applications. You can see more of his design and writing at <a href="http://www.thinkcage.com/">Thinkcage.com</a> or follow him on <a href="http://twitter.com/JZ">Twitter</a>.
<% end %>
<h3 class="section">Rails Guides Authors</h3>
-<% author('Frederick Cheung', 'fcheung') do %>
+<%= author('Frederick Cheung', 'fcheung') do %>
Frederick Cheung is Chief Wizard at Texperts where he has been using Rails since 2006. He is based in Cambridge (UK) and when not consuming fine ales he blogs at "spacevatican.org":http://www.spacevatican.org.
<% end %>
-<% author('Tore Darell', 'toretore') do %>
+<%= author('Tore Darell', 'toretore') do %>
Tore Darell is an independent developer based in Menton, France who specialises in cruft-free web applications using Ruby, Rails and unobtrusive JavaScript. His home on the internet is his blog "Sneaky Abstractions":http://tore.darell.no.
<% end %>
-<% author('Jeff Dean', 'zilkey') do %>
+<%= author('Jeff Dean', 'zilkey') do %>
Jeff Dean is a software engineer with "Pivotal Labs":http://pivotallabs.com.
<% end %>
-<% author('Cássio Marques', 'cmarques') do %>
+<%= author('Cássio Marques', 'cmarques') do %>
Cássio Marques is a Brazilian software developer working with different programming languages such as Ruby, JavaScript, CPP and Java, as an independent consultant. He blogs at "/* CODIFICANDO */":http://cassiomarques.wordpress.com, which is mainly written in Portuguese, but will soon get a new section for posts with English translation.
<% end %>
-<% author('James Miller', 'bensie') do %>
+<%= author('James Miller', 'bensie') do %>
James Miller is a software developer for "JK Tech":http://www.jk-tech.com in San Diego, CA. Find me on GitHub, Gmail, Twitter, and Freenode as bensie.
<% end %>
-<% author('Emilio Tagua', 'miloops') do %>
+<%= author('Emilio Tagua', 'miloops') do %>
Emilio Tagua -- a.k.a. miloops -- is an Argentinian entrepreneur, developer, open source contributor and Rails evangelist. Cofounder of "Eventioz":http://eventioz.com. He has been using Rails since 2006 and contributing since early 2008. Can be found at gmail, twitter, freenode, everywhere as miloops.
<% end %>
-<% author('Heiko Webers', 'hawe') do %>
+<%= author('Heiko Webers', 'hawe') do %>
Heiko Webers is the founder of "bauland42":http://www.bauland42.de, a German web application security consulting and development company focused on Ruby on Rails. He blogs at the "Ruby on Rails Security Project":http://www.rorsecurity.info. After 10 years of desktop application development, Heiko has rarely looked back.
<% end %>
-<% author('Mikel Lindsaar', 'raasdnil') do %>
+<%= author('Mikel Lindsaar', 'raasdnil') do %>
Mikel Lindsaar has been working with Rails since 2006 and is the author of the Ruby Mail gem and core contributor (he helped re-write ActionMailer's API). Mikel has a "blog":http://lindsaar.net/ and "tweets":http://twitter.com/raasdnil.
<% end %>
diff --git a/railties/guides/source/index.textile.erb b/railties/guides/source/index.textile.erb
index d7db81309f..538fe48a38 100644
--- a/railties/guides/source/index.textile.erb
+++ b/railties/guides/source/index.textile.erb
@@ -20,7 +20,7 @@ These guides are designed to make you immediately productive with Rails, and to
h3. Start Here
<dl>
-<% guide('Getting Started with Rails', 'getting_started.html') do %>
+<%= guide('Getting Started with Rails', 'getting_started.html') do %>
Everything you need to know to install Rails and create your first application.
<% end %>
</dl>
@@ -28,19 +28,19 @@ h3. Start Here
h3. Models
<dl>
-<% guide("Rails Database Migrations", 'migrations.html') do %>
+<%= 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", 'activerecord_validations_callbacks.html') do %>
+<%= guide("Active Record Validations and Callbacks", 'activerecord_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 %>
+<%= 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 %>
+<%= guide("Active Record Query Interface", 'active_record_querying.html') do %>
This guide covers the database query interface provided by Active Record.
<% end %>
</dl>
@@ -48,11 +48,11 @@ h3. Models
h3. Views
<dl>
-<% guide("Layouts and Rendering in Rails", 'layouts_and_rendering.html') do %>
+<%= 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', :ticket => 1) do %>
+<%= guide("Action View Form Helpers", 'form_helpers.html', :ticket => 1) do %>
Guide to using built in Form helpers.
<% end %>
</dl>
@@ -60,11 +60,11 @@ h3. Views
h3. Controllers
<dl>
-<% guide("Action Controller Overview", 'action_controller_overview.html') do %>
+<%= 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 %>
+<%= 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 %>
</dl>
@@ -73,51 +73,51 @@ h3. Digging Deeper
<dl>
-<% guide("Rails on Rack", 'rails_on_rack.html') do %>
+<%= guide("Rails on Rack", 'rails_on_rack.html') do %>
This guide covers Rails integration with Rack and interfacing with other Rack components.
<% end %>
-<% guide("Rails Internationalization API", 'i18n.html') do %>
+<%= 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', :ticket => 25) do %>
+<%= guide("Action Mailer Basics", 'action_mailer_basics.html', :ticket => 25) do %>
This guide describes how to use Action Mailer to send and receive emails.
<% end %>
-<% guide("Testing Rails Applications", 'testing.html', :ticket => 8) do %>
+<%= guide("Testing Rails Applications", 'testing.html', :ticket => 8) 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 %>
+<%= 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 %>
+<%= 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 %>
+<%= 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("The Basics of Creating Rails Plugins", 'plugins.html', :ticket => 32) do %>
+<%= guide("The Basics of Creating Rails Plugins", 'plugins.html', :ticket => 32) do %>
This guide covers how to build a plugin to extend the functionality of Rails.
<% end %>
-<% guide("Configuring Rails Applications", 'configuring.html') do %>
+<%= 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', :ticket => 29) do %>
+<%= guide("Rails Command Line Tools and Rake tasks", 'command_line.html', :ticket => 29) do %>
This guide covers the command line tools and rake tasks provided by Rails.
<% end %>
-<% guide("Caching with Rails", 'caching_with_rails.html', :ticket => 10) do %>
+<%= guide("Caching with Rails", 'caching_with_rails.html', :ticket => 10) do %>
Various caching techniques provided by Rails.
<% end %>
-<% guide("Contributing to Rails", 'contributing_to_rails.html') do %>
+<%= guide("Contributing to Rails", 'contributing_to_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 %>
</dl>
@@ -125,15 +125,15 @@ h3. Digging Deeper
h3. Release Notes
<dl>
-<% guide("Ruby on Rails 3.0 Release Notes", '3_0_release_notes.html') do %>
+<%= 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 %>
+<%= 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 %>
+<%= guide("Ruby on Rails 2.2 Release Notes", '2_2_release_notes.html') do %>
Release notes for Rails 2.2.
<% end %>
</dl>