-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.Rmd
77 lines (52 loc) · 2.73 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
---
output: github_document
---
![](http://www.textfiles.com/underconstruction/HeHeartlandPark2601underconstructionbar9.gif)
# minimalTemplate
[![Build Status](https://travis-ci.com/kguidonimartins/minimalTemplate.svg?branch=main)](https://travis-ci.com/kguidonimartins/minimalTemplate)
[![Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.](https://www.repostatus.org/badges/latest/wip.svg)](https://www.repostatus.org/#wip)
[![License:
MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
`{minimalTemplate}` is a highly opinionated package to facilitate the production of docx files using [RMarkdown](https://rmarkdown.rstudio.com/). For now, this package has no commitment to the structure standards of the projects or R packages. *Use at your own risk*.
## Installation
You can install the development version of `{minimalTemplate}` with:
``` r
if(!require("remotes")) install.packages("remotes")
remotes::install_github("kguidonimartins/minimalTemplate")
```
## Example
To use the full workflow of the `{minimalTemplate}`, follow the steps below:
1. Set up a new template
2. Download a new citation style
3. Set up the version control of `.docx` files (optional, but recommended)
### 1. Setting up a new template
Set a new template using:
```{r}
# 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)
```
The folder structure of the `awesome-project` project is (*this is not a mandatory structure*):
```{r, eval=TRUE, echo=FALSE, message=FALSE}
if (!require("fs")) install.packages("fs")
fs::dir_tree(path = tmp_proj, recurse = TRUE, all = TRUE)
```
Open the `main-script.Rmd` file and press the `Knit` button.
### 2. Download a new citation style
Set a new citation style using:
```r
# First, search by your citation style using:
(eco <- grep(pattern = "ecology", x = rcrossref::get_styles(), value = TRUE))
# then:
download_csl(journal_style = eco[4], directory = "manuscript/sources/")
```
### 3. Setting up the version control of `.docx` files
In this step, I'm assuming you want to control the changes (files changes [text and code], entry of new analysis files) in your new project folder. Please, refer to [this](https://kbroman.org/github_tutorial/) to learn how to configure git in your new project template.
To versioning your `.docx` files, just run the function:
```r
setup_wdiff()
```
This function is based on two git hooks (available [here](https://github.com/vigente/gerardus/tree/master/shell-script)) to create a `.md` copy of `.docx` files and track the changes.