Skip to content

Metadata#19

Draft
Polkas wants to merge 4 commits into
mainfrom
metadata
Draft

Metadata#19
Polkas wants to merge 4 commits into
mainfrom
metadata

Conversation

@Polkas
Copy link
Copy Markdown
Collaborator

@Polkas Polkas commented May 10, 2026

Adds opt-in metadata capture when exporting gridifyClass objects.

New metadata argument on export_to() accepting "none" (default), "sidecar", or "embed", resolved via match.arg().
"sidecar" — writes .json next to the output with the set_cell() text values.
"embed" — embeds the JSON payload in the PDF /Title field (PDF only; skipped if the user supplied their own title).
"none" — disables both.
Project-wide default can be set via options(gridify.export.metadata = "sidecar"); resolution layered as explicit arg → option → "none", all funneled through resolve_export_metadata().
Works for single objects and lists (multi-page PDFs emit one merged JSON array).
Internal helpers in gridify-utils.R: gridify_metadata(), gridify_to_json() (thin jsonlite::toJSON wrapper), write_metadata_sidecar(), all @Keywords internal and unit-tested.
Adds jsonlite to Imports. Vignettes (simple_examples, multi_page_examples) and NEWS.md updated.
Fully backwards-compatible: default behaviour writes the same single file as before.Adds opt-in metadata capture when exporting gridifyClass objects.

New metadata argument on export_to() accepting "none" (default), "sidecar", or "embed", resolved via match.arg().
"sidecar" — writes .json next to the output with the set_cell() text values.
"embed" — embeds the JSON payload in the PDF /Title field (PDF only; skipped if the user supplied their own title).
"none" — disables both.
Project-wide default can be set via options(gridify.export.metadata = "sidecar"); resolution layered as explicit arg → option → "none", all funneled through resolve_export_metadata().
Works for single objects and lists (multi-page PDFs emit one merged JSON array).
Internal helpers in gridify-utils.R: gridify_metadata(), gridify_to_json() (thin jsonlite::toJSON wrapper), write_metadata_sidecar(), all @Keywords internal and unit-tested.
Adds jsonlite to Imports. Vignettes (simple_examples, multi_page_examples) and NEWS.md updated.
Fully backwards-compatible: default behaviour writes the same single file as before.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 10, 2026

Codecov Report

❌ Patch coverage is 98.55072% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 99.48%. Comparing base (45855f1) to head (940f0ae).

Files with missing lines Patch % Lines
R/gridify-methods.R 96.87% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #19      +/-   ##
==========================================
- Coverage   99.56%   99.48%   -0.09%     
==========================================
  Files           9        9              
  Lines         919      962      +43     
==========================================
+ Hits          915      957      +42     
- Misses          4        5       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants