File tree Expand file tree Collapse file tree 3 files changed +40
-2
lines changed Expand file tree Collapse file tree 3 files changed +40
-2
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,14 @@ is_package <- function(base_path = proj_get()) {
4444 file.exists(file.path(base_path , " DESCRIPTION" ))
4545}
4646
47+ project_data <- function (base_path = proj_get()) {
48+ if (is_package(base_path )) {
49+ package_data(base_path )
50+ } else {
51+ list (Project = basename(base_path ))
52+ }
53+ }
54+
4755package_data <- function (base_path = proj_get()) {
4856 desc <- desc :: description $ new(base_path )
4957
Original file line number Diff line number Diff line change 2121use_readme_rmd <- function (open = TRUE ) {
2222 check_installed(" rmarkdown" )
2323
24- data <- package_data ()
24+ data <- project_data ()
2525 data $ Rmd <- TRUE
2626
2727 use_template(
28- " omni-README" ,
28+ if (is_package()) " omni-README" else " project-README.Rmd " ,
2929 " README.Rmd" ,
3030 data = data ,
3131 ignore = TRUE ,
Original file line number Diff line number Diff line change 1+ ---
2+ output : github_document
3+ ---
4+
5+ <!-- README.md is generated from README.Rmd. Please edit that file -->
6+
7+ ``` {r setup, include = FALSE}
8+ knitr::opts_chunk$set(
9+ collapse = TRUE,
10+ comment = "#>"
11+ )
12+ ```
13+
14+ # {{{ Project }}}
15+
16+ The goal of {{{ Project }}} is to ...
17+
18+ What is special about using ` README.Rmd ` instead of just ` README.md ` ? You can include R chunks like so:
19+
20+ ``` {r cars}
21+ summary(cars)
22+ ```
23+
24+ You can also embed plots, for example:
25+
26+ ``` {r pressure, echo = FALSE}
27+ plot(pressure)
28+ ```
29+
30+ In that case, don't forget to commit and push the resulting figure files, so they display on GitHub!
You can’t perform that action at this time.
0 commit comments