templatelowering

package
v4.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: MIT Imports: 8 Imported by: 0

README

Template Lowering Experiment

This is the bounded template-first experiment for the compiler-assisted backlog.

The experiment is intentionally narrow:

  • one constrained HTML-like template input
  • one readable generated Go output file
  • no hidden runtime mode
  • ordinary html and ui package output only

Input:

  • landing.template.html

Generated output:

  • generated_landing.go

Regenerate from the repo root:

go run ./examples/public/browser-compiler/template_lowering/cmd/lower-template `
  -input ./examples/public/browser-compiler/template_lowering/landing.template.html `
  -output ./examples/public/browser-compiler/template_lowering/generated_landing.go

Current limits are deliberate:

  • only a tiny supported tag set
  • placeholder fields must be whole text nodes like {{.Headline}}
  • no control flow, loops, or event binding

That makes the generated Go easy to inspect and keeps the experiment clearly optional instead of competing with the normal Go-first authoring model.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(parseInput []byte, parseConfig TemplateConfig) (string, error)

func GenerateFromFile

func GenerateFromFile(parsePath string, parseConfig TemplateConfig) (string, error)

func RenderLanding

func RenderLanding(props LandingProps) ui.Node

Types

type LandingProps

type LandingProps struct {
	Eyebrow      string
	Headline     string
	Summary      string
	PrimaryTag   string
	SecondaryTag string
}

type TemplateConfig

type TemplateConfig struct {
	PackageName string
	StructName  string
	FuncName    string
}

Directories

Path Synopsis
cmd
lower-template command

Jump to

Keyboard shortcuts

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