Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Generate ¶
func Generate(opts GenerateOptions) error
func Preprocess ¶
Preprocess takes the contents of a readme file and preprocesses it by replacing readmegen tags with the corresponding Go templates. A readmegen tag is a HTML comment with the following format: <!-- readmegen:tag --> which has a corresponding end tag <!-- /readmegen:tag -->. Everything between the tags is replaced with the corresponding template. If the tag is not found, or a comment is not closed, an error is returned.
Types ¶
type GenerateOptions ¶
type GenerateOptions struct { // Required fields Data any // The data to use in template generation ReadmePath string // Path to the readme template file Out io.Writer // Where to write the generated output // Optional fields FuncMap template.FuncMap // Custom function map to merge with default functions TemplatesFS fs.FS // Custom templates directory to merge with default templates }
Click to show internal directories.
Click to hide internal directories.