https://github.com/cran/fda
Revision 6565ab631c5ce969b5964df159080bcbea9087a7 authored by J. O. Ramsay on 13 April 2007, 00:00:00 UTC, committed by Gabor Csardi on 13 April 2007, 00:00:00 UTC
1 parent f53803b
Raw File
Tip revision: 6565ab631c5ce969b5964df159080bcbea9087a7 authored by J. O. Ramsay on 13 April 2007, 00:00:00 UTC
version 1.1.8
Tip revision: 6565ab6
add-links.rb

Dir["*/*.[rR]d"].each do |path|
  puts path
  file = File.new(path, "r")

  update = file.read.gsub(/\\seealso\{(.*?)\}/smi) do
    "\\seealso{\n" +
    $1.gsub("\n","").split(/[\, ]+/).map{|f| "\\code{\\link{#{f}}}"}.join(", \n") +
    "\n}"
  end
  
  file.close

  file = File.new(path, "w")
  file.write update
  file.close
  
end
back to top