templates

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultReadmeSpec added in v0.2.5

func DefaultReadmeSpec() config.FileSpec

DefaultReadmeSpec returns a FileSpec that renders the built-in README template. It is emitted when the legacy AddDefaultReadme flag is set.

func GenerateReadme

func GenerateReadme(org, repo string) (string, error)

GenerateReadme generates a README.md content from template

func MatchesRepo added in v0.2.5

func MatchesRepo(spec config.FileSpec, repo string) bool

MatchesRepo reports whether a FileSpec applies to the named repository. An empty Only list matches every repo; otherwise any single glob match (path.Match semantics) is sufficient.

func RenderFile added in v0.2.5

func RenderFile(spec config.FileSpec, data FileData) (string, error)

RenderFile executes spec.Content as a text/template and returns the result. Template errors are wrapped with the file's path so operators can trace the offending entry.

Types

type FileData added in v0.2.5

type FileData struct {
	Org  string
	Repo string
}

FileData is the context passed to every FileSpec.Content template.

type ReadmeData

type ReadmeData struct {
	Org  string
	Repo string
}

ReadmeData holds the data for README template

Jump to

Keyboard shortcuts

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