https://github.com/cran/fda
Raw File
Tip revision: 5ca4d55c0461c5af2aaa199a986677bb62c33273 authored by J. O. Ramsay on 03 November 2009, 00:00:00 UTC
version 2.2.0
Tip revision: 5ca4d55
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