frontmatter
Parse Front Matter from Documents
A small R parser quietly becoming format-agnostic about front matter.
◆Recent moves
- 1mo ago
Delimiter inferred automatically, and shebang lines supported
Writing now infers the delimiter rather than requiring it: front matter that came from this package keeps its original fence style, otherwise the file extension decides and YAML is the fallback. Separately, files beginning with a shebang are handled, with comment-wrapped and PEP 723 front matter recognised immediately after it. Executable scripts are exactly where front matter is most likely to sit behind a shebang, so this closes an obvious gap.
View source ↗ - 6mo ago
Writing support completes the parse-and-rewrite roundtrip
Adds format_front_matter() and write_front_matter() as inverses of the existing parsers, covering every supported delimiter style, and attaches format and fence_type as attributes so the original style can be preserved on rewrite. The notes are candid that the roundtrip is imperfect, since comments and formatting inside the block may be lost. Turning a reader into a reader-writer is what makes the package usable for tooling that edits documents rather than only inspecting them.
View source ↗ - 7mo ago
First release: multi-format front matter parsing in C++
The initial CRAN release, reading YAML and TOML front matter across standard fences, comment-wrapped R and Python styles, and PEP 723 inline script metadata, with fast C++ parsing and graceful handling of incomplete blocks. Parsing is delegated to yaml12 and tomledit by default but accepts custom parsers. The separation between locating front matter and interpreting it is the design decision the later releases build on.
View source ↗