Skip to content

feat: detect and annotate temperatures and times in HTML output#21

Open
xcapaldi wants to merge 3 commits into
mainfrom
claude/detect-temp-time-tags-W7eXd
Open

feat: detect and annotate temperatures and times in HTML output#21
xcapaldi wants to merge 3 commits into
mainfrom
claude/detect-temp-time-tags-W7eXd

Conversation

@xcapaldi

@xcapaldi xcapaldi commented Apr 5, 2026

Copy link
Copy Markdown
Owner

Add temperature and time detection during HTML rendering. Detected
values are wrapped in tags with recipemd-temperature and
recipemd-time CSS classes plus data attributes (data-unit, data-value).

New RenderHTMLWithOptions method accepts HTMLOptions to control behavior.
ConvertTemperature option converts detected temperatures between Celsius
and Fahrenheit, displaying the converted value while preserving the
original in data-original-unit and data-original-value attributes.

Supported temperature patterns: °C, °F, celsius, fahrenheit
Supported time patterns: minutes, min, hours, hr, hrs, seconds, secs

https://claude.ai/code/session_016zD2491XMNatvyYLR2zghb

claude added 3 commits April 5, 2026 21:38
Add temperature and time detection during HTML rendering. Detected
values are wrapped in <span> tags with recipemd-temperature and
recipemd-time CSS classes plus data attributes (data-unit, data-value).

New RenderHTMLWithOptions method accepts HTMLOptions to control behavior.
ConvertTemperature option converts detected temperatures between Celsius
and Fahrenheit, displaying the converted value while preserving the
original in data-original-unit and data-original-value attributes.

Supported temperature patterns: °C, °F, celsius, fahrenheit
Supported time patterns: minutes, min, hours, hr, hrs, seconds, secs

https://claude.ai/code/session_016zD2491XMNatvyYLR2zghb
…mats

Rename HTMLOptions to RenderOptions and apply temperature conversion to
all renderers. For Markdown and JSON, detected temperatures in Description
and Instructions are converted in-place without HTML markup. For HTML,
span wrapping and data attributes are preserved as before.

Add RenderMarkdownWithOptions and RenderJSONWithOptions methods. Add
convertTemperaturesInText for plain-text replacement and
recipeWithConvertedTemperatures to clone a Recipe with converted fields
without mutating the original.

https://claude.ai/code/session_016zD2491XMNatvyYLR2zghb
…utation

Replace RenderOptions/WithOptions pattern with a Recipe.ConvertTemperatures
mutation method, consistent with the existing Scale/ScaleForYield design.
Callers convert before rendering rather than passing options through each
renderer.

- Add Recipe.ConvertTemperatures(to, rounding) that rewrites Description
  and Instructions in place
- Remove RenderOptions, RenderHTMLWithOptions, RenderMarkdownWithOptions,
  RenderJSONWithOptions
- Simplify annotateTemperatures to annotation-only (no conversion logic)
- Renderers return to their original signatures

https://claude.ai/code/session_016zD2491XMNatvyYLR2zghb
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