-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME.qmd
More file actions
83 lines (61 loc) · 3.14 KB
/
Copy pathREADME.qmd
File metadata and controls
83 lines (61 loc) · 3.14 KB
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
---
format: gfm
eval: false
default-image-extension: ""
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
# rdocdump: Dump 'R' Package Source, Documentation, and Vignettes into One File <a href="https://www.ekotov.pro/rdocdump/"><img src="man/figures/logo.png" align="right" width="200" alt="rdocdump website" /></a>
<!-- badges: start -->
[](https://www.repostatus.org/#active)
[](https://lifecycle.r-lib.org/articles/stages.html#stable)
[](https://CRAN.R-project.org/package=rdocdump)
[](https://CRAN.R-project.org/package=rdocdump){target="_blank"}
[](https://CRAN.R-project.org/package=rdocdump){target="_blank"}
[](https://github.com/e-kotov/rdocdump/actions/workflows/R-CMD-check.yaml)
[](https://github.com/e-kotov/rdocdump/actions?query=workflow%3Apkgcheck)
[](https://doi.org/10.32614/CRAN.package.rdocdump)
[](https://doi.org/10.5281/zenodo.15072446)
<!-- badges: end -->
Dump source code, documentation and vignettes of an `R` package into a single file. Supports installed packages, `tar.gz` archives, and package source directories. If the package is not installed, only its source is automatically downloaded from CRAN for processing. The output is a single plain text file or a `character` vector, which is useful to ingest complete package documentation and source into a large language model (LLM) or pass it further to other tools, such as [`{ragnar}`](https://github.com/tidyverse/ragnar){target='_blank'} to create a Retrieval-Augmented Generation (RAG) workflow.
## Installation
Install the latest stable release of `rdocdump` from CRAN with:
```r
install.packages("rdocdump")
```
You can install the development version of `rdocdump` from R Universe with:
```r
install.packages('rdocdump',
repos = c('https://e-kotov.r-universe.dev', 'https://cloud.r-project.org')
)
```
or from GitHub with:
```r
# install.packages("pak")
pak::pak("e-kotov/rdocdump")
```
## Example
Extract documenation and source code of `{rJavaEnv}` package by downloading source from CRAN and save it to file `rJavaEnv_docs.txt`
```r
rdd_to_txt(
pkg = "rJavaEnv",
file = tempfile("rJavaEnv_docs_", fileext = ".txt"),
force_fetch = TRUE, # force download even if package is installed
keep_files = "none" # delete temp files
)
```
## Citation
```{r}
#| eval: true
#| echo: false
#| results: 'asis'
print(citation("rdocdump"), bibtex = FALSE)
```
BibTeX:
```
```{r}
#| eval: true
#| echo: false
#| results: 'asis'
toBibtex(citation("rdocdump"))
```
```