Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jdockerty/jsonnet-playground
Playground for Jsonnet, inspired by Go/Rust projects of similar names.
https://github.com/jdockerty/jsonnet-playground
golang htmx jsonnet jsonnet-playground kubecfg templ
Last synced: 2 months ago
JSON representation
Playground for Jsonnet, inspired by Go/Rust projects of similar names.
- Host: GitHub
- URL: https://github.com/jdockerty/jsonnet-playground
- Owner: jdockerty
- License: mit
- Created: 2024-04-29T10:56:56.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-06-06T08:55:28.000Z (7 months ago)
- Last Synced: 2024-06-19T14:55:11.458Z (6 months ago)
- Topics: golang, htmx, jsonnet, jsonnet-playground, kubecfg, templ
- Language: Go
- Homepage: https://jsonnet.jdocklabs.co.uk
- Size: 236 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jsonnet-playground
Inspired by the [Go playground](https://go.dev/play/) and others.
This project is built with Go, [`templ`][templ], and [htmx][htmx].
It is available at [jsonnet.jdocklabs.co.uk][hosted-playground] for anyone[^1] to use.
## How it works
Pages are directly rendered and served by the Go HTTP server through the `templ`
library.Jsonnet is taken as input and evaluated through the Jsonnet VM, available through
the `/api/run` path, and htmx's target functionality displays the evaluated input
or error message in the corresponding output box.Sharing is achieved through the creation of a shareable hash, the Jsonnet must be
valid to be shared.
If a shareable snippet has recently been created, it can be shared with others
by simply sending them the link. This will then be loaded by the server and displayed.### Features
- Evaluate Jsonnet in browser
- Share snippets with others
- Format snippets inline with `jsonnetfmt`
- Utilise the extended functionality of [`kubecfg`](https://github.com/kubecfg/kubecfg)## Development
The `justfile` in this repository provides various commands for local development.
`just run` will run the server and make the relevant static assets available[^2].
[^1]: Shared snippets are currently stored in memory, this is to keep the project near-free to run.
[^2]: The assets are named `kodata` alongside the server as the application is built and deployed with `ko`.[htmx]: https://htmx.org/docs/#introduction
[templ]: https://github.com/a-h/templ
[hosted-playground]: https://jsonnet.jdocklabs.co.uk