% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/topic.R
\name{topic_rd_path}
\alias{topic_rd_path}
\title{Get the path to the Rd file for a topic}
\usage{
topic_rd_path(topic, package)
}
\arguments{
\item{topic}{A single string.}

\item{package}{A package name, or a path to the source directory of a
package.}
}
\value{
The path to a \code{.Rd} file, or \code{NULL} if the package or topic
doesn't exist, or if the package doesn't have Rd files on disk.
}
\description{
Returns the path to the \code{.Rd} file that documents \code{topic}. Rd files only
exist on disk for source and in-development packages; installed packages
store their documentation in a binary database, so \code{topic_rd_path()}
returns \code{NULL} for them. Use \code{\link[=topic_rd]{topic_rd()}} if you want the parsed contents
regardless of where they are stored.
}
\examples{
# Rd files only exist on disk for source packages, so make a minimal one
pkg <- tempfile()
dir.create(file.path(pkg, "man"), recursive = TRUE)
writeLines("Package: demo", file.path(pkg, "DESCRIPTION"))
writeLines(
  c("\\\\name{foo}", "\\\\alias{foo}", "\\\\title{Foo}", "\\\\description{Foo.}"),
  file.path(pkg, "man", "foo.Rd")
)

topic_rd_path("foo", pkg)
}
