Formal Parser and Related Tools for R Markdown Documents
Overview
An implementation of a formal grammar and parser for R Markdown documents using the Boost Spirit X3 library. It also includes a collection of high level functions for working with the resulting abstract syntax tree.
- **Breaking Change**: Migrated from S3/S4 classes to S7 classes for all AST node types (
rmd_ast,rmd_chunk,rmd_heading, etc.) - **Breaking Change**: Removed deprecated
rmd_subset()and related helper functions (rmd_get_node(),rmd_get_chunk(),rmd_get_markdown(),rmd_has_node(),rmd_has_chunk(),rmd_has_markdown()). Usermd_select()with tidyselect syntax instead. - Added support for yaml chunk options - e.g. (
#| echo: false) - Added support for fenced divs - e.g. (
::: {.class} ... :::) - Added support for markdown code blocks
- Added support for yaml expressions - e.g. (
!expr) - Added support for parsing collections of Rmd and qmd files - see
parse_qmd_collection()andparse_rmd_collection() - Removed option to not parse yaml - this is now always parsed. Based on this yaml node classes were simplified to just include
rmd_yaml. - Added support for Pandoc-style ordered fenced attributes for code blocks, fenced divs, and spans
- Added
rmd_fenced_div_wrap()function to wrap selected nodes with fenced divs - Added
rmd_insert()function to insert nodes relative to selected nodes - Added support for code block literals - e.g. ```{{r}}
Show all changes in 0.2.0Hide the rest of the changes in 0.2.0
- Added support for 2ndary parsing to handle inline elements:
- quarto shortcodes, inline code, and spans
- Enhanced
rmd_select()functionality and node manipulation - Added
has_heading()helper function for selecting heading nodes using glob patterns - Added
by_fenced_div()helper function for selecting fenced div sections using attribute patterns - Added
keep_yamlargument tormd_select()(defaults toTRUE) to automatically include YAML nodes in selections
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-05-02
- NOTE12 OK, 2 NOTE2026-04-22
- ERROR11 OK, 2 NOTE, 1 ERROR2026-04-18
Show 1 earlier changeHide 1 earlier change
- NOTE12 OK, 2 NOTE2026-03-10
Documentation
- Help pages
- 34 (2 internal)includes a package overview page
- Examples that run
- 100%13 run in a plain check
- Exported functions with examples
- 39%
- Documented parameters
- 100%
- Return-value docs
- 61%
- Help pages citing references
- 0%
Downloads
Repository
- PRs merged (all time)
- 80%
- Median days to close, 50 most recently updated closed issues
- 220
- Median days to close, 50 most recently updated closed PRs
- 0
Stars over time
Forks over time
Releases over time
Issues over time
PRs over time
9 development-tooling and community-health practices detected across 4 families in the upstream repository
Checks run against github.com/rundel/parsermd on 2026-10-18.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
GitHub Pages site last deployed 2025-08-19 · The repository has a site deploy workflow
pkgdown site last built 2025-08-19
This repository shows signs of AI coding tools.
- Claude Codefirst seen 2025-06-06Named in .Rbuildignore: .claude, CLAUDE.mdNamed in .gitignore: .claude, CLAUDE.md
- Julesfirst seen 2025-08-17Commits: 1 by its own account
Dependencies
Installing parsermd adds 61 packages (36 with compiled code, 53 MB of source tarballs). Heaviest: BH 14 MB, stringi 11 MB, bslib 5.6 MB.
Code & Tests
People & History
Pick two releases to compare their code metrics.
- RR 4.6.0 released · 2026-04-24
- 0.2.0Latest2025-08-19 · current release · diff ↗ ·
removed 7 exports
rmd_get_chunk, rmd_get_markdown, rmd_get_node, rmd_has_chunk, rmd_has_markdown, rmd_has_node, rmd_subsetadded 40 exports
rmd_node_attr<-, rmd_node_content<-, rmd_node_label<-, rmd_node_options<-, by_fenced_div, has_code, has_heading, has_inline_code, has_shortcode, parse_qmd, parse_qmd_collection, parse_rmd_collection, rmd_ast, rmd_ast_append, rmd_ast_prepend, rmd_chunk, rmd_code_block, rmd_code_block_literal, rmd_extract_inline_code, rmd_extract_shortcodes, rmd_extract_spans, rmd_fenced_div_close, rmd_fenced_div_open, rmd_fenced_div_wrap, rmd_has_inline_code, rmd_has_shortcode, rmd_has_span, rmd_heading, rmd_inline_code, rmd_insert and 10 more - RR 4.5.0 released · 2025-04-11
- RR 4.4.0 released · 2024-04-24
- 0.1.32024-01-16 · diff ↗
- RR 4.3.0 released · 2023-04-21
- RR 4.2.0 released · 2022-04-22
- 0.1.22021-05-20 · diff ↗
- 0.1.12021-05-19 · diff ↗
- RR 4.1.0 released · 2021-05-18
- 0.1.02021-05-10
- RR 4.0.0 released · 2020-04-24
Package metadata
- First published
- 2021-05-10
- Total releases
- 5 / 5 yrs
- License
- MIT + file LICENSE OSI
- Minimum R
- ≥ 4.1.0
- Download size
- 433 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("parsermd")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-20, which the citation names so these numbers can be found later. More on citing and the projects behind them.