iafan / goplayspace Goto Github PK
View Code? Open in Web Editor NEWAdvanced Go Playground frontend written in Go, with syntax highlighting, turtle graphics mode, and more
Home Page: https://goplay.space
License: Other
Advanced Go Playground frontend written in Go, with syntax highlighting, turtle graphics mode, and more
Home Page: https://goplay.space
License: Other
'js' package looks pretty common and reusable.
Does it make sense to move it to separate repo, or use go 1.11 modules ?
./build-client && ./build-server
cannot find package "github.com/gopherjs/vecty" in any of:
/opt/go/src/github.com/gopherjs/vecty (from $GOROOT)
/home/tamer/code/go/src/github.com/gopherjs/vecty (from $GOPATH)
Source:
package main
import (
"fmt"
"log"
)
func main() {
c := make(chan struct{})
main:
for {
select {
case <-c:
break main
default:
break
}
log.Println("below select")
}
fmt.Println("Documentation is for users.")
}
https://goplay.space/#n_Dw6DNrWCX output:
invalid character 'F' looking for beginning of value
https://play.golang.org/p/n_Dw6DNrWCX output:
2009/11/10 23:00:00 below select
2009/11/10 23:00:00 below select
...
Lately I've noticed that for longer code snippets the placement of the insert cursor is off. It becomes unclear which line it is on. I suspect this is a CSS issue related to line height.
Hi thank you for the app, but it would be great if we have option for side to side layout for editor and console. thanks in advance.
this will the layout look like https://imgur.com/jy8tprB
Hi.
The two panels (code and 'About Go Play Space') are separated by a component that should allow change their size, but it's not working. I tried in Firefox and Chrome.
Thanks
The auto-pairing is painful. When I type func f(){}
I end up with func f(){}})
. When I type m["b"]
I end up with m["b"]"]
. I'm spending equal time typing code and backspacing over typos I didn't type.
I recognize that some coders are accustomed to this behavior but I don't think it should default to enabled.
Is is possible, that the window pops out only when a function is highlighted, otherwise remains hidden?
On a DO droplet, CentOS 7.3, Go 1.9
[root@123 tmp]# go get -u github.com/gopherjs/gopherjs
[root@123 tmp]# go get -u github.com/gopherjs/vecty
[root@123 tmp]# go get -u github.com/iafan/goplayspace/...
# github.com/iafan/goplayspace/client/component/log
/root/Projects/golang/src/github.com/iafan/goplayspace/client/component/log/log.go:34:29: undefined: vecty.MarkupOrComponentOrHTML
/root/Projects/golang/src/github.com/iafan/goplayspace/client/component/log/log.go:38:16: undefined: vecty.MarkupOrComponentOrHTML
[root@123 tmp]# cd $GOPATH/src/github.com/iafan/goplayspace/bin
[root@123 bin]# ./build-client && ./build-server
component/log/log.go:34:29: MarkupOrComponentOrHTML not declared by package vecty
component/log/log.go:38:16: MarkupOrComponentOrHTML not declared by package vecty
component/log/log.go:111:12: cannot use l.getEvents() (value of type []invalid type) as []github.com/gopherjs/vecty.MarkupOrChild value in argument to elem.Div
gzip: client.js: No such file or directory
gzip: client.js.map: No such file or directory
In Mac, undo and redo shortcuts are Cmd+Z and Cmd+Shift+Z respectively, however goplayspace only obeys to the former. The latter does nothing, and I've seen redo works via Cmd+Y. I'm aware you are implementing a custom undo/redo stack, so this is probably something related to keyboard shortcut binding.
Binary const declaration like const b = 0b100
does not work.
package main
import (
"fmt"
)
func main() {
const a = 100
const b = 0b100
fmt.Println(a + b)
}
This code reports an error message while it should run properly:
9:13: expected ';', found 'IDENT' b100 (and 2 more errors)
E.g. when typing fmt.
the user would see:
fmt.Pr
fmt.Println()
fmt.Scan()
...
I could try implementing this if this is of interest.
I'm getting a NET::ERR_CERT_AUTHORITY_INVALID error when first accessing https://goplay.space/ in chrome 60.0.3112.90 (Official Build) (64-bit) on a windows 10 machine. I get the same error in Firefox 53.0 (32-bit) and ssl labs says that this is due to a missing intermediate cert:
https://www.ssllabs.com/ssltest/analyze.html?d=goplay.space
There are workarounds available in the browsers now (add security exception, etc) but it's probably better to fix the certs in case the browsers block the workaround in later versions.
I'm trying to embed https://goplay.space in an interactive training course and due to the "ShowSidebar" option being enabled by default, it doesn't render very nice until the user configures it within the iframe.
Would it be possible to support query strings for setting the config?
Trying to diagnose junk input bytes, I wanted to copy paste whatever it was
I did successfully turn bytes into invisible string and copy paste, but the editor broke:
https://goplay.space/#Xfsy91fp2Z
vs https://play.golang.org/p/Xfsy91fp2Z
RT. It'd be much more convenient to organize code snippets via this tool.
Hello, shameless plug here ๐.
I created the browser extension Go Ground2Space [Source-code]. The extension automatically opens the equivalent go play-space url instead of a given go-playground url.
(Note that, for now, it only supports chrome/edge but there are plans for supporting other popular browsers in future)
This extension is targeted mainly at people who are frequent or exclusive users of go play-space (instead of go-playground). It is convenient for them since, whenever they click on a random playground link somewhere (or someone shares one with them), they can rest assured that it will open up with syntax highlighting goodness!
I thought that it might be useful for such users to know that such an extension exists. Would you consider noting the existence of the extension somewhere on your repo or readme?
When I move the caret around, by clicking or by using the arrow keys, the caret takes some time (up to ~1 second) to actually display at the right place.
Happening on firefox 93 running on Windows 10. No issue on chromium 81
I am not sure why it was not added but I think it would be quite nice to also get a hotkey to share snippet from keyboard.
I am running Go 1.8.3 on macOS 10.12.5.
build-client
returns the following error:
cannot find package "fmt" in any of:
/usr/local/Cellar/go/1.8.1/libexec/src/fmt (from $GOROOT)
/Users/damien/go/src/fmt (from $GOPATH)
build-server
runs without issue.
Turtle graphics mode is a lovely feature in goplayspace. However, it can appear to be slow at times.
It would be great to add support for a fast mode that is controlled by the code itself. This would not only be useful if a fast drawing is desired, but also for debugging.
As a suggestion, fast mode could be specified as an option to draw mode
- for example, draw mode fasttab
. This could be equivalent to continuously hitting Tab on the drawing board. Another option could be draw mode fastshift
which would be equivalent to keeping the Shift-key pressed in the drawing.
Other options are also possible, such as draw mode final
- which is like a super fast mode and shows the final drawing as fast as possible i.e. without showing the intervening steps.
After paste code to this playspace the mouse point place will a litttle higher then before.
Currently goplay.space doesn't support generics, it would be cool if it did.
I see however that it hasn't had a commit in a long time.
Sorry for creating an issue for this, but how do I go about customizing goplayspace?
For example,
Compare the copy-paste output of https://goplay.space/#sELgya5VUCI to https://play.golang.org/p/sELgya5VUCI. The newlines are preserved on copy-paste using the official playground. They are not preserved using goplayspace
. This was tested on a Mac running v10.14.5 of macOS Mojave. Other system details can be provided upon request (locale, keyboard layout, browser(s) tested, etc.).
I recommend using a <span>
instead of a <div>
for the stdout
since this seems to fix the issue. I'm a bit busy to implement this, but I can take care of this if everyone else is in a similar boat. Please advise.
I'd be curious to know why this is happening, too (corollary: why <span>
seems to fix the issue).
Can you help me with adding a download button to get the raw files from play.golang.org?
Expected: I can declare var v int = 0b11010
Actual: 8:15: expected ';', found 'IDENT' b11010 (and 1 more errors)
Repros:
https://play.golang.org/p/Sw9HFvlcmMr
https://goplay.space/#Sw9HFvlcmMr
I found recently that I want to try multiple different things at once. It would be wonderful if the placespace supported editor tabs.
workarounds I can do but prefer not to.
Some thoughts regarding possible implementation:
Specifically, I would like to see go vet
.
I want to highlight some code in my text editor and make a link to a playground of it that I can share. Without me going to goplayspace first, pasting in text there, pressing share and then getting the link.
Is this possible to do?
I love the features of the Go playspace. Nice work! Shouldn't it default to the Go fonts, though:
When following the instructions in README to compile goplayspace, I got the following error:
cannot find package "github.com/gopherjs/vecty" in any of:
/usr/local/opt/go/libexec/src/github.com/gopherjs/vecty (from $GOROOT)
/Users/xliao/go/src/github.com/gopherjs/vecty (from $GOPATH)
gzip: can't stat: client.js (client.js): No such file or directory
gzip: can't stat: client.js.map (client.js.map): No such file or directory
And then save that option next time user comes back to the site.
I have already read it and I just want to see the code. Thank you.
Am I able to close "About Go Play Space"?
It's great for the first load, then it becomes a distraction.
I really miss the cursor.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.