sdoc 2.0.3 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test.yml +38 -0
  3. data/.gitignore +1 -0
  4. data/CHANGELOG.md +42 -6
  5. data/Gemfile +8 -2
  6. data/README.md +14 -4
  7. data/Rakefile +54 -2
  8. data/config.ru +3 -3
  9. data/lib/rdoc/generator/template/rails/_context.rhtml +16 -8
  10. data/lib/rdoc/generator/template/rails/_head.rhtml +14 -39
  11. data/lib/rdoc/generator/template/rails/_panel.rhtml +6 -3
  12. data/lib/rdoc/generator/template/rails/class.rhtml +5 -2
  13. data/lib/rdoc/generator/template/rails/file.rhtml +5 -2
  14. data/lib/rdoc/generator/template/rails/index.rhtml +7 -7
  15. data/lib/rdoc/generator/template/rails/resources/css/main.css +33 -6
  16. data/lib/rdoc/generator/template/rails/resources/css/panel.css +123 -6
  17. data/lib/rdoc/generator/template/rails/resources/css/reset.css +0 -1
  18. data/lib/rdoc/generator/template/rails/resources/js/main.js +17 -0
  19. data/lib/rdoc/generator/template/rails/resources/js/searchdoc.js +14 -17
  20. data/lib/rdoc/generator/template/rails/search_index.rhtml +6 -2
  21. data/lib/rdoc/generator/template/sdoc/_context.rhtml +11 -3
  22. data/lib/rdoc/generator/template/sdoc/class.rhtml +5 -6
  23. data/lib/rdoc/generator/template/sdoc/file.rhtml +5 -6
  24. data/lib/rdoc/generator/template/sdoc/index.rhtml +3 -4
  25. data/lib/rdoc/generator/template/sdoc/resources/css/reset.css +0 -1
  26. data/lib/rdoc/generator/template/sdoc/resources/js/searchdoc.js +0 -10
  27. data/lib/rdoc/generator/template/sdoc/resources/panel/index.html +2 -1
  28. data/lib/rdoc/generator/template/sdoc/search_index.rhtml +6 -2
  29. data/lib/sdoc/generator.rb +3 -3
  30. data/lib/sdoc/merge.rb +5 -28
  31. data/lib/sdoc/templatable.rb +1 -1
  32. data/lib/sdoc/version.rb +1 -1
  33. data/netlify.toml +39 -0
  34. data/sdoc.gemspec +1 -3
  35. data/spec/helpers_spec.rb +2 -2
  36. data/spec/rdoc_generator_spec.rb +9 -9
  37. metadata +13 -21
  38. data/.travis.yml +0 -31
  39. data/lib/rdoc/generator/template/merge/index.rhtml +0 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 234ba541d36b61d2b4bb680ab8df4e2463d4cc63f0517f160270a3e7a48f0f81
4
- data.tar.gz: afae81f60c7f9218da174c06cb4d5799f7c0db8e5188c6dc49c54ea3bacb5dc3
3
+ metadata.gz: 70eb2edc18b9ea26f3e275f9e7cbe89b1ce69af8c94fe4e0757ade7d39585d65
4
+ data.tar.gz: 9358e5e14fc3e26fd5c39f9ff348c4e5ee0cf569921256de2234006b5055ff68
5
5
  SHA512:
6
- metadata.gz: 3b24a3309f283113f8b0f0cd1e2e0d7711a40a293612599499f09b6d6793f25669e9aa0f9925ef9d844a31a89be30f296fdd8f47d3161a8f24629d5d2f41b99c
7
- data.tar.gz: f5355d4fd9d7aa0478db5c6aa398502c1480ece246f811b795721471e15eddc74dafe7640cca5de2e32751a65d5fcea0d156933aa2eabc691d1daba222428fdd
6
+ metadata.gz: d001cb3198db3cdd7db808a56d7c06325d126a73b93de6240e1826abc6a0b7ad7743b21b67e289289ed35346192164e44900702191def749a5c22ec833f39569
7
+ data.tar.gz: 731ad61d0e0ac791e02050d173cc97eab604634c3e9252ed691d2714142b97c0e7f19a30fa9eddda56516fc2e3f46f7d393f0c36d3a3aaad49c28dddcbbca14c
@@ -0,0 +1,38 @@
1
+ name: Tests
2
+
3
+ on:
4
+ push:
5
+ schedule:
6
+ - cron: '0 0 * * *'
7
+
8
+ jobs:
9
+ test:
10
+ runs-on: ubuntu-20.04
11
+ strategy:
12
+ matrix:
13
+ ruby:
14
+ - '2.1'
15
+ - '2.2'
16
+ - '2.3'
17
+ - '2.4'
18
+ - '2.5'
19
+ - '2.6'
20
+ - '2.7'
21
+ - '3.0'
22
+ - 'ruby-head'
23
+ - 'jruby-head'
24
+ - 'truffleruby-head'
25
+
26
+ steps:
27
+ - uses: actions/checkout@v1
28
+
29
+ - name: Set up Ruby
30
+ uses: ruby/setup-ruby@v1
31
+ with:
32
+ ruby-version: ${{ matrix.ruby }}
33
+ bundler-cache: true
34
+ cache-version: 1
35
+
36
+ - name: Test
37
+ run: |
38
+ bundle exec rake
data/.gitignore CHANGED
@@ -7,3 +7,4 @@ Gemfile.lock
7
7
  /.rake_tasks~
8
8
  /*.gem
9
9
  /rails/
10
+ /ruby/
data/CHANGELOG.md CHANGED
@@ -1,7 +1,44 @@
1
+ Master
2
+ ======
3
+
4
+ 2.3.0
5
+ =====
6
+
7
+ * #178 Don't use rdoc 6.4.0 for now [@p8](https://github.com/p8)
8
+ * #177 Remove rake version constraint for ruby head [@p8](https://github.com/p8)
9
+ * #176 Make sidepanel work with relative paths/URLs [@p8](https://github.com/p8)
10
+ * #175 Avoid displaying source toggler for ghost methods [Robin Dupret](https://github.com/robin850)
11
+ * #174 Suppress unused variable warnings [Masataka Pocke Kuwabara](https://github.com/pocke)
12
+
13
+ 2.2.0
14
+ =====
15
+
16
+ * #161 Add 'skip to content' link and improve shortcut keys [@MikeRogers0](https://github.com/MikeRogers0)
17
+ * #170 Fix link hovers in headings [@tlatsas](https://github.com/tlatsas)
18
+ * #169 Fix clearing search results [@mikdiet](https://github.com/mikdiet)
19
+ * #167 Update Merge script to work with sdoc v2 [@mikdiet](https://github.com/mikdiet)
20
+ * #160 Remove outline from reset stylesheet [@p8](https://github.com/p8)
21
+ * #159 Remove TAB override in panel [@p8](https://github.com/p8)
22
+ * #157 Move to GitHub action for tests [@MikeRogers0](https://github.com/MikeRogers0)
23
+ * #155 Fix Ctrl+C copying [Jan Schär](https://github.com/jscissr)
24
+
25
+ 2.1.0
26
+ =====
27
+
28
+ * #154 Make panel responsive for mobile [@MikeRogers0](https://github.com/MikeRogers0) and [@p8](https://github.com/p8)
29
+ * #153 Add viewport metatag to views for improved Lighthouse score. [@MikeRogers0](https://github.com/MikeRogers0)
30
+ * #150 Use semantic headers for better SEO [@p8](https://github.com/p8)
31
+
32
+ 2.0.4
33
+ =====
34
+
35
+ * #149 Using HTML5 doctype accross all HTML files. [@MikeRogers0](https://github.com/MikeRogers0)
36
+ * #148 Fix overflow CSS property of panel elements. [@cveneziani](https://github.com/cveneziani)
37
+
1
38
  2.0.3
2
39
  =====
3
40
 
4
- * Use @options.title for the index
41
+ * #147 Use @options.title for the index [@p8](https://github.com/p8)
5
42
 
6
43
  2.0.2
7
44
  =====
@@ -11,14 +48,14 @@
11
48
  2.0.1
12
49
  =====
13
50
 
14
- * #142 Fix arrow icons for selected panel items
15
- * #141 Always use only one metatag for keywords
16
- * #140 Use h2 instead of h1 for banner header
51
+ * #142 Fix arrow icons for selected panel items [@p8](https://github.com/p8)
52
+ * #141 Always use only one metatag for keywords [@p8](https://github.com/p8)
53
+ * #140 Use h2 instead of h1 for banner header [@p8](https://github.com/p8)
17
54
 
18
55
  2.0.0
19
56
  =====
20
57
 
21
- * #137 Replace frames based implementation with a css
58
+ * #137 Replace frames based implementation with a css [@p8](https://github.com/p8)
22
59
  * #132 Deprecate safe_level of ERB.new in Ruby 2.6
23
60
 
24
61
  1.1.0
@@ -78,4 +115,3 @@ Bug Fixes
78
115
  [Compare v0.3.20...v0.4.0](https://github.com/voloko/sdoc/compare/v0.3.20...v0.4.0)
79
116
 
80
117
  No friendly log for this version yet, but PRs are welcome!
81
-
data/Gemfile CHANGED
@@ -2,9 +2,15 @@ source "https://rubygems.org"
2
2
 
3
3
  gemspec
4
4
 
5
- gem "rake", "< 11"
6
- gem "minitest"
5
+ gem "rack"
6
+ gem "rake"
7
7
  gem "hoe"
8
+ gem "minitest"
9
+
10
+
11
+ if RUBY_VERSION.to_f <= 2.5
12
+ gem "psych", "< 4.0"
13
+ end
8
14
 
9
15
  if ENV["rdoc"] == "master"
10
16
  gem "rdoc", :github => "ruby/rdoc"
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # SDoc
2
2
 
3
- [![Build Status](https://travis-ci.org/zzak/sdoc.svg?branch=master)](https://travis-ci.org/zzak/sdoc)
3
+ [![Tests](https://github.com/zzak/sdoc/actions/workflows/test.yml/badge.svg)](https://github.com/zzak/sdoc/actions/workflows/test.yml)
4
4
 
5
5
  **Powering http://api.rubyonrails.org/**
6
6
 
@@ -92,15 +92,25 @@ As maintainer of both projects, I'll see if I can identify the root of the cause
92
92
 
93
93
  ## Contributing
94
94
 
95
- If you'd like to contribute you can generate the Rails documentation by running:
95
+ If you'd like to contribute you can generate the Rails main branch documentation by running:
96
96
 
97
97
  ```bash
98
98
  rake test:rails
99
99
  ```
100
100
 
101
- This task will generate documentation for the Rails master branch.
102
- Since the task doesn't do any file filtering it contains a lot of extra pages.
101
+ You can generate the Ruby default branch documentation by running:
103
102
 
103
+ ```bash
104
+ rake test:ruby
105
+ ```
106
+
107
+ You can generate merged Rails and Ruby documentation by running:
108
+
109
+ ```bash
110
+ rake test:merged
111
+ ```
112
+
113
+ The generated documentation will be put into `doc/public` directory.
104
114
  To view the just generated documentation start up a rack application by running:
105
115
 
106
116
  ```bash
data/Rakefile CHANGED
@@ -12,22 +12,74 @@ task :default => :test
12
12
  task :spec => :test
13
13
 
14
14
  require 'sdoc'
15
+ require 'sdoc/merge'
15
16
  require 'rdoc/task'
16
17
 
17
18
  rails = File.expand_path "rails"
19
+ ruby = File.expand_path "ruby"
18
20
 
19
21
  directory rails do
20
22
  sh "git clone --depth=1 https://github.com/rails/rails"
21
23
  end
22
24
 
25
+ directory ruby do
26
+ sh "git clone --depth=1 https://github.com/ruby/ruby"
27
+ end
28
+
23
29
  namespace :test do
24
- task :rails => rails
30
+ desc 'Deletes all generated test documentation'
31
+ task :reset_docs do
32
+ FileUtils.remove_dir(File.expand_path('doc'), force: true)
33
+ end
34
+
35
+ desc 'Generates test rails documentation'
36
+ task :rails => [rails, :generate_rails] do
37
+ FileUtils.mv(
38
+ File.expand_path('doc/rails'),
39
+ File.expand_path('doc/public')
40
+ )
41
+ end
25
42
 
26
- RDoc::Task.new(:rails) do |rdoc|
43
+ RDoc::Task.new(:generate_rails) do |rdoc|
27
44
  rdoc.rdoc_dir = 'doc/rails'
28
45
  rdoc.generator = 'sdoc'
29
46
  rdoc.template = 'rails'
47
+ rdoc.title = 'Ruby on Rails'
48
+ rdoc.main = 'rails/README.md'
49
+ rdoc.options << '--exclude=test'
30
50
 
31
51
  rdoc.rdoc_files.include("rails/")
32
52
  end
53
+
54
+ desc 'Generates test ruby documentation'
55
+ task :ruby => [ruby, :generate_ruby] do
56
+ FileUtils.mv(
57
+ File.expand_path('doc/ruby'),
58
+ File.expand_path('doc/public')
59
+ )
60
+ end
61
+
62
+ RDoc::Task.new(:generate_ruby) do |rdoc|
63
+ rdoc.rdoc_dir = 'doc/ruby'
64
+ rdoc.generator = 'sdoc'
65
+ rdoc.template = 'rails'
66
+ rdoc.title = 'Ruby'
67
+ rdoc.main = 'ruby/README.md'
68
+
69
+ rdoc.rdoc_files.include("ruby/")
70
+ end
71
+
72
+ desc 'Generates merged test documentation'
73
+ task :merged => [rails, :generate_rails, ruby, :generate_ruby, :merge]
74
+
75
+ task :merge do
76
+ SDoc::Merge.new.merge(
77
+ [
78
+ '--title', 'Rails + Ruby',
79
+ '--op', 'doc/public',
80
+ '--names', 'rails, ruby',
81
+ 'doc/rails', 'doc/ruby'
82
+ ]
83
+ )
84
+ end
33
85
  end
data/config.ru CHANGED
@@ -5,7 +5,7 @@
5
5
  #
6
6
  require 'bundler/setup'
7
7
 
8
- root = "doc/rails"
8
+ root = "doc/public"
9
9
  unless Dir.exists?(root)
10
10
  puts <<~MESSAGE
11
11
  Could not find any docs in #{root}.
@@ -16,12 +16,12 @@ unless Dir.exists?(root)
16
16
  end
17
17
 
18
18
  use Rack::Static,
19
- :urls => ["/files", "/images", "/js", "/css", "/panel", "/i", "/classes"],
19
+ :urls => ["/files", "/images", "/js", "/css", "/panel", "/i", "/classes", "/ruby", "/rails"],
20
20
  :root => root
21
21
  run lambda { |env|
22
22
  [
23
23
  200,
24
- {
24
+ {
25
25
  'Content-Type' => 'text/html',
26
26
  'Cache-Control' => 'public, max-age=86400'
27
27
  },
@@ -101,7 +101,7 @@
101
101
 
102
102
  <% unless constants.empty? %>
103
103
  <!-- Section constants -->
104
- <div class="sectiontitle">Constants</div>
104
+ <h2 class="sectiontitle">Constants</h2>
105
105
  <table border='0' cellpadding='5'>
106
106
  <% constants.each do |const| %>
107
107
  <tr valign='top'>
@@ -122,7 +122,7 @@
122
122
 
123
123
  <% unless attributes.empty? %>
124
124
  <!-- Section attributes -->
125
- <div class="sectiontitle">Attributes</div>
125
+ <h2 class="sectiontitle">Attributes</h2>
126
126
  <table border='0' cellpadding='5'>
127
127
  <% attributes.each do |attrib| %>
128
128
  <tr valign='top'>
@@ -145,17 +145,17 @@
145
145
  visibilities.each do |visibility, methods|
146
146
  next if methods.empty?
147
147
  %>
148
- <div class="sectiontitle"><%= type.capitalize %> <%= visibility.to_s.capitalize %> methods</div>
148
+ <h2 class="sectiontitle"><%= type.capitalize %> <%= visibility.to_s.capitalize %> methods</h2>
149
149
  <% methods.each do |method| %>
150
150
  <div class="method">
151
- <div class="title method-title" id="<%= method.aref %>">
151
+ <h3 class="title method-title" id="<%= method.aref %>">
152
152
  <% if method.call_seq %>
153
153
  <b><%= method.call_seq.gsub(/->/, '&rarr;').gsub(/\n(.)/, '<br />\1') %></b>
154
154
  <% else %>
155
155
  <b><%= h method.name %></b><%= h method.params %>
156
156
  <% end %>
157
157
  <a href="<%= "#{rel_prefix}/#{context.path}##{method.aref}"%>" name="<%= method.aref %>" class="permalink">Link</a>
158
- </div>
158
+ </h3>
159
159
 
160
160
  <% if method.comment %>
161
161
  <div class="description">
@@ -195,12 +195,20 @@
195
195
  else
196
196
  false
197
197
  end
198
+
199
+ ghost = method.instance_of?(RDoc::GhostMethod)
198
200
  %>
199
201
  <p class="source-link">
200
- Source:
201
- <a href="javascript:toggleSource('<%= method.aref %>_source')" id="l_<%= method.aref %>_source">show</a>
202
+ <% if !ghost || github %> Source: <% end %>
203
+
204
+ <% unless ghost %>
205
+ <a href="javascript:toggleSource('<%= method.aref %>_source')" id="l_<%= method.aref %>_source">show</a>
206
+ <% end %>
207
+
208
+ <% if !ghost && github %> | <% end %>
209
+
202
210
  <% if github %>
203
- | <a href="<%= "#{github}#L#{line}" %>" target="_blank" class="github_url">on GitHub</a>
211
+ <a href="<%= "#{github}#L#{line}" %>" target="_blank" class="github_url">on GitHub</a>
204
212
  <% end %>
205
213
  </p>
206
214
  <div id="<%= method.aref %>_source" class="dyn-source">
@@ -1,39 +1,14 @@
1
- <%
2
- # Turbolinks does not consider relative urls similar, resulting in page
3
- # reloads and losing the context of the panel. Emptying the rel_prefix makes
4
- # asset paths absolute. This breaks opening the docs locally. Maybe all
5
- # generated docs should be in the same folder?
6
- rel_prefix = ''
7
- %>
8
- <link rel="stylesheet" href="<%= "#{rel_prefix}/css/reset.css" %>" type="text/css" media="screen" data-turbolinks-track="reload" />
9
- <link rel="stylesheet" href="<%= "#{rel_prefix}/css/panel.css" %>" type="text/css" media="screen" data-turbolinks-track="reload" />
10
- <link rel="stylesheet" href="<%= "#{rel_prefix}/css/main.css" %>" type="text/css" media="screen" data-turbolinks-track="reload" />
11
- <link rel="stylesheet" href="<%= "#{rel_prefix}/css/github.css" %>" type="text/css" media="screen" data-turbolinks-track="reload" />
12
- <script src="<%= "#{rel_prefix}/js/jquery-3.5.1.min.js" %>" type="text/javascript" charset="utf-8" data-turbolinks-track="reload"></script>
13
- <script src="<%= "#{rel_prefix}/js/main.js" %>" type="text/javascript" charset="utf-8" data-turbolinks-track="reload"></script>
14
- <script src="<%= "#{rel_prefix}/js/highlight.pack.js" %>" type="text/javascript" charset="utf-8" data-turbolinks-track="reload"></script>
15
- <script src="<%= rel_prefix %>/js/turbolinks.js" type="text/javascript" charset="utf-8" data-turbolinks-track="reload"></script>
16
- <script src="<%= rel_prefix %>/js/search_index.js" type="text/javascript" charset="utf-8" data-turbolinks-track="reload"></script>
17
- <script src="<%= rel_prefix %>/js/searcher.js" type="text/javascript" charset="utf-8" data-turbolinks-track="reload"></script>
18
- <script src="<%= rel_prefix %>/panel/tree.js" type="text/javascript" charset="utf-8" data-turbolinks-track="reload"></script>
19
- <script src="<%= rel_prefix %>/js/searchdoc.js" type="text/javascript" charset="utf-8" data-turbolinks-track="reload"></script>
20
- <script type="text/javascript" charset="utf-8">
21
- document.addEventListener("turbolinks:load", function() {
22
- // Only initialize panel if not yet initialized
23
- if(!$('#panel .tree ul li').length) {
24
- $('#links').hide();
25
- var panel = new Searchdoc.Panel($('#panel'), search_data, tree, '<%= rel_prefix %>/');
26
- $('#search').focus();
27
- var s = window.location.search.match(/\?q=([^&]+)/);
28
- if (s) {
29
- s = decodeURIComponent(s[1]).replace(/\+/g, ' ');
30
- if (s.length > 0) {
31
- $('#search').val(s);
32
- panel.search(s, true);
33
- }
34
- }
35
- panel.toggle(<%= tree_keys %>);
36
- }
37
- })
38
- </script>
39
-
1
+ <link rel="stylesheet" href="<%= rel_prefix %>/css/reset.css" type="text/css" media="screen" />
2
+ <link rel="stylesheet" href="<%= rel_prefix %>/css/panel.css" type="text/css" media="screen" />
3
+ <link rel="stylesheet" href="<%= rel_prefix %>/css/main.css" type="text/css" media="screen" />
4
+ <link rel="stylesheet" href="<%= rel_prefix %>/css/github.css" type="text/css" media="screen" />
5
+ <script src="<%= rel_prefix %>/js/jquery-3.5.1.min.js" type="text/javascript" charset="utf-8"></script>
6
+ <script src="<%= rel_prefix %>/js/main.js" type="text/javascript" charset="utf-8"></script>
7
+ <script src="<%= rel_prefix %>/js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>
8
+ <script src="<%= rel_prefix %>/js/turbolinks.js" type="text/javascript" charset="utf-8"></script>
9
+ <script src="<%= rel_prefix %>/js/search_index.js" type="text/javascript" charset="utf-8"></script>
10
+ <script src="<%= rel_prefix %>/js/searcher.js" type="text/javascript" charset="utf-8"></script>
11
+ <script src="<%= rel_prefix %>/panel/tree.js" type="text/javascript" charset="utf-8"></script>
12
+ <script src="<%= rel_prefix %>/js/searchdoc.js" type="text/javascript" charset="utf-8"></script>
13
+ <meta name="data-rel-prefix" content="<%= rel_prefix %>/">
14
+ <meta name="data-tree-keys" content='<%= tree_keys %>'>
@@ -1,6 +1,9 @@
1
- <div class="panel panel_tree" id="panel" data-turbolinks-permanent>
1
+ <input type="checkbox" id="hamburger" class="panel_checkbox">
2
+ <label class="panel_mobile_button" for="hamburger"><span></span> Menu</label>
3
+ <nav class="panel panel_tree" id="panel" data-turbolinks-permanent>
2
4
  <div class="header">
3
- <input type="text" placeholder="Search for a class, method, ..." autosave="searchdoc" results="10" id="search" autocomplete="off" />
5
+ <input type="text" placeholder="Search (/) for a class, method, ..." autosave="searchdoc" results="10" id="search" autocomplete="off" tabindex="-1" />
6
+ <label class="panel_mobile_button_close" for="hamburger"><span></span> Close</label>
4
7
  </div>
5
8
  <div class="tree">
6
9
  <ul>
@@ -11,4 +14,4 @@
11
14
  </ul>
12
15
  </div>
13
16
  <a href="links.html" id="links">index</a>
14
- </div>
17
+ </nav>
@@ -3,6 +3,7 @@
3
3
  <head>
4
4
  <title><%= h klass.full_name %></title>
5
5
  <meta charset="<%= @options.charset %>" />
6
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
7
  <%= include_template '_head.rhtml', {:rel_prefix => rel_prefix, :tree_keys => klass.full_name.split('::') } %>
7
8
 
8
9
  <meta property="og:title" value="<%= klass.full_name %>">
@@ -17,6 +18,8 @@
17
18
  </head>
18
19
 
19
20
  <body>
21
+ <a class="sr-only sr-only-focusable" href="#content" data-turbolinks="false">Skip to Content</a>
22
+ <a class="sr-only sr-only-focusable" href="#search" data-turbolinks="false">Skip to Search</a>
20
23
 
21
24
  <%= include_template '_panel.rhtml' %>
22
25
 
@@ -44,8 +47,8 @@
44
47
  </ul>
45
48
  </div>
46
49
 
47
- <div id="bodyContent">
50
+ <main id="bodyContent">
48
51
  <%= include_template '_context.rhtml', {:context => klass, :rel_prefix => rel_prefix} %>
49
- </div>
52
+ </main>
50
53
  </body>
51
54
  </html>
@@ -3,10 +3,13 @@
3
3
  <head>
4
4
  <title><%= h file.name %></title>
5
5
  <meta charset="<%= @options.charset %>" />
6
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
7
  <%= include_template '_head.rhtml', {:rel_prefix => rel_prefix, :tree_keys => [] } %>
7
8
  </head>
8
9
 
9
10
  <body>
11
+ <a class="sr-only sr-only-focusable" href="#content" data-turbolinks="false">Skip to Content</a>
12
+ <a class="sr-only sr-only-focusable" href="#search" data-turbolinks="false">Skip to Search</a>
10
13
 
11
14
  <%= include_template '_panel.rhtml' %>
12
15
 
@@ -31,8 +34,8 @@
31
34
  </ul>
32
35
  </div>
33
36
 
34
- <div id="bodyContent">
37
+ <main id="bodyContent">
35
38
  <%= include_template '_context.rhtml', {:context => file, :rel_prefix => rel_prefix} %>
36
- </div>
39
+ </main>
37
40
  </body>
38
41
  </html>
@@ -1,14 +1,15 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
1
+ <!DOCTYPE html>
2
+ <html lang="en">
5
3
  <head>
6
4
  <title><%= @options.title %></title>
7
5
  <meta http-equiv="Content-Type" content="text/html; charset=<%= @options.charset %>" />
6
+ <meta name="viewport" content="width=device-width,initial-scale=1">
8
7
  <%= include_template '_head.rhtml', {:rel_prefix => rel_prefix, tree_keys: []} %>
9
8
  </head>
10
9
 
11
10
  <body>
11
+ <a class="sr-only sr-only-focusable" href="#content" data-turbolinks="false">Skip to Content</a>
12
+ <a class="sr-only sr-only-focusable" href="#search" data-turbolinks="false">Skip to Search</a>
12
13
 
13
14
  <%= include_template '_panel.rhtml' %>
14
15
 
@@ -25,9 +26,8 @@
25
26
  </ul>
26
27
  </div>
27
28
 
28
- <div id="bodyContent">
29
+ <main id="bodyContent">
29
30
  <%= include_template '_context.rhtml', {:context => index } %>
30
- </div>
31
+ </main>
31
32
  </body>
32
33
  </html>
33
-
@@ -7,8 +7,10 @@ body {
7
7
  line-height: 1.25em;
8
8
  }
9
9
 
10
- .banner, #bodyContent {
11
- margin-left: 300px;
10
+ @media (min-width: 40em) {
11
+ .banner, #bodyContent {
12
+ margin-left: 300px;
13
+ }
12
14
  }
13
15
 
14
16
  a:link, a:active, a:visited, a:hover {
@@ -29,10 +31,6 @@ h1 a, h2 a, .banner a {
29
31
  color: #fff;
30
32
  }
31
33
 
32
- h1 a:hover, h2 a:hover {
33
- color: #fff;
34
- }
35
-
36
34
  p {
37
35
  margin-bottom: 1em;
38
36
  text-align: justify;
@@ -376,3 +374,32 @@ p code {
376
374
  margin-bottom: 1px;
377
375
  padding: 0 5px;
378
376
  }
377
+
378
+ .sr-only {
379
+ position: absolute;
380
+ width: 1px;
381
+ height: 1px;
382
+ padding: 0;
383
+ overflow: hidden;
384
+ clip: rect(0,0,0,0);
385
+ white-space: nowrap;
386
+ border: 0;
387
+ }
388
+ .sr-only-focusable:active,
389
+ .sr-only-focusable:focus {
390
+ position: fixed;
391
+ top: 10%;
392
+ width: auto;
393
+ height: auto;
394
+ overflow: visible;
395
+ clip: auto;
396
+ white-space: normal;
397
+ padding: 2rem;
398
+ border: 4px solid #990000;
399
+ border-radius: 1rem;
400
+ box-shadow: 0 0.5rem 1rem rgb(0 0 0 / 15%) !important;
401
+ left: 40%;
402
+ z-index: 100;
403
+ background: #fff;
404
+ font-size: 2rem;
405
+ }