To solve the problem of links being broken in GitHub for the sake of api site, have them replaced at runtime during rdoc generation

This commit is contained in:
Vijay Dev
2011-06-18 23:45:59 +05:30
parent 2fbb7504e2
commit 96c57d4bd0
2 changed files with 3 additions and 2 deletions

View File

@@ -71,6 +71,7 @@ RDoc::Task.new do |rdoc|
# since no autolinking happens there and RDoc displays the backslash
# otherwise.
rdoc_main.gsub!(/^(?=\S).*?\b(?=Rails)\b/) { "#$&\\" }
rdoc_main.gsub!(/link:blob\/master\/(\w+)\/README.rdoc/, "link:files/\\1/README_rdoc.html")
File.open(RDOC_MAIN, 'w') do |f|
f.write(rdoc_main)