jsonnet-playground

module
v0.0.0-...-53bbe6e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 6, 2024 License: MIT

README

jsonnet-playground

Inspired by the Go playground and others.

This project is built with Go, templ, and htmx.

It is available at jsonnet.jdocklabs.co.uk 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

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.

Directories

Path Synopsis
cmd
server command
internal
components
templ: version: v0.2.663
templ: version: v0.2.663

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL