r-lib / roxygen2

Generate R package documentation from inline R comments
https://roxygen2.r-lib.org
Other
592 stars 232 forks source link

Error in markdown_rparse(markdown_tags[[xml_name(xml)]](xml), markdown_tags = markdown_tags) : attempt to apply non-function #700

Closed tbates closed 6 years ago

tbates commented 6 years ago

Added @md tag to an existing oxygen function help, and got this error when making package

Updating umx documentation
Loading umx
For an overview type '?umx'
Error in markdown_rparse(markdown_tags[[xml_name(xml)]](xml), markdown_tags = markdown_tags) : 
  attempt to apply non-function

The offending chunk of #' code appears to be:

#' \figure{GxE.png}

Be nice to either handle this as oxygen code, or give a more informative error ("naked \figure{} code found on line 48. Replace this with a markdown link?) (or whatever the actual user response should be)

cheers, t

hadley commented 6 years ago

I can't reproduce the problem:

>     roc_proc_text(rd_roclet(), "
+     #' Title
+     #' 
+     #' \figure{GxE.png}
+     #' @md
+     foo <- function() {}")[[1]]
% Generated by roxygen2: do not edit by hand
% Please edit documentation in RtmpKkPvRp/filed0e9299cea9f
\name{foo}
\alias{foo}
\title{Title}
\usage{
foo()
}
\description{
igure{GxE.png}
}