{minimalTemplate}
is a highly opinionated package to facilitate the production of docx files using RMarkdown. For now, this package has no commitment to the structure standards of the projects or R packages. Use at your own risk.
To use the full workflow of the {minimalTemplate}
, follow the steps below:
.docx
files (optional, but recommended)Set a new template using:
# load minimalTemplate
library(minimalTemplate)
# create a temporary directory (for a demo proposal only)
tmp_proj <- file.path(tempdir(), "awesome-manuscript")
# run `setup_template()`
setup_template(tmp_proj)
## ✔ Creating '/tmp/RtmpUCZXET/awesome-manuscript/'
## ✔ Setting active project to '/tmp/RtmpUCZXET/awesome-manuscript'
## ✔ Creating 'R/'
## ✔ Writing 'awesome-manuscript.Rproj'
## ✔ Adding '.Rproj.user' to '.gitignore'
## ✔ Setting active project to '<no active project>'
## ℹ Please, following the instructions in the 'todo.txt' file
The folder structure of the awesome-project
project is (this is not a mandatory structure):
## /tmp/RtmpUCZXET/awesome-manuscript
## ├── .Rbuildignore
## ├── .dockerignore
## ├── .github
## │ └── workflows
## │ └── docker.yaml
## ├── .gitignore
## ├── .travis.yml
## ├── DESCRIPTION
## ├── Dockerfile
## ├── LICENSE.md
## ├── Makefile
## ├── R
## │ ├── analysis.Rmd
## │ ├── local_functions.R
## │ └── package_list.R
## ├── README.md
## ├── awesome-manuscript.Rproj
## ├── data
## │ ├── clean
## │ │ └── .gitkeep
## │ ├── raw
## │ │ └── .gitkeep
## │ └── temp
## │ └── .gitkeep
## ├── main-script.Rmd
## ├── manuscript
## │ └── sources
## │ ├── ecology-letters.csl
## │ ├── library.bib
## │ ├── packages.bib
## │ └── template.docx
## ├── output
## │ ├── figures
## │ │ └── .gitkeep
## │ ├── results
## │ │ └── .gitkeep
## │ └── supp
## │ └── .gitkeep
## └── todo.txt
Open the main-script.Rmd
file and press the Knit
button.
.docx
filesIn this step, I’m assuming you want to control the changes (files changes
textandcode
, entry of new analysis files) in your new project folder. Please, refer to this to learn how to configure git in your new project template.
To versioning your .docx
files, just run the function:
This function is based on two git hooks (available here) to create a .md
copy of .docx
files and track the changes.