Skip to content

Metadata#19

Draft
Polkas wants to merge 5 commits into
mainfrom
metadata
Draft

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

Conversation

@Polkas
Copy link
Copy Markdown
Collaborator

@Polkas Polkas commented May 10, 2026

Add metadata argument to export_to() with JSON sidecar support

Introduces an opt-in metadata argument to export_to() that records set_cell() text values alongside exported files.

What's new

  • export_to() gains a metadata argument ("none" / "sidecar"). Passing "sidecar" writes a <file>.json sidecar next to the output — a flat JSON object for single-page exports, or a JSON array (one entry per page) for multi-page PDFs.
  • A gridify.export.metadata global option allows project-wide defaults (e.g. in .Rprofile).
  • Internal helpers extracted to gridify-utils.R: gridify_metadata(), gridify_to_json(), write_metadata_sidecar(), resolve_export_metadata().
  • jsonlite added as Suggests (not Imports) — only required when metadata = "sidecar" is used; a clear requireNamespace guard provides an install prompt otherwise.

Tests & docs

  • New test files: test_export_to.R, test_gridify_to_json.R.
  • New man pages for all internal helpers.
  • Vignettes (simple_examples, multi_page_examples) and NEWS.md updated.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 10, 2026

Codecov Report

❌ Patch coverage is 98.38710% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 99.47%. Comparing base (45855f1) to head (c90575a).

Files with missing lines Patch % Lines
R/gridify-utils.R 97.43% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #19      +/-   ##
==========================================
- Coverage   99.56%   99.47%   -0.09%     
==========================================
  Files           9        9              
  Lines         919      955      +36     
==========================================
+ Hits          915      950      +35     
- 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.

@Polkas
Copy link
Copy Markdown
Collaborator Author

Polkas commented May 21, 2026

#15

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