if (FALSE) {
## Simulate the creation of a new project
# Save working directory
original_wd <- getwd()
# Get a temporary working directory
wd <- tempfile("example")
# Simulate File > New File > R Markdown... > From Template > Simple Article
rmarkdown::draft(wd, template="simple_article", package="memoiR", edit=FALSE)
# Go to temp directory
setwd(wd)
# Make it the current project
usethis::proj_set(path = ".", force = TRUE)
## Sequence of actions to build a complete project
# Build .gitignore
build_gitignore()
## Activate source control, edit your files, commit
# Build README, link to HTML output only in this example
build_readme(PDF = FALSE)
# render: knit to HTML Document (interactively: click the Knit button)
rmarkdown::render(input = list.files(pattern = "*.Rmd"),
output_format = "bookdown::html_document2")
# Build GitHub Pages
build_githubpages()
# List the GitHub Pages files
setwd("docs")
list.files(recursive = TRUE)
## Commit and push. Outputs will be in /docs of the master branch.
## End of the example: cleanup
# Return to the original working directory and clean up
setwd(original_wd)
unlink(wd, recursive = TRUE)
}
Run the code above in your browser using DataLab