-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from samuelbharti/dev
Soft pull
- Loading branch information
Showing
16 changed files
with
184 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ dev.R | |
test_install | ||
inst/doc | ||
docs | ||
dev_untrack.R |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
#' A changelog markdown template to document project progress | ||
#' | ||
#' @param path Path where markdown file is created | ||
#' @param confirm Confirm path; logical input. | ||
#' | ||
#' @return Return markdown file in specified or current working directory | ||
#' @export | ||
#' | ||
#' @examples | ||
#' init_changelog_md() | ||
init_changelog_md <- function(path = getwd(), confirm = TRUE){ | ||
|
||
|
||
# Display a message before the prompt | ||
cat("You current working directory will be:\n") | ||
cat(path) | ||
|
||
if(confirm){ | ||
user_input <- tolower( | ||
readline( | ||
prompt = "Do you wish to create a Change log MD here? (y/yes to confirm): " | ||
) | ||
) | ||
}else{ | ||
user_input <- "y" | ||
} | ||
|
||
|
||
# Check if the user input is 'y' or 'yes' | ||
if (user_input %in% c("y", "yes")) { | ||
wd_path <- path | ||
|
||
markdown_content <- " | ||
# CHANGELOG | ||
``` txt | ||
YYYY-MM-DD John Doe | ||
* Big Change 1 | ||
* Another Change 2 | ||
``` | ||
" | ||
aa <- file.path(wd_path,"CHANGELOG.md") | ||
file.create(aa, showWarnings = FALSE) | ||
|
||
if(file.exists(aa)){ | ||
fileConn <- file(aa) | ||
|
||
writeLines( | ||
markdown_content, | ||
fileConn | ||
) | ||
close(fileConn) | ||
|
||
} | ||
|
||
} else { | ||
cat("Change log MD initialization canceled.\n") | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
url: https://www.samuelbharti.com/peacock/ | ||
url: http://www.samuelbharti.com/peacock/ | ||
template: | ||
bootstrap: 5 | ||
|
8 changes: 8 additions & 0 deletions
8
inst/markdown/templates/changelog_md_template/skeleton/skeleton.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# CHANGELOG | ||
|
||
``` txt | ||
YYYY-MM-DD John Doe | ||
* Big Change 1 | ||
* Another Change 2 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
name: "CHANGELOG MD" | ||
description: "A template to document project progress" | ||
create_dir: false |
22 changes: 22 additions & 0 deletions
22
inst/rmarkdown/templates/changelog_template/skeleton/skeleton.Rmd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
title: "[Project Name] Changelog" | ||
author: "Author Name" | ||
date: "`r Sys.Date()`" | ||
output: html_document | ||
--- | ||
|
||
```{r} | ||
print(paste0("Last updated: ",Sys.time())) | ||
``` | ||
|
||
------------------------------------------------------------------------ | ||
|
||
# CHANGELOG | ||
------------------------------------------------------------------------ | ||
|
||
YYYY-MM-DD John Doe | ||
|
||
- Big Change 1 | ||
- Another Change 2 | ||
- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
name: "CHANGELOG RMD" | ||
description: "A template to document project progress" | ||
create_dir: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Name: Peacock: Shiny Template | ||
Description: Shiny project with pre-defined structure and files | ||
Binding: init_shiny | ||
Interactive: true | ||
Params: | ||
confirm: FALSE | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Binding: init_shiny | ||
Title: Peacock: Shiny Template | ||
Subtitle: Create a new Shiny app project | ||
Caption: Shiny project with pre-defined structure and files | ||
Params: | ||
confirm: FALSE |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.