-
Notifications
You must be signed in to change notification settings - Fork 512
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
Should we support CodePen and JSFiddle buttons for live examples? #1428
Comments
I don't really remember the history of these buttons; they've been around for as long as I can remember. I've certainly never used one, and I don't know if our users use them much? I wonder if we are able to get any telemetry on this? The only time I've ever had any interaction with them is when hacking the macro call to turn them off, because certain examples don't work with them very well. |
We actually do keep analytics on those button clicks. If this link works you'll see that in the past ~30 days there has been:
Combined, let's say that's 40k. In the same window of time, we've had 42M pageviews. So that's 0.1% of pageviews leads to a click on one of those buttons. |
Here's the code that injects the buttons: https://github.com/mdn/kuma/blob/master/kuma/javascript/src/live-examples.js |
But wait a minute! It's supposed to work on the read-only site. On the read-only site we have this code: https://github.com/mdn/kuma/blob/ab5e687f2df75e6466c32068a686158a2dfe37a1/kuma/javascript/src/article.jsx#L70-L80 |
Oh. I can totally reproduce the bug now. On http://localhost.org:8000/en-US/docs/Web/HTML/Element/progress <h2 id="Examples">Examples</h2>
<pre class="brush: html">...</pre> and the code does the equivalent of this pseudo code: var section = document.getElementById('#Examples')
var htmlCode = section.querySelectorAll('pre[class*=html]')
if (htmlCode) {
...proceed to inject the Codepen button...
} In other words, I don't think this has worked for ages. |
|
For 3: Do you track interaction with Mozilla Demos? It allows to explore a new API right away. The alternative could be a link out to CodePen / JSFiddle / other interactive REPLs. |
Regarding this I have nothing against CodePen and the possibility to edit the code but I would really like to see them in a new card without frames as editor made them |
Since it bit me a few times in recent days … |
@Ryuno-Ki these buttons take the live examples and dynamically inject them into anonymous CodePen/JSFiddle instances, so that's not a problem. We don't maintain those separately. |
I like a lot as a developer what GitHub's RAW button is. I don't like BLAME instead, it creates too many assumptions. In view of receiving credit as a developer having commits on GitHub, I would prefer, if I were to modify those codes, to do it directly in a PR and not on CodePen which does not give me credit. |
@escattone @chrisdavidmills Have we reached a decision on this one? I guess we still do not support them and we have not had any issues asking about them so, perhaps we can just close this one? |
@schalkneethling I think we can close this, yes. |
cc @chrisdavidmills @peterbe @ddbeck
Live examples on the Wiki pages (e.g., https://wiki.developer.mozilla.org/en-US/docs/Web/CSS/:active) (but not the main site -- https://developer.mozilla.org/en-US/docs/Web/CSS/:active) show
Open in CodePen
andOpen in JSFiddle
buttons:Like https://developer.mozilla.org, we don't support them on our Yari pages:
Should we? I can't remember if this was a deliberate product decision or something we missed on https://developer.mozilla.org.
The text was updated successfully, but these errors were encountered: