Rmdfiltr
R package that provides a collection of Lua filters that extend the functionality of R Markdown templates.
Install / Use
/learn @crsh/RmdfiltrREADME
rmdfiltr
<!-- badges: start --> <!-- badges: end -->rmdfiltr provides a collection of Lua-filters that extend the functionality of R Markdown templates.
Installation
<!-- You can install the released version of rmdfiltr from [CRAN](https://CRAN.R-project.org) with: ``` r install.packages("rmdfiltr") ``` -->You can install the development version from this GitHub repository with:
# install.packages("remotes")
remotes::install_github("crsh/rmdfiltr")
Example
You can add a filter to any R Markdown template that accepts additional
pandoc arguments.
---
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.
wordcount_html_document = function(...) {
format <- rmarkdown::html_document(...)
format$pre_processor <- rmdfiltr::add_wordcount_filter
format
}
See R Markdown: The Definitive Guide for details on how to create custom formats.
Filters
rmdfiltr currently provides the following filters:
wordcount: Prints the word count for the body of the document and for the reference section to the console.charcount: Prints the character count for the body of the document to the console.replace_ampersands: Replaces all ampersands in in-text citation withand(or the equivalent in other languages).doi2cite: Generates.bibfile from the DOIs in a document and convert the DOIs into BibTeX citation keys.
Contributions
Contributions of new filters are welcome. Pleas refer to the contributing guidelines before you start working or open a pull request. Also, please note that the rmdfiltr project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.
Related Skills
node-connect
343.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
90.0kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
343.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
343.1kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
