Skip to content

add image in recipe steps - #195

Merged
dubadub merged 2 commits into
cooklang:mainfrom
pinage404:recipe_images
Nov 25, 2025
Merged

dubadub merged 2 commits into
cooklang:mainfrom
pinage404:recipe_images

Conversation

@pinage404

@pinage404 pinage404 commented Nov 24, 2025 •

Copy link
Copy Markdown
Contributor

Add image in recipe steps

I :

  • copied the existing image
  • ran cargo fmt
  • ran cargo clippy
  • ran cargo test
  • ran npm run test tests/e2e/recipe-display.spec.ts
  • did manual review verification with make dev_server

The cook server command display steps indexed from 1, so i choose to also use steps indexed from 1 in the path : <recipe-name>.<index from 1>.jpg

I didn't added an alt because i don't know how to fill it with an useful value for people that can't see the image

I didn't read all the contributing documentation (too long) and i didn't used AI

I don't know if i have something else to do

Closes #173

@dubadub

dubadub commented Nov 24, 2025

Copy link
Copy Markdown
Member

Hey @pinage404, great work on adding images and providing the description for your PR!

I started fixing that a few weeks back but never finished. My bad, I don't provide transparency on that, but I added step images support into cooklang-find library so that feature can be reused in any other app that uses it too cooklang/cooklang-find@3b58f49.

Would you mind using updated cooklang-find library for your implementation and get step images from RecipyEntry object?

@pinage404

Copy link
Copy Markdown
Contributor Author
Before After
image image

@pinage404

Copy link
Copy Markdown
Contributor Author

Would you mind using updated cooklang-find library for your implementation and get step images from RecipyEntry object?

I already used .step_images() https://github.com/cooklang/cookcli/pull/195/files#diff-5a8cae01b26b0320cbe02b6e58b2e5e2ea9e665b51015f6d20f4c8617c2e3f96R357 which has been added in the mentioned commit cooklang/cooklang-find@3b58f49#diff-61080a4bca04e721e4df77e5b0dd0f91a5d26d6f12fbfc5d2cbb19c959e6bb7cR355

I didn't understood what should i change

@dubadub

dubadub commented Nov 25, 2025

Copy link
Copy Markdown
Member

Sorry, my bad 🤦 Somehow I overlooked it. Let's merge it then!

@dubadub
dubadub merged commit 3e0946b into cooklang:main Nov 25, 2025
Comment thread src/server/ui.rs

let section_image_path = entry
.step_images()
.get(0, section_steps.len() + 1)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should take section index here instead of 0, so recipes with multiple sections correctly place images too (like this one https://recipes.cooklang.org/recipes/3400).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh ! You are right !

Fixed in #202

pinage404 added a commit to pinage404/cookcli that referenced this pull request Nov 25, 2025
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.

Support multiple step-specific images in recipes

2 participants