silkgen

command
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 7 Imported by: 0

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.

Jump to

Keyboard shortcuts

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