No description
Find a file
Virgil b9e2630da3
All checks were successful
Security Scan / security (push) Successful in 9s
Test / test (push) Successful in 59s
feat(html): allow swapping context translators
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-31 20:44:15 +00:00
.core chore: add .core/ build and release configs 2026-03-06 18:52:36 +00:00
.forgejo/workflows ci: add Forgejo Actions test and security scan workflows 2026-02-23 03:28:02 +00:00
.github/workflows ci: add Core ecosystem CI workflow with CodeRabbit auto-fix 2026-03-17 14:05:43 +00:00
cmd feat(codegen): add watch mode for bundle generation 2026-03-31 20:04:21 +00:00
codegen feat(codegen): add TypeScript definitions generator 2026-03-31 19:48:15 +00:00
docs feat(html): allow swapping context translators 2026-03-31 20:44:15 +00:00
specs docs(specs): add codegen RFC 2026-03-27 21:50:33 +00:00
.editorconfig chore: add Go repo norms (badges, contributing, lint, taskfile, editorconfig) 2026-02-23 06:45:38 +00:00
.gitignore refactor(module): migrate module path from forge.lthn.ai to dappco.re 2026-03-22 01:28:30 +00:00
.golangci.yml chore: add Go repo norms (badges, contributing, lint, taskfile, editorconfig) 2026-02-23 06:45:38 +00:00
bench_test.go refactor(core): upgrade to v0.8.0-alpha.1 2026-03-26 15:24:16 +00:00
CLAUDE.md refactor(module): migrate module path from forge.lthn.ai to dappco.re 2026-03-22 01:28:30 +00:00
context.go feat(html): allow swapping context translators 2026-03-31 20:44:15 +00:00
context_test.go feat(html): allow swapping context translators 2026-03-31 20:44:15 +00:00
CONTRIBUTING.md chore: add Go repo norms (badges, contributing, lint, taskfile, editorconfig) 2026-02-23 06:45:38 +00:00
doc.go fix(conventions): isolate banned imports and clarify tests 2026-03-26 11:15:24 +00:00
edge_test.go fix(html): preserve switch wrapper paths 2026-03-31 20:07:35 +00:00
go.mod chore: bump i18n v0.2.0 → v0.2.1 2026-03-27 07:26:33 +00:00
go.sum chore: bump i18n v0.2.0 → v0.2.1 2026-03-27 07:26:33 +00:00
integration_test.go chore: polish ax v0.8.0 conventions 2026-03-26 18:12:06 +00:00
layout.go feat(html): preserve layout paths in iterators 2026-03-31 20:27:50 +00:00
layout_test.go fix(html): default nil render contexts 2026-03-31 19:22:02 +00:00
Makefile fix(dx): update CLAUDE.md size gate, sync Makefile limit, add coverage tests 2026-03-17 08:21:15 +00:00
node.go feat(html): apply attrs through iterator wrappers 2026-03-31 20:40:44 +00:00
node_test.go feat(html): apply attrs through iterator wrappers 2026-03-31 20:40:44 +00:00
path.go fix(html): validate block ID parsing 2026-03-31 19:55:44 +00:00
path_test.go fix(html): validate block ID parsing 2026-03-31 19:55:44 +00:00
pipeline.go fix(core): harden remaining nil-safe rendering paths 2026-03-30 00:09:50 +00:00
pipeline_test.go fix(tests): complete ax naming compliance 2026-03-27 04:55:58 +00:00
README.md feat(html): add accessibility attribute helpers 2026-03-31 19:28:53 +00:00
render.go fix(core): harden nil-safe rendering paths 2026-03-29 23:10:48 +00:00
render_test.go chore: polish ax v0.8.0 conventions 2026-03-26 18:12:06 +00:00
responsive.go feat(html): add responsive variant selector helper 2026-03-31 19:44:30 +00:00
responsive_test.go feat(html): add responsive variant selector helper 2026-03-31 19:44:30 +00:00
SESSION-BRIEF.md docs: add session brief for expert agent work 2026-02-19 17:38:47 +00:00
test_helpers_test.go refactor(core): upgrade to v0.8.0-alpha.1 2026-03-26 15:24:16 +00:00
text_builder_default.go refactor(core): upgrade to v0.8.0-alpha.1 2026-03-26 15:24:16 +00:00
text_builder_js.go refactor(core): upgrade to v0.8.0-alpha.1 2026-03-26 15:24:16 +00:00
text_translate.go fix(wasm): keep server i18n out of js builds 2026-03-26 11:31:31 +00:00
text_translate_default.go fix(wasm): keep server i18n out of js builds 2026-03-26 11:31:31 +00:00
text_translate_js.go fix(wasm): keep server i18n out of js builds 2026-03-26 11:31:31 +00:00

Go Reference License: EUPL-1.2 Go Version

go-html

HLCRF DOM compositor with grammar pipeline integration for server-side HTML generation and optional WASM client rendering. Provides a type-safe node tree (El, Text, Raw, If, Each, Switch, Entitled, AriaLabel, AltText), a five-slot Header/Left/Content/Right/Footer layout compositor with deterministic data-block path IDs and ARIA roles, a responsive multi-variant wrapper, a server-side grammar pipeline (StripTags, GrammarImprint via go-i18n reversal, CompareVariants), a build-time Web Component codegen CLI, and a WASM module (2.90 MB raw, 842 KB gzip) exposing renderToString().

Module: forge.lthn.ai/core/go-html Licence: EUPL-1.2 Language: Go 1.25

Quick Start

import "forge.lthn.ai/core/go-html"

page := html.NewLayout("HCF").
    H(html.El("nav", html.Text("i18n.label.navigation"))).
    C(html.El("main",
        html.El("h1", html.Text("i18n.label.welcome")),
        html.Each(items, func(item Item) html.Node {
            return html.El("li", html.Text(item.Name))
        }),
    )).
    F(html.El("footer", html.Text("i18n.label.copyright")))

rendered := page.Render(html.NewContext("en-GB"))

Documentation

  • Architecture — node interface, HLCRF layout, responsive compositor, grammar pipeline, WASM module, codegen CLI
  • Development Guide — building, testing, WASM build, server/client split rules
  • Project History — completed phases and known limitations

Build & Test

go test ./...
go test -bench . ./...
GOOS=js GOARCH=wasm go build -ldflags="-s -w" -o gohtml.wasm ./cmd/wasm/
go build ./...

Licence

European Union Public Licence 1.2 — see LICENCE for details.