template

package
v0.8.5-33-gdc59dbf2 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//go:embed CODING_STYLE.md.tmpl
	CodingStyleTemplate string

	//go:embed Config.uk.tmpl
	ConfigUkTemplate string

	//go:embed CONTRIBUTING.md.tmpl
	ContributingTemplate string

	//go:embed COPYING.md.tmpl
	CopyingTemplate string

	//go:embed main.c.tmpl
	MainTemplate string

	//go:embed Makefile.uk.tmpl
	MakefileUkTemplate string

	//go:embed README.md.tmpl
	ReadmeTemplate string
)

Functions

func SaveGitIntialCommitAndBranch

func SaveGitIntialCommitAndBranch(dir, authorName, authorEmail, message, branch string) error

Types

type LibTemplate

type LibTemplate struct {
	ProjectName       string
	LibName           string
	LibKName          string
	LibKNameUpperCase string
	Version           string
	Description       string
	AuthorName        string
	AuthorEmail       string
	ProvideCMain      bool
	WithDocs          bool
	WithPatchedir     bool
	GitInit           bool
	InitialBranch     string
	CopyrightHolder   string
	Year              int
	Commit            string
	OriginUrl         string

	KconfigDependencies []string
	SourceFiles         []string
}

func NewTemplate

func NewTemplate(ctx context.Context, topts ...LibTemplateOption) (LibTemplate, error)

func (LibTemplate) Generate

func (t LibTemplate) Generate(ctx context.Context, workdir string) error

Generate template using `.tmpl` files and `Template` struct fields.

type LibTemplateOption

type LibTemplateOption func(*LibTemplate)

func WithAuthorEmail

func WithAuthorEmail(authorEmail string) LibTemplateOption

func WithAuthorName

func WithAuthorName(authorName string) LibTemplateOption

func WithCopyrightHolder

func WithCopyrightHolder(copyrightHolder string) LibTemplateOption

func WithDescription

func WithDescription(description string) LibTemplateOption

func WithGitInit

func WithGitInit(gitInit bool) LibTemplateOption

func WithInitialBranch

func WithInitialBranch(initialBranch string) LibTemplateOption

func WithLibKName

func WithLibKName(libKName string) LibTemplateOption

func WithLibName

func WithLibName(libName string) LibTemplateOption

func WithOriginUrl

func WithOriginUrl(origin string) LibTemplateOption

func WithPatchdir

func WithPatchdir(patchedir bool) LibTemplateOption

func WithProjectName

func WithProjectName(projectName string) LibTemplateOption

func WithProvideCMain

func WithProvideCMain(ProvideCMain bool) LibTemplateOption

func WithVersion

func WithVersion(version string) LibTemplateOption

Jump to

Keyboard shortcuts

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