utils

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2021 License: MIT Imports: 3 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) AppendSection added in v0.3.5

func (m *Markdown) AppendSection(s *MarkdownSection)

func (*Markdown) FindSectionByHeading added in v0.3.5

func (m *Markdown) FindSectionByHeading(level int, headline string) *MarkdownSection

func (*Markdown) FindSectionByHeadingPrefix added in v0.3.5

func (m *Markdown) FindSectionByHeadingPrefix(level int, headlinePrefix string) *MarkdownSection

func (*Markdown) PrependSection added in v0.3.5

func (m *Markdown) PrependSection(s *MarkdownSection)

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
	SubSections  []*MarkdownSection
}

func (*MarkdownSection) AppendChild added in v0.3.5

func (m *MarkdownSection) AppendChild(child *MarkdownSection)

func (*MarkdownSection) AppendContent added in v0.3.5

func (m *MarkdownSection) AppendContent(contentLines []string)

func (*MarkdownSection) PrependChild added in v0.3.5

func (m *MarkdownSection) PrependChild(child *MarkdownSection)

func (*MarkdownSection) PrependContent added in v0.3.5

func (m *MarkdownSection) PrependContent(contentLines []string)

func (*MarkdownSection) String added in v0.3.5

func (m *MarkdownSection) String() string

Jump to

Keyboard shortcuts

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