newed

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package newed provides functions to create new projects from templates.

Index

Constants

View Source
const (
	BaseDirName = "_base"
)

Variables

This section is empty.

Functions

func Expand

func Expand(templates ...string) []string

Types

type Template

type Template struct {
	Name     string
	Dir      string
	Base     bool
	Sections []string
}

type Templates

type Templates map[string]Template

func New

func New(cfg *config.Config) (Templates, error)

New creates a new Templates object from the provided config.

func (Templates) Add

func (t Templates) Add(dir string) error

Add the provided template to Templates object if new; otherwise, replaces existing template with the same name.

func (Templates) Apply

func (t Templates) Apply(templates []string, path string, isNoop bool) error

Apply copies the templates to the provided path.

func (Templates) GetAllByDir

func (t Templates) GetAllByDir() map[string][]Template

func (Templates) Load

func (t Templates) Load(dirs ...string) error

Load reads the provided directories and adds any valid templates to the Templates object.

Jump to

Keyboard shortcuts

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