Skip to content

docs: snippet variable substitution in code blocks#5941

Closed
mintlify-development[bot] wants to merge 1 commit into
mainfrom
mintlify/workflow-6a10edc8-2-snippets-variable-substitution-i
Closed

docs: snippet variable substitution in code blocks#5941
mintlify-development[bot] wants to merge 1 commit into
mainfrom
mintlify/workflow-6a10edc8-2-snippets-variable-substitution-i

Conversation

@mintlify-development
Copy link
Copy Markdown
Contributor

@mintlify-development mintlify-development Bot commented May 23, 2026

Summary

Documents that snippet props passed as string values are now substituted into fenced code blocks inside the snippet, using the same {propName} syntax already used in prose.

Changes

  • Added a new "Use variables in code blocks" subsection under "Import snippets with variables" in create/reusable-snippets.mdx with an {packageManager}/{packageName} example.
  • Noted that only string props are substituted and that unmatched {...} placeholders are left unchanged, so existing code samples are not affected.
  • Mirrored the new section into the Spanish, French, and Chinese translations.

Context

Snippet components can now expose string props inside fenced code blocks, not just prose and JSX expressions, making it easier to share commands and config that vary per importing page.


Note

Low Risk
Low risk documentation-only change that adds guidance and examples; no runtime code paths are modified.

Overview
Documents that snippet props can be substituted inside fenced code blocks (not just prose) using the existing {propName} placeholder syntax, with a new install-command example.

Adds a note clarifying that only string props are substituted in code blocks and unmatched placeholders remain unchanged, and mirrors the new subsection across the Spanish, French, and Chinese translations.

Reviewed by Cursor Bugbot for commit 77aab7c. Bugbot is set up for automated code reviews on this repo. Configure here.

@mintlify
Copy link
Copy Markdown
Contributor

mintlify Bot commented May 23, 2026

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
mintlify 🟢 Ready View Preview May 23, 2026, 12:12 AM

@mintlify
Copy link
Copy Markdown
Contributor

mintlify Bot commented May 23, 2026

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
testsignup415 🟢 Ready View Preview May 23, 2026, 12:12 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

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