markdown

package
v0.0.0-...-3a64406 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package markdown implements sourcing unreleased entries from https://keepachangelog.com/en/1.0.0/

Index

Constants

View Source
const (
	ChangelogHeader = "Changelog"
	LevelFirst      = iota
	LevelSecond
	LevelThird
)

Variables

View Source
var (
	ErrNoChangelogHeader      = errors.New("no Changelog top-header found")
	ErrEmptyHeldHeader        = errors.New("held header found with empty content")
	ErrNoUnreleasedL2Header   = errors.New("changelog must contain a L2 Unreleased header, even if it is empty")
	ErrL2WrongChildren        = errors.New("header can only contain L3 headers")
	ErrL3HeaderEmptyContent   = errors.New("header found with empty content")
	ErrL3HeaderNoItemizedList = errors.New("header must contain only an itemized list")
)

Functions

This section is empty.

Types

type Markdown

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

Markdown is a changelog.Source that produces a changelog.Changelog from a markdown file that resembles the [Keep a changelog](https://keepachangelog.com/en/1.0.0/) format.

func New

func New(r io.Reader) Markdown

New returns a new Markdown source that will consume the specified reader. No reads are performed until Markdown.Changelog is called.

func (Markdown) Changelog

func (m Markdown) Changelog() (*changelog.Changelog, error)

Changelog reads the supplied reader into memory and parses the contents. An empty, non-nil changelog will not result in an error, but a very wrongly formatted one will.

type Validator

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

Validator is an object that validates a headingdoc.Doc.

func NewValidator

func NewValidator(r io.Reader) (Validator, error)

NewValidator returns a new Validator for a headingdoc.Doc read from the supplied reader.

func (*Validator) Validate

func (v *Validator) Validate() []error

Validate ensures the changelog has a correct format.

Directories

Path Synopsis
Package merger contains the Merger object, which incorporates a changelog.Changelog into a full markdown changelog.
Package merger contains the Merger object, which incorporates a changelog.Changelog into a full markdown changelog.

Jump to

Keyboard shortcuts

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