Documentation
¶
Overview ¶
silkgen converts a designer-produced .silkui file into a Go source snippet using silk/decl's builder DSL. Wraps the snippet in a minimal Go file with package + imports + a build function so the output is drop-in compilable.
Usage:
silkgen path/to/main.silkui # writes to stdout silkgen -o gen.silk.go path/to/main.silkui # writes to a file silkgen -package mypkg main.silkui # custom package name silkgen -func BuildMain main.silkui # custom function name
The output skeleton:
// Code generated by silkgen — DO NOT EDIT.
package <package>
import "github.com/uk0/silk/decl"
func <Func>() *decl.Node {
return decl.Form(...)
}
Re-running silkgen on the same .silkui yields byte-identical output (subject to gofmt). This makes the tool safe to wire into go:generate directives.
Click to show internal directories.
Click to hide internal directories.