Skip to content

Add template content block system for rich cookbook narratives#10

Open
djliden wants to merge 1 commit intomainfrom
template-content-blocks
Open

Add template content block system for rich cookbook narratives#10
djliden wants to merge 1 commit intomainfrom
template-content-blocks

Conversation

@djliden
Copy link
Copy Markdown
Collaborator

@djliden djliden commented Apr 2, 2026

Summary

  • Introduces a typed block system (markdown, recipe, code) that lets templates interleave connecting prose and inline code between recipe steps, instead of just concatenating recipes back-to-back
  • Refactors the markdown export API (api/content-markdown.ts) and all 5 template pages to use the new buildTemplateRawMarkdown / buildTemplateMarkdownDocument functions
  • Falls back to legacy recipe concatenation for templates that don't define custom content blocks
  • Adds TemplateBlockRenderer React component for rendering mixed blocks in the browser
  • Adds test verifying legacy templates don't duplicate recipe headings

New files

  • src/lib/template-content.ts — block types, serialization, markdown document builder
  • src/components/templates/template-blocks.tsx — React renderer for template content blocks

Test plan

  • npm run typecheck passes
  • npm run fmt clean
  • npm run build succeeds
  • bun run test — 23 tests pass
  • Verify existing template pages render unchanged in browser

This pull request was AI-assisted by Isaac.

Introduces a typed block system (markdown, recipe, code) that lets
templates interleave prose and code between recipe steps instead of
just concatenating recipes. Refactors all template pages and the
markdown export API to use the new system, with a fallback to legacy
concatenation for templates without custom blocks.

Co-authored-by: Isaac
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.

1 participant