-
Notifications
You must be signed in to change notification settings - Fork 18k
x/pkgsite: interactive example playgrounds #44090
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
Comments
Change https://golang.org/cl/288989 mentions this issue: |
Change https://golang.org/cl/293830 mentions this issue: |
Change https://golang.org/cl/293833 mentions this issue: |
Change https://golang.org/cl/293832 mentions this issue: |
This change creates new endpoints to support interactive example playgrounds. Requests to "/play/compile" and "/play/share" are proxied to play.golang.org. Requests to "/play/fmt" are handled on the pkgsite server using the go/format package to format code sent in the request body. For golang/go#44090 Change-Id: If42fea540ae743a32b5afce7edf37b9133219720 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/288989 Trust: Jamal Carvalho <jamal@golang.org> Run-TryBot: Jamal Carvalho <jamal@golang.org> Reviewed-by: Jonathan Amsterdam <jba@google.com>
Copies body.tmpl and example.tmpl into legacy files to prepare for interactive playground related updates. For golang/go#44090 Change-Id: I2b7650693d3f3cc373c9a757048e0442ce37f1be Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/293830 Trust: Jamal Carvalho <jamal@golang.org> Run-TryBot: Jamal Carvalho <jamal@golang.org> TryBot-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Jonathan Amsterdam <jba@google.com>
Updates dochtml package to refer to legacy templates in preperation for changes related to interactive playgrounds. For golang/go#44090 Change-Id: I5c2c882190de72755a114374869aa050133aaa79 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/293832 Trust: Jamal Carvalho <jamal@golang.org> Run-TryBot: Jamal Carvalho <jamal@golang.org> TryBot-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Jonathan Amsterdam <jba@google.com>
Example playgrounds on documentation pages are editable and interactive. Below each example code snippet on the documentation page we’ll display buttons to run, format, and share the snippet. Pressing run displays the result output below the code snippet, format will reformat the code inline and share will display a share link below the code snippet and open the playground in a new window. For golang/go#44090 Change-Id: I56d635e60a89a382974ef7100eb4348dbbb4b893 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/293833 Trust: Jamal Carvalho <jamal@golang.org> Run-TryBot: Jamal Carvalho <jamal@golang.org> Reviewed-by: Julie Qiu <julie@golang.org>
Documentation pages on pkgsite display static code examples inline with a play button. When the play button is clicked a new tab will open that directs users to an external site (play.golang.org) that runs the code from the example.
In an effort to maintain feature parity with golang.org, we plan to update example playgrounds on documentation pages to be editable and interactive.

Below each example code snippet on the documentation page we’ll display buttons to run, format, and share the relevant example code. Pressing run displays the result output below the code snippet, format will reformat the code on the current page, and share will display a share link below the code snippet. The buttons will display only for examples that are playable.
The text was updated successfully, but these errors were encountered: