Documentation ¶
Overview ¶
Package helpers ...
Package helpers ...
Package helpers ...
Package helpers ...
Package helpers ...
Package helpers ...
Package helpers ...
Index ¶
- func BuildTemplate(tplPath string, funcs template.FuncMap, data *config.TemplateData) *config.TplConfig
- func ExecuteCommandC(root *cobra.Command, args ...string) (c *cobra.Command, err error)
- func GetAllPublicPages(fs afero.Fs, path string) []string
- func GetAllResources(fs afero.Fs, path string) []string
- func GetAllResourcesWithContentName(fs afero.Fs, path string, children bool) []*config.ResourceItem
- func GetResourceContentMap(fs afero.Fs, resources []string, path string) map[string][]string
- func GetResourceMetadataMap(fs afero.Fs, resources []string, path string) map[string][]string
- func GetResourceRouteFilename(txt string, c *config.SveltinConfig) string
- func InitAppTemplatesMap() map[string]config.AppTemplate
- func IsValidFileForContent(f fs.FileInfo) bool
- func MakeFileContent(efs *embed.FS, content builder.Content) []byte
- func NewNoPageItems(resources []string, content map[string][]string, metadata map[string][]string, ...) *config.NoPageItems
- func PrepareContent(name string, resources map[string]string, templateId string, ...) builder.Content
- func PublicPageFilename(name string, pageType string) string
- func ResourceExists(fs afero.Fs, name string, c *config.SveltinConfig) error
- func RunPMCommand(pmName string, pmCmd string, mode string, packages []string, silentMode bool) error
- func WriteContentToDisk(fs afero.Fs, saveAs string, fileContent []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildTemplate ¶ added in v0.3.0
func BuildTemplate(tplPath string, funcs template.FuncMap, data *config.TemplateData) *config.TplConfig
BuildTemplate creates TplConfig struct with all is needed for a golang template to be executed
func ExecuteCommandC ¶
ExecuteCommandC is a @DEPRECATED function, not used anymore.
func GetAllPublicPages ¶
GetAllPublicPages return a slice of all available public page names as string.
func GetAllResources ¶
GetAllResources returns a slice of resource names as string.
func GetAllResourcesWithContentName ¶
GetAllResourcesWithContentName traverses the resource contents and returns a slice of ResourceItem.
func GetResourceContentMap ¶
GetResourceContentMap returns a map of resources and relative contents.
func GetResourceMetadataMap ¶
GetResourceMetadataMap returns a map of metadata and relative name.
func GetResourceRouteFilename ¶
func GetResourceRouteFilename(txt string, c *config.SveltinConfig) string
GetResourceRouteFilename returns a string representing the index and slug routes for a resource.
func InitAppTemplatesMap ¶
func InitAppTemplatesMap() map[string]config.AppTemplate
InitAppTemplatesMap creates a map[string]string containining project name and repo url used by the `sveltin new` command to clone the starter project.
func IsValidFileForContent ¶
IsValidFileForContent checks is the provided FileInfo has valid extension (.svelte, .svx, .mdx) to be used as content file.
func MakeFileContent ¶
MakeFileContent executes the template file with all its data and functions and returns the content file as []byte
func NewNoPageItems ¶
func NewNoPageItems(resources []string, content map[string][]string, metadata map[string][]string, pages []string) *config.NoPageItems
NewNoPageItems return a NoPageItems.
func PrepareContent ¶
func PrepareContent(name string, resources map[string]string, templateId string, data *config.TemplateData) builder.Content
PrepareContent returns a builder.Content struct used by the builder director.
func PublicPageFilename ¶
PublicPageFilename returns the filename string for a public page based on the page type (svelte or markdown).
func ResourceExists ¶
ResourceExists return nil if a Resource identified by name exists.
Types ¶
This section is empty.