detect request for R Markdown using tools::file_ext