WORK-265
ID:WORK-265Status:done

Shared markdoc formatter functions

Register a small set of author-facing markdoc functions — currency, date, number, join — in @refrakt-md/runes as the shared value-formatting layer, usable anywhere markdoc transforms run: collection cells, body templates, and entityRoutes render strings. Keeps formatting out of fields and out of any bespoke projection DSL.

Priority:mediumComplexity:simpleMilestone:v0.16.0Source:SPEC-070
claude/v0.16.0 View source

Criteria completion

Criteria completion: 0 of 4 (0%) checked; tracking started on May 25, no incremental history yet0%25%50%75%100%May 25Jun 15

Tracking started May 25 — check back for trends.

Branches 2
claude/v0.16.0 current done
claude/milestone-v0.16.0 readymain ready
History 2
  1. 020ab26
    Created (done)by bjornolofandersson
  2. 7ab7615
    Content editedby Claude
    plan: add v0.16.0 milestone and work breakdown for SPEC-069/070/071

Acceptance Criteria

  • currency, date, number, join registered as markdoc functions available wherever markdoc runs
  • Functions are pure formatters with documented signatures and examples
  • Available in collection heading-delimited cells (WORK-264), body templates (WORK-263), and entityRoutes render / render-template (WORK-268)
  • Unit tests for each formatter, including locale/edge handling for currency and date

Dependencies

None — independent; consumed by WORK-263, WORK-264, WORK-268.

References

  • SPEC-070
  • SPEC-069 — same functions usable in entityRoutes render strings

Resolution

Completed: 2026-05-25

Branch: claude/v0.16.0

What was done

  • packages/runes/src/functions.ts: currency, date, number, join markdoc ConfigFunctions (Intl-based; graceful fallback on bad input) + a functions map; exported from the runes index.
  • packages/content/src/site.ts: added functions to the page transform config and to embedConfig; now always threads embedConfig via createCorePipelineHooks so collection/expand per-entity templates transform even without xref patterns or a project root.
  • Extended the embedConfig type (CorePipelineHooksOptions + postProcess coreData) with functions?.
  • Tests: packages/runes/test/functions.test.ts (6) — formatting, graceful degradation, and markdoc interpolation.

Notes

  • Same functions are available in entityRoutes render strings (WORK-268) since those transform through the same embedConfig.