forked from facebook/react-native-website
-
Notifications
You must be signed in to change notification settings - Fork 0
remove prism code-blocks #32
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
88 changes: 9 additions & 79 deletions
88
website/plugins/remark-snackplayer/tests/output/output1.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,83 +1,13 @@ | ||
| <div class="snack-player"> | ||
| <div class="mobile-friendly-snack" style="display: none"> | ||
| <pre class="language-jsx"> | ||
| <code class="language-jsx"> | ||
| <span class="token keyword">import</span> React <span class="token keyword">from</span> <span class="token string">'react'</span><span class="token punctuation">;</span> | ||
| <span class="token keyword">import</span> <span class="token punctuation">{</span> Text<span class="token punctuation">,</span> View <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'react-native'</span><span class="token punctuation">;</span> | ||
|
|
||
| <span class="token keyword">const</span> <span class="token function-variable function">YourApp</span> <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token punctuation">{</span> | ||
| <span class="token keyword">return</span> <span class="token punctuation">(</span> | ||
| <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">View</span></span> <span class="token attr-name">style</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token punctuation">{</span> flex<span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span> justifyContent<span class="token operator">:</span> <span class="token string">"center"</span><span class="token punctuation">,</span> alignItems<span class="token operator">:</span> <span class="token string">"center"</span> <span class="token punctuation">}</span><span class="token punctuation">}</span></span><span class="token punctuation">></span></span><span class="token plain-text"> | ||
| </span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Text</span></span><span class="token punctuation">></span></span><span class="token plain-text"> | ||
| Try editing me! 🎉 | ||
| </span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Text</span></span><span class="token punctuation">></span></span><span class="token plain-text"> | ||
| </span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">View</span></span><span class="token punctuation">></span></span> | ||
| <span class="token punctuation">)</span><span class="token punctuation">;</span> | ||
| <span class="token punctuation">}</span> | ||
|
|
||
| <span class="token keyword">export</span> <span class="token keyword">default</span> YourApp<span class="token punctuation">;</span> | ||
| </code> | ||
| </pre> | ||
| </div> | ||
| <div class="desktop-friendly-snack"> | ||
| <div | ||
| data-snack-name="Hello World" | ||
| data-snack-description="Example usage" | ||
| data-snack-code="import%20React%20from%20'react'%3B%0Aimport%20%7B%20Text%2C%20View%20%7D%20from%20'react-native'%3B%0A%0Aconst%20YourApp%20%3D%20()%20%3D%3E%20%7B%0A%20%20%20%20return%20(%0A%20%20%20%20%3CView%20style%3D%7B%7B%20flex%3A%201%2C%20justifyContent%3A%20%22center%22%2C%20alignItems%3A%20%22center%22%20%7D%7D%3E%0A%20%20%20%20%20%20%20%20%3CText%3E%0A%20%20%20%20%20%20%20%20Try%20editing%20me!%20%F0%9F%8E%89%0A%20%20%20%20%20%20%20%20%3C%2FText%3E%0A%20%20%20%20%3C%2FView%3E%0A%20%20%20%20)%3B%0A%7D%0A%0Aexport%20default%20YourApp%3B" | ||
| data-snack-platform="web" | ||
| data-snack-supported-platforms="ios,android,web" | ||
| data-snack-preview="true" | ||
| style="overflow:hidden;background:#fafafa;border:1px solid rgba(0,0,0,.08);border-radius:4px;height:505px;width:100%" | ||
| ></div> | ||
| </div> | ||
| <div | ||
| data-snack-name="Hello World" | ||
| data-snack-description="Example usage" | ||
| data-snack-code="import%20React%20from%20'react'%3B%0Aimport%20%7B%20Text%2C%20View%20%7D%20from%20'react-native'%3B%0A%0Aconst%20YourApp%20%3D%20()%20%3D%3E%20%7B%0A%20%20%20%20return%20(%0A%20%20%20%20%3CView%20style%3D%7B%7B%20flex%3A%201%2C%20justifyContent%3A%20%22center%22%2C%20alignItems%3A%20%22center%22%20%7D%7D%3E%0A%20%20%20%20%20%20%20%20%3CText%3E%0A%20%20%20%20%20%20%20%20Try%20editing%20me!%20%F0%9F%8E%89%0A%20%20%20%20%20%20%20%20%3C%2FText%3E%0A%20%20%20%20%3C%2FView%3E%0A%20%20%20%20)%3B%0A%7D%0A%0Aexport%20default%20YourApp%3B" | ||
| data-snack-platform="web" | ||
| data-snack-supported-platforms="ios,android,web" | ||
| data-snack-preview="true" | ||
| style="overflow:hidden;background:#fafafa;border:1px solid rgba(0,0,0,.08);border-radius:4px;height:505px;width:100%" | ||
| ></div> | ||
| </div> | ||
|
|
||
| <script async src="https://snack.expo.io/embed.js"></script> | ||
| <link | ||
| rel="stylesheet" | ||
| href="https://cdn.jsdelivr.net/npm/prism-solarized-dark@1.0.1/prism-solarizeddark.css" | ||
| /> | ||
| <script type="text/javascript"> | ||
| // From: | ||
| (function() { | ||
| "use strict"; | ||
| if (typeof document === "undefined") { | ||
| // Not on browser | ||
| return; | ||
| } | ||
| document.addEventListener("DOMContentLoaded", init); | ||
|
|
||
| function init() { | ||
| var mobile = isMobile(); | ||
|
|
||
| window.ExpoSnack && window.ExpoSnack.initialize(); | ||
|
|
||
| var snackPlayerList = document.querySelectorAll(".snack-player"); | ||
|
|
||
| // Either show interactive or static code block, depending on desktop or mobile | ||
| for (var i = 0; i < snackPlayerList.length; ++i) { | ||
| var snackPlayer = snackPlayerList[i]; | ||
| var snackDesktopPlayer = snackPlayer.querySelectorAll( | ||
| ".desktop-friendly-snack" | ||
| )[0]; | ||
| var plainCodeExample = snackPlayer.querySelectorAll( | ||
| ".mobile-friendly-snack" | ||
| )[0]; | ||
|
|
||
| if (mobile) { | ||
| snackDesktopPlayer.remove(); | ||
| plainCodeExample.style.display = "block"; | ||
| } else { | ||
| plainCodeExample.remove(); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| // Primitive mobile detection | ||
| function isMobile() { | ||
| return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test( | ||
| navigator.userAgent | ||
| ); | ||
| } | ||
| })(); | ||
| </script> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this 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 have removed this script today, it is unnecessary in the case of RN website (I have tested the deployed site), because it has been added globally in config:
Also this script might be redundant overall, at the end of implementation, because the
snackPlayerInitializeris performing similar operations to the original Snack embedded script.