core

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const SectionSep string = "_"

The string separating the index and the name. If changed, make a due notice to users and either ensure backwards compatibility or have Doctor change the format automatically.

Variables

This section is empty.

Functions

func PathsFromSections added in v0.0.3

func PathsFromSections(secs []Section) []string

Takes a list of Section structs and returns a list of the corresponding paths.

Types

type Section added in v0.0.3

type Section struct {
	Path  string
	Title string
	Index int
}

Represents a section in the document.

func FindSectionMatches added in v0.1.3

func FindSectionMatches(input string, secs []Section, minus int) ([]Section, error)

Finds all sections that match the input. Returns an error if no sections match. 'minus' is subtracted from the index matching statement, used in the case of looping over multiple inputs to match against.

func SectionFromPath added in v0.0.3

func SectionFromPath(path string) (Section, error)

Creates a new Section struct from the input path.

func (*Section) ChangeIndex added in v0.0.3

func (s *Section) ChangeIndex(i int) error

Changes the index of this section by renaming the file it represents.

func (Section) IsEqual added in v0.0.5

func (s Section) IsEqual(other Section) bool

Check whether this section is equal to another. Checks if their paths are equal.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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