diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-09-18 23:33:36 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-09-18 23:33:36 +0000 |
commit | df7dac9174a31e71b58be6184e23bfe6b742a494 (patch) | |
tree | 885edf624f0e8f37014b0d937340ac1c372a0066 /lib/rdoc/generator | |
parent | fed428007c015ac3b7f4586f2491517fafffa030 (diff) |
* lib/rdoc: Update to RDoc 4.1.0.preview.1
RDoc 4.1.0 contains a number of enhancements including a new default
style and accessibility support. You can see the changelog here:
https://github.com/rdoc/rdoc/blob/v4.1.0.preview.1/History.rdoc
* test/rdoc: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc/generator')
32 files changed, 641 insertions, 418 deletions
diff --git a/lib/rdoc/generator/darkfish.rb b/lib/rdoc/generator/darkfish.rb index 26f545b14b..bd37b60668 100644 --- a/lib/rdoc/generator/darkfish.rb +++ b/lib/rdoc/generator/darkfish.rb @@ -58,6 +58,21 @@ class RDoc::Generator::Darkfish include ERB::Util ## + # Stylesheets, fonts, etc. that are included in RDoc. + + BUILTIN_STYLE_ITEMS = # :nodoc: + %w[ + fonts.css + fonts/Lato-Light.ttf + fonts/Lato-LightItalic.ttf + fonts/Lato-Regular.ttf + fonts/Lato-RegularItalic.ttf + fonts/SourceCodePro-Bold.ttf + fonts/SourceCodePro-Regular.ttf + rdoc.css + ] + + ## # Path to this file's parent directory. Used to find templates and other # resources. @@ -128,6 +143,11 @@ class RDoc::Generator::Darkfish attr_reader :store ## + # The directory where the template files live + + attr_reader :template_dir # :nodoc: + + ## # The output directory attr_reader :outputdir @@ -195,7 +215,13 @@ class RDoc::Generator::Darkfish debug_msg "Copying static files" options = { :verbose => $DEBUG_RDOC, :noop => @dry_run } - FileUtils.cp @template_dir + 'rdoc.css', '.', options + BUILTIN_STYLE_ITEMS.each do |item| + install_rdoc_static_file @template_dir + item, "./#{item}", options + end + + @options.template_stylesheets.each do |stylesheet| + FileUtils.cp stylesheet, '.', options + end Dir[(@template_dir + "{js,images}/**/*").to_s].each do |path| next if File.directory? path @@ -203,11 +229,7 @@ class RDoc::Generator::Darkfish dst = Pathname.new(path).relative_path_from @template_dir - # I suck at glob - dst_dir = dst.dirname - FileUtils.mkdir_p dst_dir, options unless File.exist? dst_dir - - FileUtils.cp @template_dir + path, dst, options + install_rdoc_static_file @template_dir + path, dst, options end end @@ -447,7 +469,7 @@ class RDoc::Generator::Darkfish ## # Generates the 404 page for the RDoc servlet - def generate_servlet_not_found path + def generate_servlet_not_found message setup template_file = @template_dir + 'servlet_not_found.rhtml' @@ -530,6 +552,23 @@ class RDoc::Generator::Darkfish raise error end + def install_rdoc_static_file source, destination, options # :nodoc: + return unless source.exist? + + begin + FileUtils.mkdir_p File.dirname(destination), options + + begin + FileUtils.ln source, destination, options + rescue Errno::EEXIST + FileUtils.rm destination + retry + end + rescue + FileUtils.cp source, destination, options + end + end + ## # Prepares for generation of output from the current directory diff --git a/lib/rdoc/generator/template/darkfish/_footer.rhtml b/lib/rdoc/generator/template/darkfish/_footer.rhtml index 0736c335ba..3d9526f02a 100644 --- a/lib/rdoc/generator/template/darkfish/_footer.rhtml +++ b/lib/rdoc/generator/template/darkfish/_footer.rhtml @@ -1,5 +1,5 @@ -<footer id="validator-badges"> - <p><a href="http://validator.w3.org/check/referer">[Validate]</a> - <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> <%= RDoc::VERSION %>. - <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> <%= RDoc::Generator::Darkfish::VERSION %>. +<footer id="validator-badges" role="contentinfo"> + <p><a href="http://validator.w3.org/check/referer">Validate</a> + <p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> <%= RDoc::VERSION %>. + <p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>. </footer> diff --git a/lib/rdoc/generator/template/darkfish/_head.rhtml b/lib/rdoc/generator/template/darkfish/_head.rhtml index f3d82a37f6..062160a751 100644 --- a/lib/rdoc/generator/template/darkfish/_head.rhtml +++ b/lib/rdoc/generator/template/darkfish/_head.rhtml @@ -1,16 +1,22 @@ -<meta content="text/html; charset=<%= @options.charset %>" http-equiv="Content-Type"> +<meta charset="<%= @options.charset %>"> <title><%= h @title %></title> -<link type="text/css" media="screen" href="<%= asset_rel_prefix %>/rdoc.css" rel="stylesheet"> +<link href="<%= asset_rel_prefix %>/fonts.css" rel="stylesheet"> +<link href="<%= asset_rel_prefix %>/rdoc.css" rel="stylesheet"> +<% if @options.template_stylesheets.flatten.any? then %> +<% @options.template_stylesheets.flatten.each do |stylesheet| %> +<link href="<%= asset_rel_prefix %>/<%= File.basename stylesheet %>" rel="stylesheet"> +<% end %> +<% end %> <script type="text/javascript"> var rdoc_rel_prefix = "<%= rel_prefix %>/"; </script> -<script type="text/javascript" charset="utf-8" src="<%= asset_rel_prefix %>/js/jquery.js"></script> -<script type="text/javascript" charset="utf-8" src="<%= asset_rel_prefix %>/js/navigation.js"></script> -<script type="text/javascript" charset="utf-8" src="<%= search_index_rel_prefix %>/js/search_index.js"></script> -<script type="text/javascript" charset="utf-8" src="<%= asset_rel_prefix %>/js/search.js"></script> -<script type="text/javascript" charset="utf-8" src="<%= asset_rel_prefix %>/js/searcher.js"></script> -<script type="text/javascript" charset="utf-8" src="<%= asset_rel_prefix %>/js/darkfish.js"></script> +<script src="<%= asset_rel_prefix %>/js/jquery.js"></script> +<script src="<%= asset_rel_prefix %>/js/navigation.js"></script> +<script src="<%= search_index_rel_prefix %>/js/search_index.js"></script> +<script src="<%= asset_rel_prefix %>/js/search.js"></script> +<script src="<%= asset_rel_prefix %>/js/searcher.js"></script> +<script src="<%= asset_rel_prefix %>/js/darkfish.js"></script> diff --git a/lib/rdoc/generator/template/darkfish/_sidebar_VCS_info.rhtml b/lib/rdoc/generator/template/darkfish/_sidebar_VCS_info.rhtml index 93d57f39f6..e889f8063d 100644 --- a/lib/rdoc/generator/template/darkfish/_sidebar_VCS_info.rhtml +++ b/lib/rdoc/generator/template/darkfish/_sidebar_VCS_info.rhtml @@ -1,6 +1,7 @@ <% if !svninfo.empty? then %> -<nav id="file-svninfo-section" class="section"> - <h3 class="section-header">VCS Info</h3> +<div id="file-svninfo-section" class="nav-section"> + <h3>VCS Info</h3> + <div class="section-body"> <dl class="svninfo"> <dt>Rev @@ -14,5 +15,5 @@ <dd><%= svninfo[:committer] %> </dl> </div> -</nav> +</div> <% end %> diff --git a/lib/rdoc/generator/template/darkfish/_sidebar_classes.rhtml b/lib/rdoc/generator/template/darkfish/_sidebar_classes.rhtml index efa202fa18..fe54d8339f 100644 --- a/lib/rdoc/generator/template/darkfish/_sidebar_classes.rhtml +++ b/lib/rdoc/generator/template/darkfish/_sidebar_classes.rhtml @@ -1,9 +1,9 @@ -<nav id="classindex-section" class="section project-section"> - <h3 class="section-header">Class and Module Index</h3> +<div id="classindex-section" class="nav-section"> + <h3>Class and Module Index</h3> <ul class="link-list"> <% @modsort.each do |index_klass| %> <li><a href="<%= rel_prefix %>/<%= index_klass.path %>"><%= index_klass.full_name %></a> <% end %> </ul> -</nav> +</div> diff --git a/lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml b/lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml index 19273829a0..2bd8efee99 100644 --- a/lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml +++ b/lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml @@ -1,7 +1,6 @@ <% unless klass.extends.empty? then %> -<!-- Extension Modules --> -<nav id="extends-section" class="section"> - <h3 class="section-header">Extended With Modules</h3> +<div id="extends-section" class="nav-section"> + <h3>Extended With Modules</h3> <ul class="link-list"> <% klass.each_extend do |ext| %> @@ -12,5 +11,5 @@ <% end %> <% end %> </ul> -</nav> +</div> <% end %> diff --git a/lib/rdoc/generator/template/darkfish/_sidebar_in_files.rhtml b/lib/rdoc/generator/template/darkfish/_sidebar_in_files.rhtml index 22be0c9b65..0ba1d2be80 100644 --- a/lib/rdoc/generator/template/darkfish/_sidebar_in_files.rhtml +++ b/lib/rdoc/generator/template/darkfish/_sidebar_in_files.rhtml @@ -1,8 +1,9 @@ -<nav id="file-list-section" class="section"> - <h3 class="section-header">Defined In</h3> +<div id="file-list-section" class="nav-section"> + <h3>Defined In</h3> + <ul> <% klass.in_files.each do |tl| %> <li><%= h tl.relative_name %> <% end %> </ul> -</nav> +</div> diff --git a/lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml b/lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml index 5494f1f5f8..d141098ecd 100644 --- a/lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml +++ b/lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml @@ -1,7 +1,6 @@ <% unless klass.includes.empty? then %> -<!-- Included Modules --> -<nav id="includes-section" class="section"> - <h3 class="section-header">Included Modules</h3> +<div id="includes-section" class="nav-section"> + <h3>Included Modules</h3> <ul class="link-list"> <% klass.each_include do |inc| %> @@ -12,5 +11,5 @@ <% end %> <% end %> </ul> -</nav> +</div> <% end %> diff --git a/lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml b/lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml index 45a3048e84..1285bfd732 100644 --- a/lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml +++ b/lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml @@ -1,8 +1,9 @@ -<nav id="home-section" class="section"> - <h3 class="section-header">Documentation</h3> +<div id="home-section" class="nav-section"> + <h3>Documentation</h3> <ul> - <% installed.each do |name, href, exists| %> + <% installed.each do |name, href, exists, type, _| %> + <% next if type == :extra %> <li class="folder"> <% if exists then %> <a href="<%= href %>"><%= h name %></a> @@ -11,4 +12,4 @@ <% end %> <% end %> </ul> -</nav> +</div> diff --git a/lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml b/lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml index 88e2734819..45df08d8fe 100644 --- a/lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml +++ b/lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml @@ -1,12 +1,12 @@ <% unless klass.method_list.empty? then %> <!-- Method Quickref --> -<nav id="method-list-section" class="section"> - <h3 class="section-header">Methods</h3> +<div id="method-list-section" class="nav-section"> + <h3>Methods</h3> - <ul class="link-list"> + <ul class="link-list" role="directory"> <% klass.each_method do |meth| %> <li <% if meth.calls_super %>class="calls-super" <% end %>><a href="#<%= meth.aref %>"><%= meth.singleton ? '::' : '#' %><%= h meth.name %></a> <% end %> </ul> -</nav> +</div> <% end %> diff --git a/lib/rdoc/generator/template/darkfish/_sidebar_navigation.rhtml b/lib/rdoc/generator/template/darkfish/_sidebar_navigation.rhtml index fdeb6aed9f..7b9c4f73b3 100644 --- a/lib/rdoc/generator/template/darkfish/_sidebar_navigation.rhtml +++ b/lib/rdoc/generator/template/darkfish/_sidebar_navigation.rhtml @@ -1,7 +1,11 @@ -<nav id="home-section" class="section"> - <h3 class="section-header"> - <a href="<%= rel_prefix %>/index.html">Home</a> +<div id="home-section" role="banner" class="nav-section"> + <h2> + <a href="<%= rel_prefix %>/index.html" rel="home">Home</a> + </h2> + + <h3> + <a href="<%= rel_prefix %>/table_of_contents.html#pages">Pages</a> <a href="<%= rel_prefix %>/table_of_contents.html#classes">Classes</a> <a href="<%= rel_prefix %>/table_of_contents.html#methods">Methods</a> </h3> -</nav> +</div> diff --git a/lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml b/lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml index 2089387c51..5f39825f08 100644 --- a/lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml +++ b/lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml @@ -1,12 +1,12 @@ <% simple_files = @files.select { |f| f.text? } %> <% unless simple_files.empty? then %> -<nav id="fileindex-section" class="section project-section"> - <h3 class="section-header">Pages</h3> +<div id="fileindex-section" class="nav-section"> + <h3>Pages</h3> - <ul> + <ul class="link-list"> <% simple_files.each do |f| %> - <li class="file"><a href="<%= rel_prefix %>/<%= f.path %>"><%= h f.page_name %></a> + <li><a href="<%= rel_prefix %>/<%= f.path %>"><%= h f.page_name %></a> <% end %> </ul> -</nav> +</div> <% end %> diff --git a/lib/rdoc/generator/template/darkfish/_sidebar_parent.rhtml b/lib/rdoc/generator/template/darkfish/_sidebar_parent.rhtml index 463f05a8d9..cc04852652 100644 --- a/lib/rdoc/generator/template/darkfish/_sidebar_parent.rhtml +++ b/lib/rdoc/generator/template/darkfish/_sidebar_parent.rhtml @@ -1,10 +1,11 @@ <% if klass.type == 'class' then %> -<nav id="parent-class-section" class="section"> - <h3 class="section-header">Parent</h3> +<div id="parent-class-section" class="nav-section"> + <h3>Parent</h3> + <% if klass.superclass and not String === klass.superclass then %> <p class="link"><a href="<%= klass.aref_to klass.superclass.path %>"><%= klass.superclass.full_name %></a> <% else %> <p class="link"><%= klass.superclass %> <% end %> -</nav> +</div> <% end %> diff --git a/lib/rdoc/generator/template/darkfish/_sidebar_search.rhtml b/lib/rdoc/generator/template/darkfish/_sidebar_search.rhtml index f3275783d0..4c1e1f7cc3 100644 --- a/lib/rdoc/generator/template/darkfish/_sidebar_search.rhtml +++ b/lib/rdoc/generator/template/darkfish/_sidebar_search.rhtml @@ -1,10 +1,15 @@ -<nav id="search-section" class="section project-section" class="initially-hidden"> +<div id="search-section" role="search" class="project-section initially-hidden"> <form action="#" method="get" accept-charset="utf-8"> - <h3 class="section-header"> - <input type="text" name="search" placeholder="Search" id="search-field" + <div id="search-field-wrapper"> + <input id="search-field" role="combobox" aria-label="Search" + aria-autocomplete="list" aria-controls="search-results" + type="text" name="search" placeholder="Search" title="Type to search, Up and Down to navigate, Enter to load"> - </h3> - </form> + </div> - <ul id="search-results" class="initially-hidden"></ul> -</nav> + <ul id="search-results" aria-label="Search Results" + aria-busy="false" aria-expanded="false" + aria-atomic="false" aria-live="polite" + aria-relevant="all" class="initially-hidden"></ul> + </form> +</div> diff --git a/lib/rdoc/generator/template/darkfish/_sidebar_sections.rhtml b/lib/rdoc/generator/template/darkfish/_sidebar_sections.rhtml index 726423a341..15ff78ba91 100644 --- a/lib/rdoc/generator/template/darkfish/_sidebar_sections.rhtml +++ b/lib/rdoc/generator/template/darkfish/_sidebar_sections.rhtml @@ -1,10 +1,11 @@ <% unless klass.sections.length == 1 then %> -<nav id="sections-section" class="section"> - <h3 class="section-header">Sections</h3> - <ul class="link-list"> +<div id="sections-section" class="nav-section"> + <h3>Sections</h3> + + <ul class="link-list" role="directory"> <% klass.sort_sections.each do |section| %> <li><a href="#<%= section.aref %>"><%= h section.title %></a></li> <% end %> </ul> -</nav> +</div> <% end %> diff --git a/lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml b/lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml index 7842625840..b58e6b3c61 100644 --- a/lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml +++ b/lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml @@ -6,14 +6,13 @@ table = current.parse(comment).table_of_contents if table.length > 1 then %> -<div id="table-of-contents"> - <nav class="section"> - <h3 class="section-header">Table of Contents</h3> - <ul> +<div class="nav-section"> + <h3>Table of Contents</h3> + + <ul class="link-list" role="directory"> <% table.each do |heading| %> - <li><a href="#<%= heading.aref %>"><%= heading.plain_html %></a> + <li><a href="#<%= heading.label current %>"><%= heading.plain_html %></a> <% end %> - </ul> - </nav> + </ul> </div> <% end %> diff --git a/lib/rdoc/generator/template/darkfish/class.rhtml b/lib/rdoc/generator/template/darkfish/class.rhtml index c7e52e6808..b497000112 100644 --- a/lib/rdoc/generator/template/darkfish/class.rhtml +++ b/lib/rdoc/generator/template/darkfish/class.rhtml @@ -1,16 +1,12 @@ -<body id="top" class="<%= klass.type %>"> -<nav id="metadata"> - <%= render '_sidebar_navigation.rhtml' %> - - <%= render '_sidebar_search.rhtml' %> +<body id="top" role="document" class="<%= klass.type %>"> +<nav role="navigation"> + <div id="project-navigation"> + <%= render '_sidebar_navigation.rhtml' %> + <%= render '_sidebar_search.rhtml' %> + </div> <%= render '_sidebar_table_of_contents.rhtml' %> - <div id="file-metadata"> - <%= render '_sidebar_in_files.rhtml' %> - <%= render '_sidebar_VCS_info.rhtml' %> - </div> - <div id="class-metadata"> <%= render '_sidebar_sections.rhtml' %> <%= render '_sidebar_parent.rhtml' %> @@ -18,52 +14,50 @@ <%= render '_sidebar_extends.rhtml' %> <%= render '_sidebar_methods.rhtml' %> </div> - - <div id="project-metadata"> - <%= render '_sidebar_pages.rhtml' %> - <%= render '_sidebar_classes.rhtml' %> - </div> </nav> -<div id="documentation"> - <h1 class="<%= klass.type %>"><%= klass.type %> <%= klass.full_name %></h1> +<main role="main" aria-labelledby="<%=h klass.aref %>"> + <h1 id="<%=h klass.aref %>" class="<%= klass.type %>"> + <%= klass.type %> <%= klass.full_name %> + </h1> - <div id="description" class="description"> + <section class="description"> <%= klass.description %> - </div><!-- description --> + </section> <% klass.each_section do |section, constants, attributes| %> <% constants = constants.select { |const| const.display? } %> <% attributes = attributes.select { |attr| attr.display? } %> <section id="<%= section.aref %>" class="documentation-section"> <% if section.title then %> - <div class="documentation-section-title"> - <h2 class="section-header"> + <header class="documentation-section-title"> + <h2> <%= section.title %> </h2> <span class="section-click-top"> <a href="#top">↑ top</a> </span> - </div> + </header> <% end %> <% if section.comment then %> - <div class="description"> + <div> <%= section.description %> </div> <% end %> <% unless constants.empty? then %> - <!-- Constants --> - <section id="constants-list" class="section"> - <h3 class="section-header">Constants</h3> + <section class="constants-list"> + <header> + <h3>Constants</h3> + </header> <dl> <% constants.each do |const| %> <dt id="<%= const.name %>"><%= const.name %> <% if const.comment then %> - <dd class="description"><%= const.description.strip %> + <dd><%= const.description.strip %> <% else %> - <dd class="description missing-docs">(Not documented) + <dd class="missing-docs">(Not documented) <% end %> <% end %> </dl> @@ -71,9 +65,10 @@ <% end %> <% unless attributes.empty? then %> - <!-- Attributes --> - <section id="attribute-method-details" class="method-section section"> - <h3 class="section-header">Attributes</h3> + <section class="attribute-method-details" class="method-section"> + <header> + <h3>Attributes</h3> + </header> <% attributes.each do |attrib| %> <div id="<%= attrib.aref %>" class="method-detail"> @@ -91,16 +86,17 @@ </div> </div> <% end %> - </section><!-- attribute-method-details --> + </section> <% end %> - <!-- Methods --> <% klass.methods_by_type(section).each do |type, visibilities| next if visibilities.empty? visibilities.each do |visibility, methods| next if methods.empty? %> - <section id="<%= visibility %>-<%= type %>-<%= section.aref %>-method-details" class="method-section section"> - <h3 class="section-header"><%= visibility.to_s.capitalize %> <%= type.capitalize %> Methods</h3> + <section id="<%= visibility %>-<%= type %>-<%= section.aref %>-method-details" class="method-section"> + <header> + <h3><%= visibility.to_s.capitalize %> <%= type.capitalize %> Methods</h3> + </header> <% methods.each do |method| %> <div id="<%= method.aref %>" class="method-detail <%= method.is_alias_for ? "method-alias" : '' %>"> @@ -146,7 +142,7 @@ <% if method.token_stream then %> <div class="method-source-code" id="<%= method.html_name %>-source"> <pre><%= method.markup_code %></pre> - </div><!-- <%= method.html_name %>-source --> + </div> <% end %> </div> @@ -167,13 +163,12 @@ Alias for: <a href="<%= klass.aref_to method.is_alias_for.path %>"><%= h method.is_alias_for.name %></a> </div> <% end %> - </div><!-- <%= method.html_name %>-method --> + </div> <% end %> - </section><!-- <%= visibility %>-<%= type %>-method-details --> + </section> <% end end %> - </section><!-- <%= section.aref %> --> + </section> <% end %> - -</div><!-- documentation --> +</main> diff --git a/lib/rdoc/generator/template/darkfish/fonts.css b/lib/rdoc/generator/template/darkfish/fonts.css new file mode 100644 index 0000000000..e9e721183b --- /dev/null +++ b/lib/rdoc/generator/template/darkfish/fonts.css @@ -0,0 +1,167 @@ +/* + * Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), + * with Reserved Font Name "Source". All Rights Reserved. Source is a + * trademark of Adobe Systems Incorporated in the United States and/or other + * countries. + * + * This Font Software is licensed under the SIL Open Font License, Version + * 1.1. + * + * This license is copied below, and is also available with a FAQ at: + * http://scripts.sil.org/OFL + */ + +@font-face { + font-family: "Source Code Pro"; + font-style: normal; + font-weight: 400; + src: local("Source Code Pro"), + local("SourceCodePro-Regular"), + url("fonts/SourceCodePro-Regular.ttf") format("truetype"); +} + +@font-face { + font-family: "Source Code Pro"; + font-style: normal; + font-weight: 700; + src: local("Source Code Pro Bold"), + local("SourceCodePro-Bold"), + url("fonts/SourceCodePro-Bold.ttf") format("truetype"); +} + +/* + * Copyright (c) 2010, Ćukasz Dziedzic (dziedzic@typoland.com), + * with Reserved Font Name Lato. + * + * This Font Software is licensed under the SIL Open Font License, Version + * 1.1. + * + * This license is copied below, and is also available with a FAQ at: + * http://scripts.sil.org/OFL + */ + +@font-face { + font-family: "Lato"; + font-style: normal; + font-weight: 300; + src: local("Lato Light"), + local("Lato-Light"), + url("fonts/Lato-Light.ttf") format("truetype"); +} + +@font-face { + font-family: "Lato"; + font-style: italic; + font-weight: 300; + src: local("Lato Light Italic"), + local("Lato-LightItalic"), + url("fonts/Lato-LightItalic.ttf") format("truetype"); +} + +@font-face { + font-family: "Lato"; + font-style: normal; + font-weight: 700; + src: local("Lato Regular"), + local("Lato-Regular"), + url("fonts/Lato-Regular.ttf") format("truetype"); +} + +@font-face { + font-family: "Lato"; + font-style: italic; + font-weight: 700; + src: local("Lato Italic"), + local("Lato-Italic"), + url("fonts/Lato-RegularItalic.ttf") format("truetype"); +} + +/* + * ----------------------------------------------------------- + * SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 + * ----------------------------------------------------------- + * + * PREAMBLE + * The goals of the Open Font License (OFL) are to stimulate worldwide + * development of collaborative font projects, to support the font creation + * efforts of academic and linguistic communities, and to provide a free and + * open framework in which fonts may be shared and improved in partnership + * with others. + * + * The OFL allows the licensed fonts to be used, studied, modified and + * redistributed freely as long as they are not sold by themselves. The + * fonts, including any derivative works, can be bundled, embedded, + * redistributed and/or sold with any software provided that any reserved + * names are not used by derivative works. The fonts and derivatives, + * however, cannot be released under any other type of license. The + * requirement for fonts to remain under this license does not apply + * to any document created using the fonts or their derivatives. + * + * DEFINITIONS + * "Font Software" refers to the set of files released by the Copyright + * Holder(s) under this license and clearly marked as such. This may + * include source files, build scripts and documentation. + * + * "Reserved Font Name" refers to any names specified as such after the + * copyright statement(s). + * + * "Original Version" refers to the collection of Font Software components as + * distributed by the Copyright Holder(s). + * + * "Modified Version" refers to any derivative made by adding to, deleting, + * or substituting -- in part or in whole -- any of the components of the + * Original Version, by changing formats or by porting the Font Software to a + * new environment. + * + * "Author" refers to any designer, engineer, programmer, technical + * writer or other person who contributed to the Font Software. + * + * PERMISSION & CONDITIONS + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of the Font Software, to use, study, copy, merge, embed, modify, + * redistribute, and sell modified and unmodified copies of the Font + * Software, subject to the following conditions: + * + * 1) Neither the Font Software nor any of its individual components, + * in Original or Modified Versions, may be sold by itself. + * + * 2) Original or Modified Versions of the Font Software may be bundled, + * redistributed and/or sold with any software, provided that each copy + * contains the above copyright notice and this license. These can be + * included either as stand-alone text files, human-readable headers or + * in the appropriate machine-readable metadata fields within text or + * binary files as long as those fields can be easily viewed by the user. + * + * 3) No Modified Version of the Font Software may use the Reserved Font + * Name(s) unless explicit written permission is granted by the corresponding + * Copyright Holder. This restriction only applies to the primary font name as + * presented to the users. + * + * 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font + * Software shall not be used to promote, endorse or advertise any + * Modified Version, except to acknowledge the contribution(s) of the + * Copyright Holder(s) and the Author(s) or with their explicit written + * permission. + * + * 5) The Font Software, modified or unmodified, in part or in whole, + * must be distributed entirely under this license, and must not be + * distributed under any other license. The requirement for fonts to + * remain under this license does not apply to any document created + * using the Font Software. + * + * TERMINATION + * This license becomes null and void if any of the above conditions are + * not met. + * + * DISCLAIMER + * THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT + * OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL + * DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM + * OTHER DEALINGS IN THE FONT SOFTWARE. + */ + diff --git a/lib/rdoc/generator/template/darkfish/fonts/Lato-Light.ttf b/lib/rdoc/generator/template/darkfish/fonts/Lato-Light.ttf Binary files differnew file mode 100644 index 0000000000..b49dd43729 --- /dev/null +++ b/lib/rdoc/generator/template/darkfish/fonts/Lato-Light.ttf diff --git a/lib/rdoc/generator/template/darkfish/fonts/Lato-LightItalic.ttf b/lib/rdoc/generator/template/darkfish/fonts/Lato-LightItalic.ttf Binary files differnew file mode 100644 index 0000000000..7959fef075 --- /dev/null +++ b/lib/rdoc/generator/template/darkfish/fonts/Lato-LightItalic.ttf diff --git a/lib/rdoc/generator/template/darkfish/fonts/Lato-Regular.ttf b/lib/rdoc/generator/template/darkfish/fonts/Lato-Regular.ttf Binary files differnew file mode 100644 index 0000000000..839cd589dc --- /dev/null +++ b/lib/rdoc/generator/template/darkfish/fonts/Lato-Regular.ttf diff --git a/lib/rdoc/generator/template/darkfish/fonts/Lato-RegularItalic.ttf b/lib/rdoc/generator/template/darkfish/fonts/Lato-RegularItalic.ttf Binary files differnew file mode 100644 index 0000000000..bababa09e3 --- /dev/null +++ b/lib/rdoc/generator/template/darkfish/fonts/Lato-RegularItalic.ttf diff --git a/lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Bold.ttf b/lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Bold.ttf Binary files differnew file mode 100644 index 0000000000..61e3090c1c --- /dev/null +++ b/lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Bold.ttf diff --git a/lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Regular.ttf b/lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Regular.ttf Binary files differnew file mode 100644 index 0000000000..85686d967d --- /dev/null +++ b/lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Regular.ttf diff --git a/lib/rdoc/generator/template/darkfish/index.rhtml b/lib/rdoc/generator/template/darkfish/index.rhtml index d076c2a252..7d1c74807b 100644 --- a/lib/rdoc/generator/template/darkfish/index.rhtml +++ b/lib/rdoc/generator/template/darkfish/index.rhtml @@ -1,8 +1,10 @@ -<body> -<nav id="metadata"> - <%= render '_sidebar_navigation.rhtml' %> +<body id="top" role="document" class="file"> +<nav role="navigation"> + <div id="project-navigation"> + <%= render '_sidebar_navigation.rhtml' %> - <%= render '_sidebar_search.rhtml' %> + <%= render '_sidebar_search.rhtml' %> + </div> <div id="project-metadata"> <%= render '_sidebar_pages.rhtml' %> @@ -10,10 +12,12 @@ </div> </nav> -<div id="documentation" class="description"> -<% if @options.main_page && main_page = @files.find { |f| f.full_name == @options.main_page } then %> +<main role="main"> +<% if @options.main_page and + main_page = @files.find { |f| f.full_name == @options.main_page } then %> <%= main_page.description %> <% else %> <p>This is the API documentation for <%= @title %>. <% end %> -</div> +</main> + diff --git a/lib/rdoc/generator/template/darkfish/js/darkfish.js b/lib/rdoc/generator/template/darkfish/js/darkfish.js index f26fd45d3a..06fef3b215 100644 --- a/lib/rdoc/generator/template/darkfish/js/darkfish.js +++ b/lib/rdoc/generator/template/darkfish/js/darkfish.js @@ -52,20 +52,6 @@ function hookDebuggingToggle() { $('#debugging-toggle img').click( toggleDebuggingSection ); }; -function hookTableOfContentsToggle() { - $('.indexpage li .toc-toggle').each( function() { - $(this).click( function() { - $(this).toggleClass('open'); - }); - - var section = $(this).next(); - - $(this).click( function() { - section.slideToggle(); - }); - }); -} - function hookSearch() { var input = $('#search-field').eq(0); var result = $('#search-results').eq(0); @@ -149,7 +135,6 @@ $(document).ready( function() { hookDebuggingToggle(); hookSearch(); highlightLocationTarget(); - hookTableOfContentsToggle(); $('ul.link-list a').bind( "click", highlightClickTarget ); }); diff --git a/lib/rdoc/generator/template/darkfish/js/search.js b/lib/rdoc/generator/template/darkfish/js/search.js index dbdfdcbc4c..563ed7e54e 100644 --- a/lib/rdoc/generator/template/darkfish/js/search.js +++ b/lib/rdoc/generator/template/darkfish/js/search.js @@ -39,9 +39,12 @@ Search.prototype = $.extend({}, Navigation, new function() { if (value == '') { this.lastQuery = value; this.$result.empty(); + this.$result.attr('aria-expanded', 'false'); this.setNavigationActive(false); } else if (value != this.lastQuery) { this.lastQuery = value; + this.$result.attr('aria-busy', 'true'); + this.$result.attr('aria-expanded', 'true'); this.firstRun = true; this.searcher.find(value); } @@ -55,23 +58,28 @@ Search.prototype = $.extend({}, Navigation, new function() { } for (var i=0, l = results.length; i < l; i++) { - target.appendChild(this.renderItem.call(this, results[i])); + var item = this.renderItem.call(this, results[i]); + item.setAttribute('id', 'search-result-' + target.childElementCount); + target.appendChild(item); }; if (this.firstRun && results.length > 0) { this.firstRun = false; this.$current = $(target.firstChild); - this.$current.addClass('current'); + this.$current.addClass('search-selected'); } if (jQuery.browser.msie) this.$element[0].className += ''; + + if (isLast) this.$result.attr('aria-busy', 'false'); } this.move = function(isDown) { if (!this.$current) return; var $next = this.$current[isDown ? 'next' : 'prev'](); if ($next.length) { - this.$current.removeClass('current'); - $next.addClass('current'); + this.$current.removeClass('search-selected'); + $next.addClass('search-selected'); + this.$input.attr('aria-activedescendant', $next.attr('id')); this.scrollIntoView($next[0], this.$view[0]); this.$current = $next; } diff --git a/lib/rdoc/generator/template/darkfish/page.rhtml b/lib/rdoc/generator/template/darkfish/page.rhtml index 942172919b..4a6b006bb3 100644 --- a/lib/rdoc/generator/template/darkfish/page.rhtml +++ b/lib/rdoc/generator/template/darkfish/page.rhtml @@ -1,18 +1,18 @@ -<body class="file"> -<nav id="metadata"> - <%= render '_sidebar_navigation.rhtml' %> - - <%= render '_sidebar_search.rhtml' %> +<body id="top" role="document" class="file"> +<nav role="navigation"> + <div id="project-navigation"> + <%= render '_sidebar_navigation.rhtml' %> + <%= render '_sidebar_search.rhtml' %> + </div> <%= render '_sidebar_table_of_contents.rhtml' %> <div id="project-metadata"> <%= render '_sidebar_pages.rhtml' %> - <%= render '_sidebar_classes.rhtml' %> </div> </nav> -<div id="documentation" class="description"> - <%= file.description %> -</div> +<main role="main" aria-label="Page <%=h file.full_name%>"> +<%= file.description %> +</main> diff --git a/lib/rdoc/generator/template/darkfish/rdoc.css b/lib/rdoc/generator/template/darkfish/rdoc.css index 35207033de..f86edb8367 100644 --- a/lib/rdoc/generator/template/darkfish/rdoc.css +++ b/lib/rdoc/generator/template/darkfish/rdoc.css @@ -12,21 +12,10 @@ * { padding: 0; margin: 0; } body { - background: #efefef; - font: 14px "Helvetica Neue", Helvetica, Tahoma, sans-serif; - margin-left: 40px; + background: #fafafa; + font-family: Lato, sans-serif; + font-weight: 300; } -body.file-popup { - font-size: 90%; - margin-left: 0; -} - -h1 { - font-size: 300%; - text-shadow: rgba(135,145,135,0.65) 2px 2px 3px; - color: #6C8C22; -} -h2,h3,h4 { margin-top: 1.5em; } h1 span, h2 span, @@ -36,7 +25,7 @@ h5 span, h6 span { display: none; padding-left: 1em; - font-size: 50%; + font-size: 10px; vertical-align: super; } @@ -54,24 +43,15 @@ h6:hover span { color: #6C8C22; text-decoration: none; } + :link:hover, :visited:hover { border-bottom: 1px dotted #6C8C22; } +code, pre { - background: #ddd; - padding: 0.5em 0; -} - -blockquote { - background: #ddd; - margin: 1em; - padding: 0.25em; -} - -blockquote > :first-child { - margin-top: 0 !important; + font-family: "Source Code Pro", Monaco, monospace; } /* @group Generic Classes */ @@ -82,10 +62,13 @@ blockquote > :first-child { #search-field { width: 98%; - background: #eee; + background: white; border: none; height: 1.5em; -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + text-align: left; } #search-field:focus { background: #f1edba; @@ -121,44 +104,31 @@ blockquote > :first-child { /* @end */ /* @group Index Page, Standalone file pages */ -.indexpage ul { - line-height: 160%; +.table-of-contents ul { + margin: 1em; list-style: none; } -.indexpage ul :link, -.indexpage ul :visited { - font-size: 16px; -} -.indexpage li { - padding-left: 20px; +.table-of-contents ul ul { + margin-top: 0.25em; } -.indexpage ul > li { - background: url(images/bullet_black.png) no-repeat left 4px; -} -.indexpage li.method { - background: url(images/plugin.png) no-repeat left 4px; -} -.indexpage li.module { - background: url(images/package.png) no-repeat left 4px; -} -.indexpage li.class { - background: url(images/ruby.png) no-repeat left 4px; -} -.indexpage li.file { - background: url(images/page_white_text.png) no-repeat left 4px; +.table-of-contents ul :link, +.table-of-contents ul :visited { + font-size: 16px; } -.indexpage li li { - background: url(images/tag_blue.png) no-repeat left 4px; + +.table-of-contents li { + margin-bottom: 0.25em; } -.indexpage li .toc-toggle { + +.table-of-contents li .toc-toggle { width: 16px; height: 16px; background: url(images/add.png) no-repeat; } -.indexpage li .toc-toggle.open { +.table-of-contents li .toc-toggle.open { background: url(images/delete.png) no-repeat; } @@ -166,14 +136,32 @@ blockquote > :first-child { /* @group Top-Level Structure */ -#metadata { +nav { float: left; width: 260px; + font-family: Helvetica, sans-serif; + font-size: 14px; } -#documentation { - margin: 2em 1em 5em 300px; +main { + display: block; + margin: 0 2em 5em 260px; + padding-left: 20px; min-width: 340px; + font-size: 16px; +} + +main h1, +main h2, +main h3, +main h4, +main h5, +main h6 { + font-family: Helvetica, sans-serif; +} + +.table-of-contents main { + margin-left: 2em; } #validator-badges { @@ -184,67 +172,68 @@ blockquote > :first-child { /* @end */ -/* @group Metadata Section */ -#metadata .section { - background-color: #dedede; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - border: 1px solid #aaa; - margin: 0 8px 8px; +/* @group navigation */ +nav { + margin-bottom: 1em; +} + +nav .nav-section { + margin-top: 2em; + border-top: 2px solid #aaa; font-size: 90%; overflow: hidden; } -#metadata h3.section-header { + +nav h2 { margin: 0; - padding: 2px 8px; - background: #ccc; - color: #666; - -moz-border-radius-topleft: 4px; - -moz-border-radius-topright: 4px; - -webkit-border-top-left-radius: 4px; - -webkit-border-top-right-radius: 4px; - border-bottom: 1px solid #aaa; -} -#metadata #home-section h3.section-header { - border-bottom: 0; + padding: 2px 8px 2px 8px; + background-color: #e8e8e8; + color: #555; + font-size: 125%; + text-align: center; } -#metadata ul, -#metadata dl, -#metadata p { - padding: 8px; - list-style: none; +nav h3 { + margin: 0; + padding: 2px 8px 2px 8px; + text-align: right; + background-color: #e8e8e8; + color: #555; } -#file-metadata { - margin-top: 2em; +nav ul, +nav dl, +nav p { + padding: 4px 8px 0; + list-style: none; } -#file-metadata ul { - padding-left: 28px; - list-style-image: url(images/page_green.png); +#project-navigation .nav-section { + margin: 0; + border-top: 0; } -#table-of-contents { - margin-top: 2em; +#home-section h2, +#home-section h3 { + text-align: center; } -#table-of-contents ul { - padding-left: 28px; - list-style-image: url(images/tag_blue.png); +#search-section { + margin-top: 0; + border-top: 0; } -dl.svninfo { - color: #666; - margin: 0; -} -dl.svninfo dt { - font-weight: bold; +#search-field-wrapper { + border-top: 1px solid #aaa; + border-bottom: 1px solid #aaa; + padding: 3px 8px; + background-color: #e8e8e8; + color: #555; } ul.link-list li { white-space: nowrap; - line-height: 20px; + line-height: 1.4em; } ul.link-list .type { @@ -262,100 +251,119 @@ ul.link-list .type { /* @end */ -/* @group Class Metadata Section */ -#class-metadata { - margin-top: 2em; +/* @group Documentation Section */ +main { + color: #333; } -/* @end */ -/* @group Project Metadata Section */ -#project-metadata { - margin-top: 2em; +main > h1:first-child, +main > h2:first-child, +main > h3:first-child, +main > h4:first-child, +main > h5:first-child, +main > h6:first-child { + margin-top: 0px; } -#project-metadata .section { - border: 1px solid #aaa; +main sup { + vertical-align: super; + font-size: 0.8em; } -#project-metadata h3.section-header { - border-bottom: 1px solid #aaa; - position: relative; + +/* The heading with the class name */ +main h1[class] { + margin-top: 0; + margin-bottom: 1em; + font-size: 2em; + color: #6C8C22; } -#project-metadata form { - color: #777; - background: #ccc; +main h1 { + margin: 2em 0 0.5em; + font-size: 1.7em; } -/* @end */ +main h2 { + margin: 2em 0 0.5em; + font-size: 1.5em; +} -/* @group Documentation Section */ -.description { - font-size: 100%; - color: #333; +main h3 { + margin: 2em 0 0.5em; + font-size: 1.2em; } -.description p { - margin: 1em 0.4em; +main h4 { + margin: 2em 0 0.5em; + font-size: 1.1em; } -.description li p { - margin: 0; +main h5 { + margin: 2em 0 0.5em; + font-size: 1em; } -.description ol, -.description ul { - margin-left: 1.5em; +main h6 { + margin: 2em 0 0.5em; + font-size: 1em; } -.description ol li, -.description ul li { + +main p { + margin: 0 0 0.5em; line-height: 1.4em; } -.note-list { - margin: 8px 0; +main pre { + margin: 1.2em 0.5em; + padding: 1em; + font-size: 0.8em; } -.label-list { - margin: 8px 1.5em; - border: 1px solid #ccc; +main hr { + margin: 1.5em 1em; + border: 2px solid #ddd; } -.description .label-list { - font-size: 14px; + +main blockquote { + margin: 0 2em 1.2em 1.2em; + padding-left: 0.5em; + border-left: 2px solid #ddd; } -.note-list dt { - font-weight: bold; +main ol, +main ul { + margin: 1em 2em; } -.note-list dd { - padding: 0 12px; + +main li > p { + margin-bottom: 0.5em; } -.label-list dt { - padding: 2px 4px; - font-weight: bold; - background: #ddd; +main dl { + margin: 1em 0.5em; } -.label-list dd { - padding: 2px 12px; + +main dt { + margin-bottom: 0.5em; + font-weight: bold; } -.label-list dd + dt, -.note-list dd + dt { - margin-top: 0.7em; + +main dd { + margin: 0 1em 1em 0.5em; } -#documentation .section { - font-size: 90%; +main header h2 { + margin-top: 2em; + border-width: 0; + border-top: 4px solid #bbb; + font-size: 130%; } -#documentation h2.section-header { - margin-top: 1em; - padding: 0.25em 0.5em; - background: #ccc; - color: #333; - font-size: 175%; - border: 1px solid #bbb; - -moz-border-radius: 3px; - -webkit-border-radius: 3px; +main header h3 { + margin: 2em 0 1.5em; + border-width: 0; + border-top: 3px solid #bbb; + font-size: 120%; } .documentation-section-title { @@ -364,47 +372,35 @@ ul.link-list .type { .documentation-section-title .section-click-top { position: absolute; top: 6px; - right: 12px; + left: 12px; font-size: 10px; color: #9b9877; visibility: hidden; - padding-right: 0.5px; + padding-left: 0.5px; } .documentation-section-title:hover .section-click-top { visibility: visible; } -#documentation h3.section-header { - margin-top: 1em; - padding: 0.25em 0.5em; - background-color: #dedede; - color: #333; - font-size: 150%; - border: 1px solid #bbb; - -moz-border-radius: 3px; - -webkit-border-radius: 3px; -} - -#constants-list > dl, -#attributes-list > dl { +.constants-list > dl { margin: 1em 0 2em; border: 0; } -#constants-list > dl dt, -#attributes-list > dl dt { + +.constants-list > dl dt { + margin-bottom: 0.75em; padding-left: 0; - font-weight: bold; - font-family: Monaco, "Andale Mono"; - background: inherit; + font-family: "Source Code Pro", Monaco, monospace; + font-size: 110%; } -#constants-list > dl dt a, -#attributes-list > dl dt a { + +.constants-list > dl dt a { color: inherit; } -#constants-list > dl dd, -#attributes-list > dl dd { - margin: 0 0 1em 0; + +.constants-list > dl dd { + margin: 0 0 2em 0; padding: 0; color: #666; } @@ -428,93 +424,77 @@ ul.link-list .type { /* @group Method Details */ -#documentation .method-source-code { +main .method-source-code { display: none; } -#documentation .method-description .method-calls-super { +main .method-description .method-calls-super { color: #333; - font-weight: bolder; + font-weight: bold; } -#documentation .method-detail { - margin: 0.5em 0; - padding: 0.5em 0; +main .method-detail { + margin-bottom: 2.5em; cursor: pointer; } -#documentation .method-detail:hover { - background-color: #f1edba; + +main .method-detail:target { + margin-left: -10px; + border-left: 10px solid #f1edba; } -#documentation .method-heading { + +main .method-heading { position: relative; - padding: 2px 4px 0 20px; - font-size: 125%; + font-family: "Source Code Pro", Monaco, monospace; + font-size: 110%; font-weight: bold; color: #333; - background: url(images/brick.png) no-repeat left bottom; } -#documentation .method-heading :link, -#documentation .method-heading :visited { +main .method-heading :link, +main .method-heading :visited { color: inherit; } -#documentation .method-click-advice { +main .method-click-advice { position: absolute; top: 2px; right: 5px; - font-size: 10px; + font-size: 12px; color: #9b9877; visibility: hidden; padding-right: 20px; line-height: 20px; background: url(images/zoom.png) no-repeat right top; } -#documentation .method-heading:hover .method-click-advice { +main .method-heading:hover .method-click-advice { visibility: visible; } -#documentation .method-alias .method-heading { - color: #666; - background: url(images/brick_link.png) no-repeat left bottom; -} - -#documentation .method-description, -#documentation .aliases { - margin: 0 20px; +main .method-alias .method-heading { color: #666; } -#documentation .method-description p, -#documentation .aliases p { - line-height: 1.2em; +main .method-description, +main .aliases { + margin-top: 0.75em; + color: #333; } -#documentation .aliases { +main .aliases { padding-top: 4px; font-style: italic; cursor: default; } -#documentation .method-description p { - margin-bottom: 0.5em; -} -#documentation .method-description ul { +main .method-description ul { margin-left: 1.5em; } -pre { - margin: 0.5em 0; -} -#documentation .attribute-method-heading { - background: url(images/tag_green.png) no-repeat left bottom; -} -#documentation #attribute-method-details .method-detail:hover { +main #attribute-method-details .method-detail:hover { background-color: transparent; cursor: default; } -#documentation .attribute-access-type { - font-size: 60%; +main .attribute-access-type { text-transform: uppercase; - vertical-align: super; - padding: 0 2px; + padding: 0 1em; } /* @end */ @@ -523,15 +503,12 @@ pre { /* @group Source Code */ pre { - overflow: auto; - background: #262626; - color: white; + margin: 0.5em 0; border: 1px dashed #999; padding: 0.5em; -} - -.description pre { - margin: 0 0.4em; + background: #262626; + color: white; + overflow: auto; } .ruby-constant { color: #7fffd4; background: transparent; } @@ -540,7 +517,7 @@ pre { .ruby-operator { color: #00ffee; background: transparent; } .ruby-identifier { color: #ffdead; background: transparent; } .ruby-node { color: #ffa07a; background: transparent; } -.ruby-comment { color: #dc0000; font-weight: bold; background: transparent; } +.ruby-comment { color: #dc0000; background: transparent; } .ruby-regexp { color: #ffa07a; background: transparent; } .ruby-value { color: #7fffd4; background: transparent; } @@ -548,23 +525,24 @@ pre { /* @group search results */ -#search-results h1 { - font-size: 1em; +#search-results { + font-family: Lato, sans-serif; + font-weight: 300; +} + +#search-results .search-match { + font-family: Helvetica, sans-serif; font-weight: normal; - text-shadow: none; } -#search-results .current { - background: #ccc; +#search-results .search-selected { + background: #e8e8e8; border-bottom: 1px solid transparent; } #search-results li { list-style: none; border-bottom: 1px solid #aaa; - -moz-border-radius: 4px; - -webkit-border-radius: 4px; - border-radius: 4px; margin-bottom: 0.5em; } @@ -589,6 +567,7 @@ pre { #search-results pre { margin: 0.5em; + font-family: "Source Code Pro", Monaco, monospace; } /* @end */ diff --git a/lib/rdoc/generator/template/darkfish/servlet_not_found.rhtml b/lib/rdoc/generator/template/darkfish/servlet_not_found.rhtml index 24c9ba8eaa..f0841572c3 100644 --- a/lib/rdoc/generator/template/darkfish/servlet_not_found.rhtml +++ b/lib/rdoc/generator/template/darkfish/servlet_not_found.rhtml @@ -1,5 +1,5 @@ -<body> -<nav id="metadata"> +<body role="document"> +<nav role="navigation"> <%= render '_sidebar_navigation.rhtml' %> <%= render '_sidebar_search.rhtml' %> @@ -10,9 +10,9 @@ </div> </nav> -<div id="documentation" class="description"> +<main role="main"> <h1>Not Found</h1> - <p>The page <kbd><%=h path %></kbd> was not found -</div> + <p><%= message %> +</main> diff --git a/lib/rdoc/generator/template/darkfish/servlet_root.rhtml b/lib/rdoc/generator/template/darkfish/servlet_root.rhtml index 63b4ee8ff7..3a33659aea 100644 --- a/lib/rdoc/generator/template/darkfish/servlet_root.rhtml +++ b/lib/rdoc/generator/template/darkfish/servlet_root.rhtml @@ -1,16 +1,43 @@ -<body> -<nav id="metadata"> -<%= render '_sidebar_search.rhtml' %> +<body role="document"> +<nav role="navigation"> + <div id="project-navigation"> + <div id="home-section" class="nav-section"> + <h2> + <a href="<%= rel_prefix %>/" rel="home">Home</a> + </h2> + </div> + + <%= render '_sidebar_search.rhtml' %> + </div> <%= render '_sidebar_installed.rhtml' %> </nav> -<div id="documentation" class="description"> +<main role="main"> <h1>Local RDoc Documentation</h1> <p>Here you can browse local documentation from the ruby standard library and your installed gems. +<% extra_dirs = installed.select { |_, _, _, type,| type == :extra } %> +<% unless extra_dirs.empty? %> + <h2>Extra Documentation Directories</h2> + + <p>The following additional documentation directories are available:</p> + + <ol> + <% extra_dirs.each do |name, href, exists, _, path| %> + <li> + <% if exists %> + <a href="<%= href %>"><%= h name %></a> (<%= h path %>) + <% else %> + <%= h name %> (<%= h path %>; <i>not available</i>) + <% end %> + </li> + <% end %> + </ol> +<% end %> + <% gems = installed.select { |_, _, _, type,| type == :gem } %> <% missing = gems.reject { |_, _, exists,| exists } %> <% unless missing.empty? then %> @@ -32,6 +59,5 @@ <% end %> </ul> <% end %> - -</div> +</main> diff --git a/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml b/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml index bebff40f6a..7ff1a9e93e 100644 --- a/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml +++ b/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml @@ -1,9 +1,10 @@ -<body class="indexpage"> -<h1><%= h @title %></h1> +<body id="top" class="table-of-contents"> +<main role="main"> +<h1 class="class"><%= h @title %></h1> <% simple_files = @files.select { |f| f.text? } %> <% unless simple_files.empty? then %> -<h2>Pages</h2> +<h2 id="pages">Pages</h2> <ul> <% simple_files.sort.each do |file| %> <li class="file"> @@ -12,8 +13,7 @@ # HACK table_of_contents should not exist on Document table = file.parse(file.comment).table_of_contents unless table.empty? then %> - <img class="toc-toggle" src="images/transparent.png" alt="" title="toggle headings"> - <ul class="initially-hidden"> + <ul> <% table.each do |heading| %> <li><a href="<%= file.path %>#<%= heading.aref %>"><%= heading.plain_html %></a> <% end %> @@ -24,7 +24,7 @@ </ul> <% end %> -<h2 id="classes">Classes/Modules</h2> +<h2 id="classes">Classes and Modules</h2> <ul> <% @modsort.each do |klass| %> <li class="<%= klass.type %>"> @@ -34,22 +34,25 @@ table.concat klass.section_contents unless table.empty? then %> - <img class="toc-toggle" src="images/transparent.png" alt="" title="toggle headings"> - <ul class="initially-hidden"> + <ul> <% table.each do |item| %> <li><a href="<%= klass.path %>#<%= item.aref %>"><%= item.plain_html %></a> <% end %> </ul> <% end %> </li> - <% end %> +<% end %> </ul> <h2 id="methods">Methods</h2> <ul> - <% @store.all_classes_and_modules.map do |mod| - mod.method_list - end.flatten.sort.each do |method| %> - <li class="method"><a href="<%= method.path %>"><%= method.pretty_name %> — <%= method.parent.full_name %></a> - <% end %> +<% @store.all_classes_and_modules.map do |mod| + mod.method_list + end.flatten.sort.each do |method| %> + <li class="method"> + <a href="<%= method.path %>"><%= h method.pretty_name %></a> + — + <span class="container"><%= method.parent.full_name %></span> +<% end %> </ul> +</main> |