-
Notifications
You must be signed in to change notification settings - Fork 3
/
doc_doc_system.Rmd
121 lines (73 loc) · 2.69 KB
/
doc_doc_system.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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# (PART) Documentation {-}
<!-- PART 3: Documentation -->
# Centralized Documentation Scheme {#doc-system}
`r emo::ji("construction")` **Under Construction** `r emo::ji("construction")`
## The main idea
```{r setup, include=FALSE}
import_example <- function(file, lang = xfun::file_ext(file)) {
x = xfun::read_utf8(file.path("inst", file))
lang = tolower(lang)
if (nchar(lang) > 1) {
lang = sub('^r', '', lang)
if (lang == 'nw') lang = 'tex'
}
knitr::asis_output(paste(c(sprintf("````%s", lang), x, "````"), collapse = '\n'))
}
```
## The implementation
### Source Rmd files
Pkg Info specifically build for a package, here is a generic example:
```{r echo=FALSE}
# a single file
xfun::embed_file('inst/pkg_info.Rmd')
```
`r import_example('pkg_info.Rmd')`
[Rmd templates](#rmd-templates)
### Client Rmd files:
- Pkg README.Rmd
- Pkg Rmd file in the user guide
- Pkg Rmd file in the dev guide
- Pkg Rmd file in the website
A README example:
`r import_example('test-muli-RMD.Rmd')`
## Centralized reposotoiers
### bdtemplates
#### CI templates
#### .gitignore & .Rbuildignore
#### Rmd templates {#rmd-templates}
- Pkg info
- Pkg badges
- Pkg CI table
### Graphics
```{=html}
<div class="github-card" data-github="bd-r/bdgraphics" data-width="700" data-height="250" data-theme="default"></div>
<script src="//cdn.jsdelivr.net/github-cards/latest/widget.js"></script>
```
For more details [see bdgraphics (under the Graphics section)](#bdgraphics).
# User Guide {#user-guide}
# Website {#website}
# Pkg README file {#readme}
# Dev Guide {#dev-guide}
# Papers {#papers}
# Graphics {#graphics}
`r emo::ji("construction")` **Under Construction** `r emo::ji("construction")`
## Package color
```{=html}
<!-- Coolors Palette Widget -->
<script src="https://coolors.co/palette-widget/widget.js"></script>
<script data-id="06728234961140218">new CoolorsPaletteWidget("06728234961140218", ["265b6d","785549","4bae4d","37a5dd","ef4538","f7941d","6f3f98","939598"]); </script>
```
```{r, echo = FALSE, fig.cap="`bdverse` package"}
knitr::include_graphics("https://raw.githubusercontent.com/bd-R/bdgraphics/master/arc/bdverse/arc_bdverse_pkgs.svg")
```
### Retrieving pkg color
```{r}
# Data is stored in `bdutilities::bdverse_core_pkgs$pkg_color`
knitr::kable(bdutilities::bdverse_core_pkgs)
```
## bdgraphics {#bdgraphics}
```{=html}
<div class="github-card" data-github="bd-r/bdgraphics" data-width="700" data-height="250" data-theme="default"></div>
<script src="//cdn.jsdelivr.net/github-cards/latest/widget.js"></script>
```
<!-- [![bdgraphics](https://github-readme-stats.vercel.app/api/pin/?username=bd-R&repo=bdgraphics&show_owner=true)](https://github.com/bd-R/bdgraphics) -->