Skip to content

(#440) Dynamic code block functionality#463

Merged
st3phhays merged 2 commits into
chocolatey:mainfrom
alexaveldanez:dynamic-code-block
Jun 10, 2025
Merged

(#440) Dynamic code block functionality#463
st3phhays merged 2 commits into
chocolatey:mainfrom
alexaveldanez:dynamic-code-block

Conversation

@alexaveldanez

@alexaveldanez alexaveldanez commented Jun 6, 2025

Copy link
Copy Markdown
Contributor

Description Of Changes

This allows for the dynamic code block component in choco-astro to listen for values entered into input for code block components and replace custom variables placed in the code block on a page.

Motivation and Context

To allow a user to enter values and have those values injected dynamically into a code block. When the user goes to copy the code block, the entered values are copied as well.

Testing

  1. From root of docs local repository run yarn link choco-theme.
  2. Run yarn build.
  3. Follow steps from choco-astro PR: (#440) Created dynamic code block component chocolatey-archive/choco-astro#27

Change Types Made

  • Bug fix (non-breaking change).
  • Feature / Enhancement (non-breaking change).
  • Breaking change (fix or feature that could cause existing functionality to change).
  • Documentation changes.
  • PowerShell code changes.

Change Checklist

  • Requires a change to the documentation.
  • Documentation has been updated.
  • Tests to cover my changes, have been added.
  • All new and existing tests passed?
  • PowerShell code changes: PowerShell v3 compatibility checked?

Related Issue

#440

Fixes #440

@alexaveldanez alexaveldanez requested a review from st3phhays June 9, 2025 18:34
@alexaveldanez alexaveldanez marked this pull request as ready for review June 9, 2025 19:00
This allows for the dynamic code block component in choco-astro to
listen for values entered into input for code block components and
replace custom variables placed in the code block on a page.

This also fixes a small bug, where the "copy" button on dynamic code
blocks was not working properly and either not copying text, or not
updating the button text.

@st3phhays st3phhays left a comment

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.

LGTM!

@st3phhays st3phhays merged commit f93f290 into chocolatey:main Jun 10, 2025
3 checks passed
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.

Allow for dynamic values to be injected into code blocks

2 participants