-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
96 lines (66 loc) · 6.02 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# crender: *C*onditional *render*ing for Rmarkdown <img src="man/figures/logo.png" align="right" width=120 height=139 alt="" />
<!-- badges: start -->
[](https://www.repostatus.org/#wip)
[](https://github.com/drdsdaniel/crender/actions)
[](https://www.tidyverse.org/lifecycle/#experimental)
[](https://codecov.io/gh/drdsdaniel/crender?branch=main)
[](https://CRAN.R-project.org/package=crender)
<!-- badges: end -->
## Overview
The main objective of __crender__ can be summarized as:
1. Ability to **conditional**ly insert __content__ into an RMarkdown document. See [Functions reference pages](./reference/index.html)
2. Ability to generate documents (in different __Formats__) with different content from the same RMarkdown document. See [Get started section](https://drdsdaniel.github.io/crender/articles/crender.html)
3. Ability to generate documents (in different __Versions__, same format) with different content from the same RMarkdown document. See [Multiple versions - vignette](https://drdsdaniel.github.io/crender/articles/multiple-versions.html)
## Installation
`crender` is not yet in CRAN.
<!-- You can install the released version of crender from [CRAN](https://CRAN.R-project.org) with: -->
<!-- ``` r -->
<!-- install.packages("crender") -->
<!-- ``` -->
You can install the development version from GitHub with:
``` r
tryCatch(
library(remotes),
error = function(e){
install.packages('remotes')
}
)
remotes::install_github("drdsdaniel/crender")
```
## Roadmap
`crender` is an experimental stage and can suffer many changes until stable version. These are some of the ideas that at the moment I plan to add to the package. Feel free to propose any change that you consider pertinent. Look at `Contributing` below to see how.
However, it is important to note that we do not want to modify the [knitr::knit()](https://rdrr.io/github/forks-micael/knitr/man/knit.html) or [Rmarkdown::render()](https://rdrr.io/cran/rmarkdown/man/render.html) functions unless the functionality in question is of great importance, to warrant the work that this implies.
1. Add a function to insert conditional elements in the yaml
<!-- Desarrollar esta función: author: "r crender::cr_toggle('Daniel E. de la Rosa', 'crender core team', only = NULL, cr_dbl = NULL)" -->
2. A function to insert tables in especific formats
<!-- Falta la función cr_table -->
3. A knit function to control additional output aspects
4. Ability of generate multiple version with the same output format
<!-- Si de verdad puedo poner múltiples rmarkdown::render dentro de la function knit, cual es el plan para rmd.polyglot, entonces tambien puedo hacer que crender cree distintas versiones de un mismo documento. Utilizando ver1...vern en lugar de lang1...langn. La idea básicamente es que pongo tantos lang(ver) en los párametros como idiomas(versiones) del mismo documento quiero. Entonces mientras pueda hacer que la funcion knit ejecute rmarkdown::render tantas veces como estos parámetros haya, intercalandolos 1 a 1, entonces puedo manipular los cr_val, incluso puedo combinar esto con los formatos de documentos, es decir que puedo tener distintas versiones en varios formatos con algunas diferencias en cada uno. En fin, los formatos tienen sentido porque puedo hacer una presentación por ejemplo al mismo tiempo, o porque puedo tener una versión html con elementos interactivos. Las versiones vendrían primero que los idiomas, ya que con las versiones puedo hacer lo de los idiomas.
Tener un parámetro ver_append que haga que las versiones posteriores incluyan las anteriores. Así me evito tener que estar escribiendo más y más versiones las funciones que aplican a más de una versión.
En los parámetros para las versiones me gustaría incluir nombres para las versiones más que verdadero o falso.
A la cr_knit function le pueda pasar un argumento correspondiente al nombre de salida del documento.
cr_switch un valor específico para cada formato(lan/ver). Esto más para el yaml, para el contenido mejor utilizar el argumento cr_only -->
5. Ability of dinamically evaluate the chucks in conjunction with crender
<!-- Crear una función cr_eval() para evaluar el código R condicionalmente, y así nisiquiera evaluo el código cuando este no va a ser insertado en documento actual. Esto es algo similar a como funciona tryCatch incluso puede ser de este tipo que todo el código vaya dentro de ella o puedo hacer que funciones con %>% o mejor aún de ambas formas. En verdad resulta igual de peligroso que el argumento eval del chuck a menos que logre hacer algun tipo de dependencia que haga que el código se evalue solo si es necesario en cualquier parte del documento. -->
<!-- Puedo utilizar esto para la evaluación dinámica. https://bookdown.org/yihui/rmarkdown-cookbook/load-cache.html -->
## Contributing
Have a feedback or want to contribute?
Please take a look at the [contributing guidelines](https://drdsdaniel.github.io/crender/CONTRIBUTING.html) before filing an issue or pull request.
Please note that the `crender` project is released with a [Contributor Code of Conduct](https://contributor-covenant.org/version/2/0/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.
<hr/>
```{r echo=FALSE}
Dmisc::big_button("Get started", "https://drdsdaniel.github.io/crender/articles/crender.html")
```