-
-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use other tag inside Scrollycoding #478
Comments
One way is to change the Scrollycoding component to accept a Block instead of a CodeBlock, then you can render anything inside the sticky part. <Scrollycoding>
## !!steps A Game of Thrones
A Game of Thrones is the first book in the A Song of Ice and Fire series by George R.R. Martin. Set in a world where seasons last for years, it introduces a complex plot and a wide cast of characters, ranging from noble families vying for the Iron Throne to the supernatural threats in the North.
### !sticker
<CodeWithTooltips>
...
</CodeWithTooltips>
## !!steps ...
...
|
@pomber Thank you for your reply, I try several ways in the past few days but still couldn't figure it out: First WayI create a Schema like this:
And the MDX looks like:
I still got the error from
I don't know why the Schema didn't work. Second WayI created a Schema:
And try to access code and tooltips using
I still got
I wonder which part I missed, Thank you. |
In your first way, make the sticker a bare
and then you render the
|
Thank you so much. It works well!
so the tooltip class
@pomber Do you think we should add an demo for using nested tag? I can create a PR using my current example if needed. |
I'm trying to use Tag
<CodeWithTooltips>
inside<Scrollycoding>
like this:However, it tells me
I guess because I use the example for CodeWithTooltips which return
return <Pre code={highlighted} handlers={[tooltip]} />
It's not a code object so
<Scrollycoding>
can not parse it. So I tried another way to update the Code function for scrollycoding.tsx which would workHowever, I also want to use other tags like
<CodeSwitcher>
inside<Scrollycoding>
, Are there any better way to implement is?The text was updated successfully, but these errors were encountered: