feat: detect and annotate temperatures and times in HTML output#21
Open
xcapaldi wants to merge 3 commits into
Open
feat: detect and annotate temperatures and times in HTML output#21xcapaldi wants to merge 3 commits into
xcapaldi wants to merge 3 commits into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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