Documentation
¶
Overview ¶
Package render sets up the interface for rendering a .claw file to a language native representation. It also supports registering the handlers of those renderers (which are in other packages).
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Supported = map[Lang]Renderer{}
Supported is langauges that we have registered support for.
Functions ¶
This section is empty.
Types ¶
type Lang ¶
type Lang uint8
Lang represents a programming language we can render a from a .claw file.
type MultiFileRenderer ¶
type MultiFileRenderer interface {
Renderer
// RenderAdditionalFiles returns additional files to generate.
// The map keys are filenames (e.g., "clawiter.go"), values are file contents.
RenderAdditionalFiles(ctx context.Context, config *imports.Config, path string) (map[string][]byte, error)
}
MultiFileRenderer is an optional interface that renderers can implement to generate additional files beyond the main output.
type Rendered ¶
type Rendered struct {
// Package is the Claw package this represents.
Package string
// RepoVersion is the version the repo is at.
RepoVersion string
// Path is the path in the local filesystem that source .claw file can be found at.
Path string
// Lang is the language this is for.
Lang Lang
// Native is the output for the language (main file).
Native []byte
// Files contains additional generated files (filename -> content).
// The main file is in Native, additional files like clawiter.go are here.
Files map[string][]byte
}
Rendered represents rendered output for a language.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package golang implements the Go language renderer.
|
Package golang implements the Go language renderer. |
Click to show internal directories.
Click to hide internal directories.