\HeaderA{parse\_Rd}{Parse an Rd file}{parse.Rul.Rd}
\keyword{utilities}{parse\_Rd}
\keyword{documentation}{parse\_Rd}
\begin{Description}\relax
This function reads an R documentation (Rd) file and parses it, for
processing by other functions.

It is \bold{experimental}.
\end{Description}
\begin{Usage}
\begin{verbatim}
parse_Rd(file, srcfile = NULL, encoding = "unknown", verbose = FALSE)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{file}] A filename or text-mode connection.  At present filenames
work best.
\item[\code{srcfile}] \code{NULL}, or a \code{"srcfile"} object.  See the
\sQuote{Details} section.
\item[\code{encoding}] Encoding to be assumed for input strings.
\item[\code{verbose}] Logical indicating whether detailed parsing
information should be printed.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
This experimental function parses Rd files according to the
specification given in
\url{http://developer.r-project.org/parseRd.pdf}.  At the current
writing, this is not identical to the rules used by other tools:  it
is somewhat stricter.
\end{Details}
\begin{Value}
An object of class \code{"Rd"}.  The internal format of this object is 
subject to change.

At present files which are marked as Latin-1 or UTF-8 or where
\code{encoding} has one of those values result in text marked in the
encoding. In a non-UTF-8 MBCS locale the result will be marked as
UTF-8.  In all other cases files are assumed to be in the native encoding.
\end{Value}
\begin{Section}{Warning}
These functions are still experimental.  Names, interfaces and values
might change in future versions.
\end{Section}
\begin{Author}\relax
Duncan Murdoch
\end{Author}
\begin{References}\relax
\url{http://developer.r-project.org/parseRd.pdf}
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{Rd2HTML}{Rd2HTML}}.

\code{\LinkA{Rd\_parse}{Rd.Rul.parse}}, the function used for parsing 
Rd files by \command{R CMD check}.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
baseRd <- Rd_db("base")
con <- textConnection(baseRd[[1]], "rt")
parse_Rd(con)
close(con)
\end{ExampleCode}
\end{Examples}

