Skip to content

Commit

Permalink
use_index_md() instead of use_index_rmd()
Browse files Browse the repository at this point in the history
as ".Rmd" is not rendered anymore by pkgdown v1.4 due to adapted workflow as explained by @hadley in r-lib/pkgdown#1136
  • Loading branch information
mrustl committed Sep 6, 2019
1 parent 7ac5896 commit 8e898ad
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 34 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: kwb.pkgbuild
Title: R package for standardised development at KWB
Version: 0.1.0.9000
Version: 0.1.1
Authors@R:
c(person(given = "Michael",
family = "Rustler",
Expand Down
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export(use_gitlab_ci_blogdown)
export(use_gitlab_ci_docs)
export(use_gitlab_ci_ghpages)
export(use_gitlab_ci_pkgdown)
export(use_index_rmd)
export(use_index_md)
export(use_mit_license)
export(use_news_md)
export(use_pkg)
Expand Down
6 changes: 4 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# kwb.pkgbuild 0.1.0.9000 <small>unreleased</small>

* current development version

# [kwb.pkgbuild 0.1.1](https://github.com/KWB-R/kwb.pkgbuild/releases/tag/v0.1.0) <small>2019-09-06</small>

* use .md instead of .Rmd due to changed workflow in pkgdown v1.4 (see: [r-lib/pkgdown#1136](https://github.com/r-lib/pkgdown/issues/1136))

# [kwb.pkgbuild 0.1.0](https://github.com/KWB-R/kwb.pkgbuild/releases/tag/v0.1.0) <small>2019-09-04</small>

* improved use in case of an existing R package (by reading information from
Expand Down
16 changes: 8 additions & 8 deletions R/use_index_rmd.R → R/use_index_md.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# use_index_rmd ----------------------------------------------------------------
# use_index_md ----------------------------------------------------------------

#' Use index.Rmd (used for pkgdown::build_home())
#' Use index.md (used for pkgdown::build_home())
#' @param user user name or organisation under which repository defined in\cr
#' parameter "repo" is hosted (default: "KWB-R")\cr
#' @param domain under which repository is hosted (default: "github")
Expand All @@ -12,13 +12,13 @@
#' @export
#' @importFrom desc desc

use_index_rmd <- function(
use_index_md <- function(
user = "KWB-R", domain = "github", stage = "experimental"
)
{
pkg <- read_description()

index_rmd <- c(
index_md <- c(
use_badge_appveyor(pkg$name, user,domain),
use_badge_travis(pkg$name, user),
use_badge_codecov(pkg$name, user, domain ),
Expand All @@ -27,12 +27,12 @@ use_index_rmd <- function(
"",
pkg$desc,
"",
use_installation(pkg$name, user, domain,output = "rmd")
use_installation(pkg$name, user, domain,output = "md")
)

writeLines(index_rmd, "index.Rmd")
writeLines(index_rmd, "index.md")

write_to_rbuildignore(ignore_pattern = "^index\\.Rmd$")
write_to_rbuildignore(ignore_pattern = "^index\\.md$")

index_rmd
index_md
}
22 changes: 10 additions & 12 deletions R/use_installation.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,20 @@
#' @param user user name or organisation under which repository defined in
#' parameter "repo" is hosted
#' @param domain under which repository is hosted
#' @param output if "rmd" (other code chunks are used); otherwise: "md" style!
#' (default: "md")
use_installation <- function(pkgname, user, domain, output = "md")
use_installation <- function(pkgname, user, domain)
{
url_tutorial_install <- "https://kwb-r.github.io/kwb.pkgbuild/articles/install.html"
url_tutorial_install <-
"https://kwb-r.github.io/kwb.pkgbuild/articles/install.html"

c("## Installation",
c(
"## Installation",
"",
paste("For details on how to install KWB-R packages checkout our",
sprintf("[installation tutorial](%s).", url_tutorial_install)),
paste(
"For details on how to install KWB-R packages checkout our",
sprintf("[installation tutorial](%s).", url_tutorial_install)
),
"",
if (tolower(output) == "rmd") {
"```{r echo = TRUE, eval = FALSE}"
} else {
"```r"
},
"```r",
'### Optionally: specify GitHub Personal Access Token (GITHUB_PAT)',
'### See here why this might be important for you:',
'### https://kwb-r.github.io/kwb.pkgbuild/articles/install.html#set-your-github_pat',
Expand Down
12 changes: 6 additions & 6 deletions man/use_index_rmd.Rd → man/use_index_md.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions man/use_installation.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8e898ad

Please sign in to comment.