formatter

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package formatter contains everything related to changelog Formatters.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CustomTemplateFormatter added in v0.4.0

type CustomTemplateFormatter struct {
	// contains filtered or unexported fields
}

A CustomTemplateFormatter is a Formatter rendering changelogs with Go templates

func (*CustomTemplateFormatter) Format added in v0.4.0

func (it *CustomTemplateFormatter) Format(chlog *changelog.Changelog) (string, error)

Format renders the given changelog with the CustomTemplateFormatter's template.

type Formatter

type Formatter interface {
	// Format formats the given changelog.
	Format(changelog *changelog.Changelog) (string, error)
}

Formatter formats Changelogs.

func NewCustomTemplateFormatter added in v0.4.0

func NewCustomTemplateFormatter(goTemplate string) (Formatter, error)

NewCustomTemplateFormatter creates a new instance of a CustomTemplateFormatter

func NewMarkdownFormatter added in v0.4.0

func NewMarkdownFormatter(opts ...MarkdownOption) (Formatter, error)

NewMarkdownFormatter creates a new instance of a MarkdownFormatter

type MarkdownFormatter added in v0.4.0

type MarkdownFormatter struct {
	MarkdownOptions *markdownOptions
}

A MarkdownFormatter is a formatter rendering Markdown formats.

func (*MarkdownFormatter) Format added in v0.4.0

func (it *MarkdownFormatter) Format(changelog *changelog.Changelog) (string, error)

Format formats the given changelog in Markdown format.

type MarkdownOption added in v0.4.0

type MarkdownOption func(opt *markdownOptions)

A MarkdownOption sets options for markdown format such as whether or not to include scopes.

func WithScopes added in v0.4.0

func WithScopes() MarkdownOption

WithScopes includes scopes to markdown format.

Jump to

Keyboard shortcuts

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