Devcards provides interactive visual environment for Go, in a way that's similar to REPL and computational notebooks such as Jupyter.
A devcard is a playground for visualizations and quick experiments. You write its code with our own editor in you own codebase, and the devcards web app turns it into a web page that's shown in your browser. The app watches your project's source files and re-renders the page on each save.
See this short video for a quick demonstration.
Perhaps the easiest place to start is to the devcard examples repo.
If you went through the examples already (or have no patience for toy code) follow the following instructions.
Install the devcards web app:
go install github.com/igorhub/devcard/cmd/devcards@latest
Add devcard dependency to your Go modules (I recommend making a separate branch for it):
go get github.com/igorhub/devcard
Start devcards from your project's directory (alternatively, add your project to the config file):
cd /path/to/your/project
devcards
Write your first devcard:
package yourpackage
import "github.com/igorhub/devcard"
func DevcardFoobar(dc *devcard.Devcard) {
dc.SetTitle("Untitled")
dc.Md("This is a new devcard...")
}
For introduction into devcards, see devcard examples pages.
For API reference, see https://godocs.io/github.com/igorhub/devcard.
Devcards is a young project. I've done reasonable job ironing out the bugs, but I expect some to still lurk beneath the surface. In most cases simply refreshing the page will fix everything. Still, please let me know about the errors you encounter. This will make the project better. I appreciate your help.
-
Devcards owes its name and primary idea to Bruce Hauman's devcards, although it's more bare-bones and limited in scope.
-
Devcards' builtin CSS style is based upon the excellent new.css.
-
Ace of Spades icon is designed by DesignContest / CC BY.