Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/crsh/rmdfiltr
R package that provides a collection of Lua filters that extend the functionality of R Markdown templates.
https://github.com/crsh/rmdfiltr
Last synced: 3 months ago
JSON representation
R package that provides a collection of Lua filters that extend the functionality of R Markdown templates.
- Host: GitHub
- URL: https://github.com/crsh/rmdfiltr
- Owner: crsh
- License: other
- Created: 2019-04-29T12:36:13.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-02-18T21:41:58.000Z (9 months ago)
- Last Synced: 2024-07-20T04:40:31.762Z (4 months ago)
- Language: R
- Homepage:
- Size: 55.7 KB
- Stars: 42
- Watchers: 7
- Forks: 2
- Open Issues: 7
-
Metadata Files:
- Readme: README.Rmd
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
- jimsghstars - crsh/rmdfiltr - R package that provides a collection of Lua filters that extend the functionality of R Markdown templates. (Lua)
README
---
output: github_document
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```# rmdfiltr
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)
[![Travis build status](https://travis-ci.org/crsh/rmdfiltr.svg?branch=master)](https://travis-ci.org/crsh/rmdfiltr)
[![CRAN status](https://www.r-pkg.org/badges/version/rmdfiltr)](https://cran.r-project.org/package=rmdfiltr)
[![CRAN downloads](https://cranlogs.r-pkg.org/badges/last-month/rmdfiltr)
`rmdfiltr` provides a collection of [Lua-filters](https://pandoc.org/lua-filters.html) that extend the functionality
of R Markdown templates.## Installation
You can install the development version from this GitHub repository with:
``` r
# install.packages("remotes")
remotes::install_github("crsh/rmdfiltr")
```## Example
You can add a filter to any R Markdown template that accepts additional `pandoc` arguments.
``` yaml
---
title: "Word count test"
output:
html_document:
pandoc_args: !expr rmdfiltr::add_wordcount_filter()
---
```Of course, you can also use the filters in a custom R Markdown format by adding `pandoc` arguments with the pre-processor function.
``` r
wordcount_html_document = function(...) {
format <- rmarkdown::html_document(...)
format$pre_processor <- rmdfiltr::add_wordcount_filter
format
}
```See [R Markdown: The Definitive Guide](https://bookdown.org/yihui/rmarkdown/new-formats.html) for details on how to create custom formats.
# Contributions
Contributions of new filters are welcome.
Pleas refer to the [contributing guidelines](https://github.com/crsh/rmdfiltr/blob/master/.github/CONTRIBUTING.md) before you start working or open a pull request.
Also, please note that the `rmdfiltr` project is released with a
[Contributor Code of Conduct](https://github.com/crsh/rmdfiltr/blob/master/.github/CODE_OF_CONDUCT.md).
By contributing to this project, you agree to abide by its terms.