Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tianyishi2001/rmarkdown-wrapper-js
Wrapper for RMarkdown, Bookdown and Blogdown
https://github.com/tianyishi2001/rmarkdown-wrapper-js
Last synced: about 1 month ago
JSON representation
Wrapper for RMarkdown, Bookdown and Blogdown
- Host: GitHub
- URL: https://github.com/tianyishi2001/rmarkdown-wrapper-js
- Owner: TianyiShi2001
- Created: 2020-04-12T08:00:29.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T03:14:27.000Z (almost 2 years ago)
- Last Synced: 2024-10-08T18:23:21.460Z (about 1 month ago)
- Language: HTML
- Size: 970 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# rmarkdown-wrapper-js
Wrapper for R Markdown, Bookdown and Blogdown
## Installation
```bash
npm install rmarkdown
```## Usage
```typescript
import { render, renderSync } from 'rmarkdown';
```## Demo
### Basic `.Rmd` Knitting
Running
```typescript
renderSync("/Users/foo/bar/example.Rmd")
// you should use an absolute path
```will produce corresponding `example.xxx` documents according to the YAML frontmatter. The generated files are in the same directory as the source `.Rmd` file. `renderSync`'s return type is the same as `child_process.spawnSync()`. There is also a `render()` function, which is asynchronous, whose return type is the same as `child_process.spawn()`'s.
There are also some useful options that you can provide, for example:
```typescript
renderSync("/Users/foo/bar/example.Rmd", { output_format: 'pdf_document', output_dir:'~/baz' }))
```The supported options are:
```typescript
interface RenderOptions {
output_format?: string;
output_file?: string;
output_dir?: string;
output_options?: string;
output_yaml?: string;
quiet?: boolean;
encoding: boolean;
}
```For details, refer to [R Markdown's Docs](https://rmarkdown.rstudio.com/docs/reference/render.html).