{"id":13413259,"url":"https://github.com/nikolaydubina/htmljson","last_synced_at":"2026-03-16T11:36:11.172Z","repository":{"id":144719392,"uuid":"615584197","full_name":"nikolaydubina/htmljson","owner":"nikolaydubina","description":"🫐 Rich rendering of JSON as HTML in Go","archived":false,"fork":false,"pushed_at":"2024-03-21T11:31:40.000Z","size":574,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-05-01T14:34:55.523Z","etag":null,"topics":["code-editor","code-formatting","code-visualization","data-formatting","go","golang","html","json","rendering","test-editor","visualization"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nikolaydubina.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"nikolaydubina"}},"created_at":"2023-03-18T04:10:28.000Z","updated_at":"2024-05-09T05:37:44.689Z","dependencies_parsed_at":"2024-01-07T21:54:02.328Z","dependency_job_id":"a2f6f7d5-9fd1-4efb-8266-051259f9c02b","html_url":"https://github.com/nikolaydubina/htmljson","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikolaydubina%2Fhtmljson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikolaydubina%2Fhtmljson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikolaydubina%2Fhtmljson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikolaydubina%2Fhtmljson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nikolaydubina","download_url":"https://codeload.github.com/nikolaydubina/htmljson/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253156650,"owners_count":21862971,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code-editor","code-formatting","code-visualization","data-formatting","go","golang","html","json","rendering","test-editor","visualization"],"created_at":"2024-07-30T20:01:36.298Z","updated_at":"2026-03-16T11:36:06.140Z","avatar_url":"https://github.com/nikolaydubina.png","language":"Go","readme":"## 🫐 htmljson: rich rendering of JSON as HTML in Go\n\n[![codecov](https://codecov.io/gh/nikolaydubina/htmljson/branch/master/graph/badge.svg?token=yXmNdIDn8O)](https://codecov.io/gh/nikolaydubina/htmljson)\n[![Go Report Card](https://goreportcard.com/badge/github.com/nikolaydubina/htmljson)](https://goreportcard.com/report/github.com/nikolaydubina/htmljson)\n[![Go Reference](https://pkg.go.dev/badge/github.com/nikolaydubina/htmljson.svg)](https://pkg.go.dev/github.com/nikolaydubina/htmljson)\n[![Mentioned in Awesome Go](https://awesome.re/mentioned-badge.svg)](https://github.com/avelino/awesome-go)\n[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/nikolaydubina/htmljson/badge)](https://securityscorecards.dev/viewer/?uri=github.com/nikolaydubina/htmljson)\n\n* pure Go\n* no Javascript\n* no dependencies\n* no `reflect`\n* no `fmt`\n* 300 LOC\n* customizable rendering\n* JSON Path for elements access\n\n![](./doc/example-color.png)\n\n```go\n// JSON has to be any\nvar v any\njson.Unmarshal(exampleJSON, \u0026v)\n\nhtmlPage := htmljson.DefaultPageMarshalerm.Marshal(v)\n```\n\n```go\n// JSON has to be any\nvar v any\njson.Unmarshal(exampleJSON, \u0026v)\n\n// customize how to render HTML elements\ns := htmljson.Marshaler{\n    Null:   htmljson.NullHTML,\n    Bool:   htmljson.BoolHTML,\n    String: htmljson.StringHTML,\n    Number: func(k string, v float64, s string) string {\n        if k == \"$.cakes.strawberry-cake.size\" {\n            return `\u003cdiv class=\"json-value json-number\" style=\"color:red;\"\u003e` + s + `\u003c/div\u003e`\n        }\n        if v \u003e 10 {\n            return `\u003cdiv class=\"json-value json-number\" style=\"color:blue;\"\u003e` + s + `\u003c/div\u003e`\n        }\n        return `\u003cdiv class=\"json-value json-number\"\u003e` + s + `\u003c/div\u003e`\n    },\n    Array: htmljson.DefaultArrayHTML,\n    Map:   htmljson.DefaultMapHTML,\n    Row:   htmljson.DefaultRowHTML{Padding: 4}.Marshal,\n}\n\nm := htmljson.DefaultPageMarshaler\nm.Marshaler = \u0026s\n\n// write HTML page\nhtmlPage := m.Marshal(v)\n```\n\n## Related Work\n\n- https://github.com/alecthomas/chroma can render many languages into HTML with syntax highligting\n","funding_links":["https://github.com/sponsors/nikolaydubina"],"categories":["JSON"],"sub_categories":["Search and Analytic Databases","检索及分析资料库"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikolaydubina%2Fhtmljson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnikolaydubina%2Fhtmljson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikolaydubina%2Fhtmljson/lists"}