rr-markdownctags

Does utils::rtags() work for code in Rmarkdown files?


I am trying to using utils::rtags() to build indexes for R code.

This works fine for *.R files as such.

I have not been able to get it to work for code in Rmarkdown files (*.Rmd).

With the proper pattern argument, it finds the files fine, but seems to completely ignore the code they contain. An empty 'TAGS' file is created. For example:

utils::rtags(pattern='[.]Rmd$', ofile='TAGS', type='etags')

Am I expecting too much?


Solution

  • The short answer is "No, utils::rtags() does not understand rmarkdown files."

    But, https://ctags.io/ may (soon?) provide an alternative solution.

    h/t @masatake-yamato (https://stackoverflow.com/users/6386727/masatake-yamato)