Htmljson
🫐 Rich rendering of JSON as HTML in Go
Install / Use
/learn @nikolaydubina/HtmljsonREADME
🫐 htmljson: rich rendering of JSON as HTML in Go
<p align="center"> ✨ Sponsored by <a href="https://apps.apple.com/app/id6738306589">NDX AI Shopping Assistant</a> </p>- pure Go
- no Javascript
- no dependencies
- no
reflect - no
fmt - 300 LOC
- customizable rendering
- JSON Path for elements access

// JSON has to be any
var v any
json.Unmarshal(exampleJSON, &v)
htmlPage := htmljson.DefaultPageMarshalerm.Marshal(v)
// JSON has to be any
var v any
json.Unmarshal(exampleJSON, &v)
// customize how to render HTML elements
s := htmljson.Marshaler{
Null: htmljson.NullHTML,
Bool: htmljson.BoolHTML,
String: htmljson.StringHTML,
Number: func(k string, v float64, s string) string {
if k == "$.cakes.strawberry-cake.size" {
return `<div class="json-value json-number" style="color:red;">` + s + `</div>`
}
if v > 10 {
return `<div class="json-value json-number" style="color:blue;">` + s + `</div>`
}
return `<div class="json-value json-number">` + s + `</div>`
},
Array: htmljson.DefaultArrayHTML,
Map: htmljson.DefaultMapHTML,
Row: htmljson.DefaultRowHTML{Padding: 4}.Marshal,
}
m := htmljson.DefaultPageMarshaler
m.Marshaler = &s
// write HTML page
htmlPage := m.Marshal(v)
Related Work
- https://github.com/alecthomas/chroma can render many languages into HTML with syntax highligting
Related Skills
node-connect
338.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
xurl
338.0kA CLI tool for making authenticated requests to the X (Twitter) API. Use this skill when you need to post tweets, reply, quote, search, read posts, manage followers, send DMs, upload media, or interact with any X API v2 endpoint.
frontend-design
83.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
338.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
