-
Notifications
You must be signed in to change notification settings - Fork 207
Open
Description
I'd like to be able to write reusable snippets to parametrize the inside of a code block.
As a simple example, I'd like to do something like
export const MyCurlFunction = ({ url }) => {
const codeExample = `curl -X GET "${url}"`
return (
<Code>
content=codeExample,
language='bash'
</Code>
);
}
<MyCurlFunction
url="https://mintlify.com/docs/code"
/>
And this should be equivalent to:
```
curl -X GET "https://mintlify.com/docs/code"
```
As of now, this is not possible since jsx does not work inside backticks (obviously). I expected a way to directly call the Code component in jsx templates, but I could not make it work. I would you solve this?
Metadata
Metadata
Assignees
Labels
No labels