templater

package
v0.75.2 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Process

func Process(fsys embed.FS, srcDir, dstDir string, data Data) error

Process reads all files from the specified directory within the embedded filesystem, executes them as text/templates with the provided data, and writes the results to the destination directory, preserving the directory structure. Files named POST_QUICKSTART.md are skipped and not copied to the destination.

func ProcessMultiSource added in v0.75.2

func ProcessMultiSource(fsys embed.FS, language, packageManager, dstDir string, data Data) error

ProcessMultiSource processes templates from multiple source directories (shared + package-manager-specific). It first processes files from the shared directory, then overlays package-manager-specific files. For languages that support multiple package managers (python, typescript), this function expects:

  • shared directory: templates/LANG/shared/
  • package manager directory: templates/LANG/PACKAGE_MANAGER/

For languages with a single package manager (go), it falls back to the language root directory.

func ProcessPostQuickstart

func ProcessPostQuickstart(fsys embed.FS, srcDir string, data Data) (string, error)

ProcessPostQuickstart reads and processes the POST_QUICKSTART.md file from the template directory. Returns the processed content as a string, or empty string if the file doesn't exist.

func ProcessPostQuickstartMultiSource added in v0.75.2

func ProcessPostQuickstartMultiSource(fsys embed.FS, language, packageManager string, data Data) (string, error)

ProcessPostQuickstartMultiSource reads and processes the POST_QUICKSTART.md file from the package-manager-specific directory. For languages with multiple package managers, it looks in templates/LANG/PACKAGE_MANAGER/. For Go, it looks in the templates/go/ directory. Returns the processed content as a string, or empty string if the file doesn't exist.

Types

type Data

type Data struct {
	Name           string
	PackageManager string
}

Data holds the template data passed to each file.

Jump to

Keyboard shortcuts

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