Skip to content

Commit d1f4319

Browse files
committed
link to documentation
1 parent 4ce975b commit d1f4319

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

config.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,13 @@ def asciinema_video(id, speed: 1)
7070
|</div>
7171
HTML
7272
end
73+
74+
def rspec_documentation
75+
hash = Hash.new { |h,k| h[k] = [] }
76+
Dir["#{root}/source/documentation/*/*"].each do |dir|
77+
version, gem = dir.scan(%r{/source/documentation/([^/]+)/([^/]+)}).first.flatten
78+
hash[gem] << version
79+
end
80+
hash
81+
end
7382
end

source/documentation.html.slim

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,13 @@ section
1717
h2 API Documentation
1818

1919
p
20-
| You can find detailed API documentation on the Rubydoc.info site:
20+
| You can find detailed API documentation for versions below
2121

2222
ul
23-
li= link_to 'http://rubydoc.info/gems/rspec-core', 'http://rubydoc.info/gems/rspec-core'
24-
li= link_to 'http://rubydoc.info/gems/rspec-expectations', 'http://rubydoc.info/gems/rspec-expectations'
25-
li= link_to 'http://rubydoc.info/gems/rspec-mocks', 'http://rubydoc.info/gems/rspec-mocks'
26-
li= link_to 'http://rubydoc.info/gems/rspec-rails', 'http://rubydoc.info/gems/rspec-rails'
23+
- rspec_documentation.each do |gem, versions|
24+
li
25+
b
26+
| #{gem}:&nbsp;
27+
- versions.sort.reverse.each do |version|
28+
= link_to version, "/documentation/#{version}/#{gem}/"
29+
| &nbsp;

0 commit comments

Comments
 (0)