rmd2qmd converts legacy R Markdown (.Rmd) documents to Quarto (.qmd), preserving rendering behavior, executable code, and document structure. Unlike a search-and-replace script, it parses document structure – YAML front matter, the Markdown AST, and knitr chunks – and emits clean, idiomatic Quarto instead of guessing with regex.
Core principles:
- Preserve behavior before appearance.
- Prefer structured parsing over regex.
- Never silently change meaning – warn whenever a conversion is uncertain.
- Never overwrite source
.Rmddocuments (opt-inoverwrite = TRUEonly). - Keep generated Quarto human-readable.
Installation
rmd2qmd is not yet on CRAN. Install the development version from GitHub:
# install.packages("pak")
pak::pak("chrischizinski/rmd2qmd")Usage
library(rmd2qmd)
# Convert a single file
convert_file("chapter1.Rmd")
# Convert a whole directory, recursively, and validate the result by
# rendering each output with Quarto
results <- convert_directory("book/", validate = TRUE)
# Summarize a conversion run as a Markdown report
generate_report(results, output = "conversion-report.md")A command-line interface is planned (rmd2qmd chapter1.Rmd, rmd2qmd book/ --recursive --validate --report) but not yet implemented – use the R API above in the meantime.
Documentation
See the package website for full reference documentation.
