Documentation ¶
Index ¶
- func Contains(slice []string, val string) bool
- func ConvertTagsToString(tags []string) string
- func ParseTags(inputTags string) []string
- func Start(templatePath string, tags string, outputDirPath string, docType string)
- type Content
- type CurrentTime
- type DevlogFile
- type FileOps
- type TemplateReader
- type TextContent
- type Time
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Contains ¶ added in v1.0.0
Contains is a useful method for checking if a value exists in a slice
func ConvertTagsToString ¶ added in v1.0.0
ConvertTagsToString converts a string slice into a formatted string of tags
Types ¶
type Content ¶ added in v0.0.4
type Content struct { FormattedCurrentTime string TemplatePath string DocumentType string Tags string }
Content struct which has attributes we need for generating the document
func (Content) GenerateMarkdown ¶ added in v0.0.4
GenerateMarkdown takes the output from a template and outputs it into a string
func (Content) GetTemplate ¶ added in v1.0.0
GetTemplate gets our document template based on the input document type
func (Content) GetTemplatePath ¶ added in v0.0.4
GetTemplatePath gets the template path based on if an input is passed in or if an env var is set
type CurrentTime ¶ added in v0.0.4
type CurrentTime struct{}
CurrentTime is our struct for holding the current time
func (CurrentTime) GetCurrentDayAndTime ¶ added in v0.0.4
func (c CurrentTime) GetCurrentDayAndTime() time.Time
GetCurrentDayAndTime gets the current day and time and returns as a time.Time
type DevlogFile ¶ added in v1.0.0
DevlogFile holds metadata about files
func (DevlogFile) CreateFile ¶ added in v1.0.0
func (f DevlogFile) CreateFile() (*os.File, error)
CreateFile creates a file for devlog to save
func (DevlogFile) GenerateFileName ¶ added in v1.0.0
func (f DevlogFile) GenerateFileName(docType string) string
GenerateFileName generates the timestamped file prefixed with the document type TODO: refactor time.Now call here to use our time interface in util for testing
func (DevlogFile) GetFullOutputPath ¶ added in v1.0.0
func (f DevlogFile) GetFullOutputPath(docType string) string
GetFullOutputPath generates the full path with the specified directory and filename
func (DevlogFile) GetOutputPath ¶ added in v1.0.0
func (f DevlogFile) GetOutputPath() string
GetOutputPath gets a path and selects sensible defaults if one is not set
type FileOps ¶ added in v1.0.0
type FileOps interface { GetOutputPath() string GetFullOutputPath(docType string) string GenerateFileName(docType string) string CreateFile(docType string) (*os.File, error) SaveFile(outputMd string, file io.Writer, docType string) }
FileOps is the interface for devlog file operations
type TemplateReader ¶ added in v0.0.4
type TemplateReader interface { ReadTemplate() (*bytes.Buffer, error) GetTemplatePath() string GetTemplate() (string, error) }
TemplateReader interface for reading templates
type TextContent ¶ added in v0.0.4
type TextContent interface {
GenerateMarkdown() string
}
TextContent interface for text content generation