Documentation
¶
Overview ¶
Package pluginutil provides shared utilities for krate's built-in plugins (file walking, HTML template building, path helpers). Community plugins are written in JavaScript and do not use this package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResolvePath ¶
ResolvePath creates any needed directories and returns the absolute path.
Types ¶
type FileWriter ¶
type FileWriter struct {
// contains filtered or unexported fields
}
FileWriter is a helper for collecting multiple files.
func (*FileWriter) Files ¶
func (fw *FileWriter) Files() []File
Files returns the accumulated files.
func (*FileWriter) WriteFile ¶
func (fw *FileWriter) WriteFile(path, content string)
WriteFile adds a file. The path is relative to the output directory.
type HTMLTemplate ¶
type HTMLTemplate struct {
// contains filtered or unexported fields
}
HTMLTemplate provides a simple, fast HTML template builder. Unlike text/template or html/template, it uses a builder pattern that avoids reflection for maximum speed.
func (*HTMLTemplate) Esc ¶
func (h *HTMLTemplate) Esc(s string)
Esc writes a string with HTML escaping to the template.
func (*HTMLTemplate) Reset ¶
func (h *HTMLTemplate) Reset()
Reset clears the template builder for reuse.
func (*HTMLTemplate) String ¶
func (h *HTMLTemplate) String() string
String returns the built template string.
func (*HTMLTemplate) Wf ¶
func (h *HTMLTemplate) Wf(format string, args ...interface{})
Wf writes a formatted string to the template.