File: use_readme_rmd.Rd

package info (click to toggle)
r-cran-usethis 3.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,228 kB
  • sloc: sh: 26; makefile: 17; cpp: 6; ansic: 3
file content (50 lines) | stat: -rw-r--r-- 1,986 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/readme.R
\name{use_readme_rmd}
\alias{use_readme_rmd}
\alias{use_readme_md}
\title{Create README files}
\usage{
use_readme_rmd(open = rlang::is_interactive())

use_readme_md(open = rlang::is_interactive())
}
\arguments{
\item{open}{Open the newly created file for editing? Happens in RStudio, if
applicable, or via \code{\link[utils:file.edit]{utils::file.edit()}} otherwise.}
}
\description{
Creates skeleton README files with possible stubs for
\itemize{
\item a high-level description of the project/package and its goals
\item R code to install from GitHub, if GitHub usage detected
\item a basic example
}

Use \code{Rmd} if you want a rich intermingling of code and output. Use \code{md} for a
basic README. \code{README.Rmd} will be automatically added to \code{.Rbuildignore}.
The resulting README is populated with default YAML frontmatter and R fenced
code blocks (\code{md}) or chunks (\code{Rmd}).

If you use \code{Rmd}, you'll still need to render it regularly, to keep
\code{README.md} up-to-date. \code{devtools::build_readme()} is handy for this. You
could also use GitHub Actions to re-render \code{README.Rmd} every time you push.
An example workflow can be found in the \verb{examples/} directory here:
\url{https://github.com/r-lib/actions/}.

If the current project is a Git repo, then \code{use_readme_rmd()} automatically
configures a pre-commit hook that helps keep \code{README.Rmd} and \code{README.md},
synchronized. The hook creates friction if you try to commit when
\code{README.Rmd} has been edited more recently than \code{README.md}. If this hook
causes more problems than it solves for you, it is implemented in
\code{.git/hooks/pre-commit}, which you can modify or even delete.
}
\examples{
\dontrun{
use_readme_rmd()
use_readme_md()
}
}
\seealso{
The \href{https://r-pkgs.org/other-markdown.html}{other markdown files section} of \href{https://r-pkgs.org}{R Packages}.
}