-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
66 lines (49 loc) · 2.31 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
---
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%"
)
```
# oakdown
<!-- badges: start -->
![status](https://img.shields.io/badge/Status-Under%20Construction-orange)
<!-- badges: end -->
The goal of {oakdown} is to store and create single-document and multi-document templates that are so compatible that it is easy to switch between these templates.
## Installation
You can install oakdown from [github](https://github.com/omkarakatta/oakdown) with:
``` r
install.packages("oakdown")
```
## Example
### Note
The `note` format puts the spotlight on a single Rmd file, making this ideal for note-taking.
To begin, navigate to the directory where you want to store the note.
Then, initialize the note as follows:
```{r initialize-note, eval = FALSE}
library(oakdown)
init_note("<name>")
```
This produces is an Rmd file called `<name>.Rmd` as well as a .gitignore if one does not already exist in that directory.
Pay careful attention to the default YAML frontmatter provided in `<name>.Rmd`.
For **my** convenience, I have included `main.bib`, `econometrica.bst`, and `oaktex.sty`
as part of the frontmatter.
These are stored on my local computer and have little
to do with {oakdown}.
Hence, change or remove these YAML parameters if you don't have these files yourself.
After editing the contents of `<name>.Rmd`, you can render the Rmd file by calling:
```{r render-note, eval = FALSE}
render_note("<name>", config_file = "<config.yml>")
```
The bookdown configuration file, `<config.yml>`, must be in the same directory as the note.
If `<config.yml>` does not exist in the directory, this function will generate a bookdown configuration file in the background that will be removed after the rendering is complete.
To save the generated bookdown configuration file, specify `save_config_file = TRUE` as an argument to `render_note().`
<!-- During the rendering process, this function decides how to print the title of the note. -->
<!-- In the `note` format, the title will be passed to the YAML frontmatter. -->
<!-- In other formats, the title may be passed as a section header while the title in -->
<!-- the YAML frontmatter is specified elsewhere. -->