Three small stdin/stdout adapters for formatting Markdown and Quarto documents without losing executable-cell syntax.
The package installs three commands:
quarto-runicformats all Julia backtick fences with a single Runic process.quarto-stylerformats all R fences with one reusable R worker pool.quarto-autocorrectapplies AutoCorrect to prose and to#comments inside Python and Julia fences, including{python}and{julia}Quarto cells.
Both commands preserve the original fence opener. The shared parser also keeps
CRLF line endings when quarto-runic temporarily normalizes Quarto fences.
cargo install quarto-format-adaptersRunic, R with the styler package, and AutoCorrect remain external tools and must be installed separately. Their command paths can be supplied explicitly.
quarto-runic --runic /path/to/runicThe command reads a complete document from standard input. It changes
{julia} temporarily to julia, invokes Runic once in Markdown mode, and then
restores the original opener and attributes. QUARTO_RUNIC_RUNIC can provide
the executable path instead of --runic.
quarto-styler --rscript /path/to/RscriptThe command extracts all top-level r, {r}, and {r ...} fences and formats
each body independently with styler::style_text() in a reusable R worker
pool. It then restores the bodies without changing fence openers, attributes,
or the document's line-ending style. The pool defaults to twelve workers;
QUARTO_STYLER_WORKERS can override that number.
Formatted fence bodies are cached under the local application-data directory,
so unchanged blocks do not start R on later formatting passes. Set
QUARTO_STYLER_CACHE_DIR to relocate the cache. When changing styler versions
or style configuration, set a new QUARTO_STYLER_CACHE_TAG to invalidate old
entries.
QUARTO_STYLER_RSCRIPT can provide the executable path instead of
--rscript.
quarto-autocorrect --autocorrect /path/to/autocorrectAutoCorrect normally skips the contents of executable Quarto fences. This
adapter retains AutoCorrect's normal Markdown pass and performs one additional
text-mode pass over Python and Julia # comments. Quarto #| cell options and
hash characters inside quoted strings are excluded.
QUARTO_AUTOCORRECT_COMMAND can provide the executable path instead of
--autocorrect.
These commands are designed to compose with other stdin formatters. A typical Quarto chain is:
Panache -> quarto-styler -> quarto-runic -> quarto-autocorrect
When Panache precedes quarto-styler, disable Panache's per-fence R formatter
so that it does not start one R process for every fence.
Each command exits nonzero and reports the underlying formatter error on standard error when its external process fails.
cargo fmt --all -- --check
cargo clippy --all-targets --all-features -- -D warnings
cargo test --all-targets
cargo publish --dry-run