onsong

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2024 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SplitParagraphs

func SplitParagraphs(content string) [][]string

Types

type Chord

type Chord struct {
	Value   string
	Padding int
}
type LanguageLink struct {
	LanguageName string
	SongName     string
}

func ParseMetadata

func ParseMetadata(paragraph []string, includedKeys []string) ([]string, string, []LanguageLink)

type Line

type Line struct {
	Parts []LinePart
}

type LinePart

type LinePart struct {
	IsChord bool
	Chord   Chord
	Text    string
}

type Section

type Section struct {
	Title string
	Lines []Line
}

func ParseSections

func ParseSections(paragraphs [][]string, defaultPadding int, paddingSensitivity int) []Section

type Song

type Song struct {
	Title         string
	Artist        string
	Meta          []string
	LanguageLinks []LanguageLink
	Sections      []Section
	Copyright     string
}

func Parse

func Parse(content string, metadataKeys []string, defaultPadding int, paddingSensitivity int) (Song, bool)

Jump to

Keyboard shortcuts

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