Documentation
¶
Index ¶
- func Process(fsys embed.FS, srcDir, dstDir string, data Data) error
- func ProcessMultiSource(fsys embed.FS, language, packageManager, dstDir string, data Data) error
- func ProcessPostQuickstart(fsys embed.FS, srcDir string, data Data) (string, error)
- func ProcessPostQuickstartMultiSource(fsys embed.FS, language, packageManager string, data Data) (string, error)
- type Data
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Process ¶
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
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 ¶
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.