Skip to content

feat: render JSON Resume references section#121

Merged
smur89 merged 3 commits into
mainfrom
feat/issue-46-references-section-v2
Jun 14, 2026
Merged

feat: render JSON Resume references section#121
smur89 merged 3 commits into
mainfrom
feat/issue-46-references-section-v2

Conversation

@smur89

@smur89 smur89 commented Jun 14, 2026

Copy link
Copy Markdown
Owner

Summary

Closes #46. Renders JSON Resume's references[] — each entry's name as a level-3 heading with the reference quote in italic beneath, joined by the standard divider rule. Entries missing the reference quote are silently skipped (no orphan heading); entries with no name render the quote anonymously so the data still surfaces.

Adds preferences.referencesAvailableOnRequest (default false). When true and the section has no valid entries, emits the conventional References available upon request. line under the heading instead of suppressing the section. Localised via labels.referencesAvailableOnRequest.

Wired into _sections at column: "right"; appended to the default rightColumnSections order so existing users get the section automatically once they populate references[].

Supersedes #83 — that branch predates the internal//sections/ module split and the move of label defaults into internal/labels-en.toml.

Design

  • name rendered as === (level-3 heading), matching awards / projects.
  • reference rendered as emph(...) underneath the name.
  • Entries joined by the standard _join_with_dividers rule, wrapped in a breakable: false block so a single entry doesn't split across pages.
  • Renderer logic is a three-way cascade: no valid entries + no fallback → suppress; no valid entries + fallback → heading + italic line; valid entries → heading + dividered blocks.
  • references and referencesAvailableOnRequest keys added to internal/labels-en.toml so translators have a single resource file to update.
  • _check_bool("referencesAvailableOnRequest", ...) added alongside the other bool validations in alta().
  • example_full.typ gains a populated references block (one named + one anonymous quote) so the gallery exercises both paths.

Test plan

  • make test — every example + fixture compiles
  • make test-templatetemplate/cv.typ still compiles via the sed-swap path
  • make example-full — regenerated examples/example_full.pdf and the page-2 PNG; gallery alt text updated
  • make examples/tests/references.pdf — 3-page fixture covering populated entries, the available-upon-request fallback, and the default-suppressed path
  • Visual check of all three fixture pages — heading, dividers, italic quotes, and the anonymous-quote path all render as designed
  • README updated — new References subsection, label table entries (references, referencesAvailableOnRequest), referencesAvailableOnRequest preferences row, removal from the "not yet rendered" list, addition to the top-level keys list, addition to both column-keys lists (right-column default + single-column streaming order)

JSON Resume alignment

ALIGNS — JSON Resume defines references[] with name and reference fields (https://jsonresume.org/schema/); this PR renders both. The preferences.referencesAvailableOnRequest opt-in is a template extension for the no-references-supplied case.

Summary by CodeRabbit

  • New Features

    • Added support for rendering a References section from JSON Resume references[], with an option to show “References available upon request” when no usable reference data is present.
  • Documentation

    • Expanded README with References schema and preference configuration details.
    • Added new English labels for the References heading and the on-request fallback.
    • Updated gallery alt text to mention references in the rendered content.
  • Examples & Tests

    • Updated the full CV example to include populated References entries.
    • Added/updated test coverage for populated, empty-with-fallback, and empty-suppressed rendering paths.

@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 1d39cc0b-88db-40c9-aa24-5a46f5900dfd

📥 Commits

Reviewing files that changed from the base of the PR and between 0e53365 and 835bf22.

⛔ Files ignored due to path filters (3)
  • examples/example_full-2.png is excluded by !**/*.png
  • examples/example_full.pdf is excluded by !**/*.pdf
  • examples/tests/references.pdf is excluded by !**/*.pdf
📒 Files selected for processing (8)
  • README.md
  • examples/example_full.typ
  • examples/labels-ga.toml
  • internal/labels-en.toml
  • internal/layout.typ
  • lib.typ
  • sections/references.typ
  • tests/references.typ

📝 Walkthrough

Walkthrough

A new references CV section is implemented end-to-end: a sections/references.typ renderer filters and displays JSON Resume references[] entries, a new referencesAvailableOnRequest preference controls fallback rendering, the layout orchestration and preference validation are wired up, labels are added, and the README, example, and test fixture are updated accordingly.

Changes

References Section Feature

Layer / File(s) Summary
References renderer and labels
sections/references.typ, internal/labels-en.toml, examples/labels-ga.toml
Introduces _references(entries, labels, prefs) with entry filtering and a three-way rendering decision: suppress entirely, render an italic "available upon request" fallback, or render named/anonymous entries with divider rules. Adds label keys for references and referencesAvailableOnRequest to English and Irish translation files.
Layout wiring and preference defaults
internal/layout.typ, lib.typ
Imports the new renderer, adds a references entry to the _sections dispatch table targeting the right column, registers referencesAvailableOnRequest: false in _default_preferences, and validates the boolean via _check_bool in alta().
Test fixture and example data
tests/references.typ, examples/example_full.typ
Adds a three-scenario test fixture (populated entries with divider filtering; empty with fallback enabled; empty with default suppression) and extends the full example with named and anonymous reference entries and updated rightColumnSections ordering.
README documentation
README.md
Removes references from the "accepted but not yet rendered" list, adds a ### References schema section, documents preferences.referencesAvailableOnRequest, updates default section ordering and column assignments, extends labels documentation, and updates gallery image alt text.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • smur89/alta-typst#103: Introduced and standardised _check_bool for boolean preference validation in lib.typ, which this PR extends with a new referencesAvailableOnRequest validation call.
  • smur89/alta-typst#101: Modified internal/layout.typ section streaming and default ordering for single-column rendering; this PR follows the same pattern when adding references to the section sequence.
  • smur89/alta-typst#112: Refactored label handling into internal/labels-en.toml; this PR adds the new references and referencesAvailableOnRequest keys to that same source file.

Poem

🐇 A reference grows where once was none,
With names and quotes beneath the sun.
A fallback line for those who ask,
Or silence—both a worthy task.
The rabbit stamps the CV done! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: rendering the JSON Resume references section. It is specific, avoids noise, and directly reflects the primary objective.
Description check ✅ Passed The description thoroughly covers all required template sections: detailed summary with issue reference, design rationale, and comprehensive test plan with all checklist items ticked. Visual artifacts are confirmed via CI.
Linked Issues check ✅ Passed All requirements from issue #46 are met: _references renderer implemented with name as level-3 heading and reference in italics [#46]; divider joining and orphan heading skipping present; preferences.referencesAvailableOnRequest added with fallback line; right-column wiring and label localisation complete.
Out of Scope Changes check ✅ Passed All changes directly support the references section implementation: new renderer and tests, documentation updates, label additions, layout integration, and example population. No unrelated modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/issue-46-references-section-v2

Comment @coderabbitai help to get the list of available commands and usage tips.

Shane Murphy added 2 commits June 14, 2026 22:01
Closes #46. Adds `_references` renderer for JSON Resume's
`references[]`: each entry's `name` as a level-3 heading with the
`reference` quote in italic beneath, joined by the standard divider
rule. Entries missing the `reference` quote are silently skipped (no
orphan heading); entries with no `name` render the quote anonymously.

Adds `preferences.referencesAvailableOnRequest` (default `false`).
When `true` and the section has no valid entries (empty / missing
data, or every entry skipped), emits the conventional
`References available upon request.` line under the heading instead
of suppressing the section. The line text is
`labels.referencesAvailableOnRequest` so it localises alongside the
other display strings.

Wired into `_sections` at `column: "right"`; appended to the default
`rightColumnSections` order so existing users get the section
automatically once they populate `references[]`.

Supersedes #83 — that branch predates the `internal/`/`sections/`
module split and the move of label defaults into
`internal/labels-en.toml`.
- Collapse `valid.len() == 0` duplication into a single `empty` flag.
- Normalise `emph(...)` invocation to function-call form for both
  the fallback line and the per-entry quote.
- Trim verbose comments in `sections/references.typ`,
  `internal/labels-en.toml`, and `internal/layout.typ` so the
  references additions match the brevity of peer sections.
- Mirror the new `references` + `referencesAvailableOnRequest` keys
  into `examples/labels-ga.toml` so the Irish translator example
  stays exhaustive against `internal/labels-en.toml`.
@smur89 smur89 force-pushed the feat/issue-46-references-section-v2 branch from 0e53365 to 835bf22 Compare June 14, 2026 20:02
@smur89 smur89 merged commit 7473ee4 into main Jun 14, 2026
6 checks passed
@smur89 smur89 deleted the feat/issue-46-references-section-v2 branch June 14, 2026 20:08
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.

feat: add references section

1 participant