utils

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// semanticVersionMatcher is taken from https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
	SemanticVersionMatcher = regexp.MustCompile(`v(?P<major>0|[1-9]\d*)\.(?P<minor>0|[1-9]\d*)\.(?P<patch>0|[1-9]\d*)(?:-(?P<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?P<buildmetadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?`)
)

Functions

func RegexCapture

func RegexCapture(r *regexp.Regexp, s string) (groups map[string]string)

Types

type Markdown added in v0.3.4

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

func ParseMarkdown added in v0.3.4

func ParseMarkdown(content string) *Markdown

func (*Markdown) EnsureSection added in v0.3.4

func (m *Markdown) EnsureSection(level int, headlinePrefix *string, headline string, contentLines []string) *MarkdownSection

EnsureSection ensures a section in the markdown and returns nil. If headlinePrefix is given and a headline with this prefix already exists, it returns the existing section.

func (*Markdown) String added in v0.3.4

func (m *Markdown) String() string

type MarkdownSection added in v0.3.4

type MarkdownSection struct {
	Level        int
	Heading      string
	ContentLines []string
}

Jump to

Keyboard shortcuts

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