diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2008-10-21 18:33:40 +0100 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2008-10-21 18:33:40 +0100 |
commit | a03e2b356c66ddc8809fa2b23a2a7d652f173b8b (patch) | |
tree | ab8552913475bf94a78e4cbfbae804b2ecd9eca2 /railties/doc/guides/source/templates | |
parent | 18542c9e00209679bdaacf64075819fb887ec856 (diff) | |
download | rails-a03e2b356c66ddc8809fa2b23a2a7d652f173b8b.tar.gz rails-a03e2b356c66ddc8809fa2b23a2a7d652f173b8b.tar.bz2 rails-a03e2b356c66ddc8809fa2b23a2a7d652f173b8b.zip |
Merge with docrails. Also add a rake task to generate guides in your rails application :
rake doc:guides
The rake task will generate guides inside doc/guides directory of your application. Open index.html to browse.
Diffstat (limited to 'railties/doc/guides/source/templates')
-rw-r--r-- | railties/doc/guides/source/templates/guides.html.erb | 97 | ||||
-rw-r--r-- | railties/doc/guides/source/templates/inline.css | 165 |
2 files changed, 262 insertions, 0 deletions
diff --git a/railties/doc/guides/source/templates/guides.html.erb b/railties/doc/guides/source/templates/guides.html.erb new file mode 100644 index 0000000000..d69cf5e08a --- /dev/null +++ b/railties/doc/guides/source/templates/guides.html.erb @@ -0,0 +1,97 @@ +<%- + manuals_index_url = ENV['MANUALSONRAILS_INDEX_URL'] || "index.html" + show_toc = ENV['MANUALSONRAILS_TOC'] != 'no' +-%> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <title><%- if multi_page? && !is_preamble? -%><%=h current_chapter.plain_title %> :: <% end %><%=h title %></title> + <!--[if lt IE 8]> + <script src="http://ie7-js.googlecode.com/svn/version/2.0(beta3)/IE8.js" type="text/javascript"></script> + <![endif]--> + <link href="stylesheets/base.css" media="screen" rel="Stylesheet" type="text/css" /> + <link href="stylesheets/forms.css" media="screen" rel="Stylesheet" type="text/css" /> + <link href="stylesheets/more.css" media="screen" rel="Stylesheet" type="text/css" /> + <style type="text/css"> + <%= include_file('inline.css') %> + </style> +</head> +<body> + <div id="header" <% if !show_toc %> class="notoc"<% end %>> + <div id="logo"> + <a href="index.html" title="Ruby on Rails"><img src="images/rails_logo_remix.gif" alt="Rails" height="140" width="110" /></a> + </div> + + <h1 id="site_title"><span>Ruby on Rails</span></h1> + <h2 id="site_title_tagline">Sustainable productivity for web-application development</h2> + + <ul id="navMain"> + <li class="first-child"><a href="http://www.rubyonrails.org/" title="Ruby on Rails" class="ruby_on_rails">Ruby on Rails</a></li> + <li><a class="manuals" href="index.html" title="Manuals Index">Guides Index</a></li> + </ul> + </div> + + <div id="container"<% if !show_toc %> class="notoc"<% end %>> + <% if show_toc %> + <div id="sidebar"> + <h2>Chapters</h2> + <%- if multi_page? -%> + <a href="<%=h chapters.first.basename %>">Preamble</a> + <%- end -%> + <ol> + <%- if multi_page? -%> + <%- for heading in table_of_contents -%> + <li> + <a href="<%=h heading.basename %>"><%= heading.title_without_numbers %></a> + <%- if !heading.children.empty? -%> + <ul> + <% for h in heading.children %> + <li><a href="<%=h h.basename %><%=h h.anchor %>"><%= h.title_without_numbers %></a></li> + <% end %> + </ul> + <%- end -%> + </li> + <%- end -%> + <%- else -%> + <%- for heading in table_of_contents -%> + <li> + <a href="<%=h heading.anchor %>"><%= heading.title_without_numbers %></a> + <%- if !heading.children.empty? -%> + <ul> + <% for h in heading.children %> + <li><a href="<%=h h.anchor %>"><%= h.title_without_numbers %></a></li> + <% end %> + </ul> + <%- end -%> + </li> + <%- end -%> + <%- end -%> + </ol> + </div> + <% end %> + <div id="content"> + <%- if multi_page? && !is_preamble? -%> + <h2 id="<%=h current_chapter.anchor_id %>"><%= current_chapter.title %></h2> + <%- else -%> + <h1><%=h title %></h1> + <%- end -%> + <%= contents %> + <%- if multi_page? -%> + <div id="chapter_navigation"> + <%- if prev_chapter -%> + <div class="left-floaty"> + <a href="<%=h prev_chapter.basename %>">« <%= prev_chapter.title %></a> + </div> + <%- end -%> + <%- if next_chapter -%> + <div class="right-floaty"> + <a href="<%=h next_chapter.basename %>"><%= next_chapter.title %> »</a> + </div> + <%- end -%> + </div> + <%- end -%> + </div> + </div> +</body> +</html> diff --git a/railties/doc/guides/source/templates/inline.css b/railties/doc/guides/source/templates/inline.css new file mode 100644 index 0000000000..1b406733de --- /dev/null +++ b/railties/doc/guides/source/templates/inline.css @@ -0,0 +1,165 @@ +div#container { + max-width: 900px; + padding-bottom: 3em; +} + +div#content { + margin-left: 200px; +} + +div#container.notoc { + max-width: 600px; +} + +.notoc div#content { + margin-left: 0; +} + +pre { + line-height: 1.4em; +} + +#content p tt { + background: #eeeeee; + border: solid 1px #cccccc; + padding: 3px; +} + +dt { + font-weight: bold; +} + +#content dt tt { + font-size: 10pt; +} + +dd { + margin-left: 3em; +} + +#content dt tt, #content pre tt { + background: none; + padding: 0; + border: 0; +} + +#content .olist ol { + margin-left: 2em; +} + +#header { + position: relative; + max-width: 840px; + margin-left: auto; + margin-right: auto; +} + +#header.notoc { + max-width: 580px; +} + +#logo { + position: absolute; + left: 10px; + top: 10px; + width: 110px; + height: 140px; +} + +div#header h1#site_title { + background: url('images/ruby_on_rails_by_mike_rundle2.gif') top left no-repeat; + position: absolute; + width: 392px; + height: 55px; + left: 145px; + top: 20px; + margin: 0; + padding: 0; +} + +#site_title span { + display: none; +} + +#site_title_tagline { + display: none; +} + +ul#navMain { + position: absolute; + margin: 0; + padding: 0; + top: 97px; + left: 145px; +} + +.left-floaty, .right-floaty { + padding: 15px; +} + +.admonitionblock, +.tableblock { + margin-left: 1em; + margin-right: 1em; + margin-top: 0.25em; + margin-bottom: 1em; +} + +.admonitionblock .icon { + padding-right: 8px; +} + +.admonitionblock .content { + border: solid 1px #ffda78; + background: #fffebd; + padding: 10px; + padding-top: 8px; + padding-bottom: 8px; +} + +.admonitionblock .title { + font-size: 140%; + margin-bottom: 0.5em; +} + +.tableblock table { + border: solid 1px #aaaaff; + background: #f0f0ff; +} + +.tableblock th { + background: #e0e0e0; +} + +.tableblock th, +.tableblock td { + padding: 3px; + padding-left: 5px; + padding-right: 5px; +} + +.sidebarblock { + margin-top: 0.25em; + margin: 1em; + border: solid 1px #ccccbb; + padding: 8px; + background: #ffffe0; +} + +.sidebarblock .sidebar-title { + font-size: 140%; + font-weight: 600; + margin-bottom: 0.3em; +} + +.sidebarblock .sidebar-content > .para:last-child > p { + margin-bottom: 0; +} + +.sidebarblock .sidebar-title a { + text-decoration: none; +} + +.sidebarblock .sidebar-title a:hover { + text-decoration: underline; +} |