Closed jdamiba closed 4 years ago
FYI @nicolas this PR incorporates all the QA from and supersedes https://github.com/plotly/documentation/pull/1605
@nicolas I have updated the styling of inline charts (removed border) and moved the try it on codepen
button into the code area.
Could we trim the whitespace above the button a bit and change the font on it to be open sans plz?
The React page is a bit wonky, because there is the "try it on codepen" link on all the examples, even the ones that don't have an embed and don't run, like the npm install
block, and the ones that do. We should not show the "try it" button in these cases
Some of these examples don't work because they try to write to an non-myDiv
div: http://localhost:4000/javascript/hover-events/
The top one here needs the myDiv
conversion: http://localhost:4000/javascript/disable-zoom/
Actually there are quite a few places where we need to suppress the "try it" button, e.g. at the top of http://localhost:4000/javascript/tick-formatting/
Maybe we can just show it if there is myDiv
in the string (and there is no actual embedded pen)? that's probably a decent heuristic
This one doesn't work because it uses require
http://localhost:4000/javascript/colorway/ ... we should ensure that anything that uses require
either gets a workaround or goes back to being embedded in a pen.
This is getting super, super close! Let's clear up the last few comments I made here and we can merge this this week :)
Even if we rely on a bunch of CodePens for now, the mere possibility of creating new docs without them is great, and the fact that most of our examples are not using CodePen directly any more is a huge win.
The purpose of this PR is to inline the example charts in the Plotly.js documentation while preserving the
edit on codepen
functionality. This will allow contributors to write docs without having to worry about maintaining a separate codepen, while users still get the benefit of being able to use/edit live code snippets.In order to accomplish this, I
embed:true
front-matter property so that charts that require special DOM elements can remain as codepen embedsmyDiv
as container div for chartauto_examples.html
to inline chartsedit on codepen
button that submits a POST request to dynamically generate the codepenBefore:
After:
closes https://github.com/plotly/documentation/issues/1587