generator

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateForBundleMode added in v1.1.0

func GenerateForBundleMode(outputScriptPath string, imports []string, funcs []finder.FunctionToCall, inputDir string, outputDir string) error

GenerateForBundleMode creates an output script when mode=bundle, transforming templ files to HTML.

func GenerateForInlineMode added in v1.1.0

func GenerateForInlineMode(outputScriptPath string, imports []string, funcs []finder.FunctionToCall, outputPath string) error

GenerateForInlineMode creates an output script when mode=inline, transforming templ files to HTML in their respective directories.

func RunTemplFmt

func RunTemplFmt(files []string, done chan<- struct{}) error

RunTemplFmt runs the templ fmt command to format templ files.

func RunTemplGenerate

func RunTemplGenerate(done chan<- struct{}) error

RunTemplGenerate runs the templ generate command to generate Go code from templ files.

Types

type InputData

type InputData struct {
	Imports         []string
	FilesToGenerate []StringedData
}

InputData holds the data required by the output script template.

type StringedData

type StringedData struct {
	FuncToCall  string
	FilePath    string
	PackageName string
}

StringedData represents the necessary information for generating an HTML file from a templ function.

Jump to

Keyboard shortcuts

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