Skip to content

Commit ed4be0a

Browse files
committed
explains why links are gsub'ed, and changes the regexp delimiters
1 parent e6f15f0 commit ed4be0a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Rakefile

+4-1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ RDoc::Task.new do |rdoc|
6161
# The temporary solution is to have a README.rdoc without backslashes for
6262
# GitHub, and gsub it to generate the main page of the API.
6363
#
64+
# Also, relative links in GitHub have to point to blobs, whereas in the API
65+
# they need to point to files.
66+
#
6467
# The idea for the future is to have totally different files, since the
6568
# API is no longer a generic entry point to Rails and deserves a
6669
# dedicated main page specifically thought as an API entry point.
@@ -71,7 +74,7 @@ RDoc::Task.new do |rdoc|
7174
# since no autolinking happens there and RDoc displays the backslash
7275
# otherwise.
7376
rdoc_main.gsub!(/^(?=\S).*?\b(?=Rails)\b/) { "#$&\\" }
74-
rdoc_main.gsub!(/link:blob\/master\/(\w+)\/README.rdoc/, "link:files/\\1/README_rdoc.html")
77+
rdoc_main.gsub!(%r{link:blob/master/(\w+)/README\.rdoc}, "link:files/\\1/README_rdoc.html")
7578

7679
File.open(RDOC_MAIN, 'w') do |f|
7780
f.write(rdoc_main)

0 commit comments

Comments
 (0)