-
Notifications
You must be signed in to change notification settings - Fork 0
rewrite snackplayer with remark plugin #4
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
Conversation
hey where did the deploy previews disappear : / |
I'm not sure either 🤔 |
Do note the showcase, versions, and landing page won't work in this branch as of now. |
website/core/RemarkPlugins.js
Outdated
data-snack-description="${description}" | ||
data-snack-code="${encodedSampleCode}" | ||
data-snack-platform="${platform}" | ||
data-snack-supported-platforms=${supportedPlatforms} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we add quotes there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, basically the plugin injects HTML in place of the SnackPlayer code blocks so
data-snack-description="${description}"
will be data-snack-description="Description of the snackplayer"
in the page
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean data-snack-supported-platforms
specifically does not have quotes will the others have, is it normal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added them in 574838e
This reverts commit 79cf632.
Possibly related issue: SnackPlayers within Docusaurus tabs disappear after switching tabs: |
Thanks, There should be a call like https://snack.expo.io/embed.js Docusaurus v2 is more "lazy", I think only the first tab is in the DOM on first render, and on navigation the dom ready events don't wire again. |
It's present in |
Might be the reason why snackplayer load on reload, any suggestions on where to put the ExpoSnack initialize call? |
I'm not sure, this must be called on navigation + on tab switch :) Maybe it's the remark plugin that should add an inline <script> just after the snack player div? I've seen this PR but not sure if it has ever been used nor documented: facebook/docusaurus#1591 @yangshun do you think it's a good usecase for the onRouteUpdate? |
Look at the google analytics plugin to see an example usage of |
One more thing that need to be implemented is SnackPlayer theme sync with Docusaurus theme. I have asked Expo related person about the tip or guidance how this can be achieved. |
@darshkpatel Can you extract the tabs changes to the separate PR? It would be nice to have them on |
If I'm not mistaken, you're referring to |
@darshkpatel Yup, you're right. I don't know why this coded ended here but I have created very simple issue about the tabs #20. Also on the SnackPlayer topic - it should not be available on mobile platforms (code block with the correct highlight should be rendered instead of it): |
Just a head's up, I'm currently working on a general Remark Plugin for SnackPlayer as discussed. |
Closing in favor of #31 |
Note: Merge #3 before this PR ( Branched from #3 )
I've re-written the snackpayer because v2 supports remark plugin instead of remarkable plugin