scaffold

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package scaffold - the starting files of a new module or theme (app module new, app theme new): a module of its own Go module with a page, its test, styles, translations and README; a theme with its manifest, stylesheet, translations and README. Both work as written: the module builds and passes its test, the theme passes app theme check.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ModuleFiles

func ModuleFiles(m Module) (map[string][]byte, error)

ModuleFiles - a new module's files by their path in its directory.

func ModuleName

func ModuleName(modulePath string) string

ModuleName - the machine name a module of Go module path gets by default: its last part, without a "kosatka-module-" or "kosatka-" prefix, "-" as "_".

func ThemeFiles

func ThemeFiles(t Theme) (map[string][]byte, error)

ThemeFiles - a new theme's files by their path in its directory.

func Write

func Write(dir string, files map[string][]byte) ([]string, error)

Write puts files into dir, which must not exist or be empty (nothing is overwritten); it returns their paths, sorted.

Types

type Module

type Module struct {
	Path, Name, EngineVersion, GoVersion string
}

Module - what a new module is: its Go module path, its machine name ("" - from the path's last part: "kosatka-module-notes" → "notes"), the engine release it requires ("v0.1.11"; "" - none: go mod tidy takes the latest) and the Go version of its go.mod ("1.27").

type Theme

type Theme struct {
	Name, Label, MinVersion string
}

Theme - what a new theme is: its name (its directory's), its label ("" - from the name: "sea-breeze" → "Sea breeze"), the oldest engine release it works with ("0.1.11"; "" - none named).

Jump to

Keyboard shortcuts

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