tag

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HardNewLine = "  \n"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Basic

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

func (Basic) Placeholder

func (b Basic) Placeholder() string

func (Basic) String

func (b Basic) String() string

func (Basic) Type

func (b Basic) Type() Type

type Factory

type Factory func(input Raw) (Tag, error)

Factory describes a function which can convert a Raw tag into a normal Tag. If the resulting Tag does not return nil on Tag.Children(), it means that the children have been consumed and the next factory call should get a new slice.

type Raw

type Raw struct {
	Type        Type   `json:"type,omitempty"`
	Placeholder string `json:"placeholder,omitempty"`
	Filename    string `json:"filename,omitempty"`
	Line        int    `json:"line,omitempty"`
	Value       string `json:"value,omitempty"`
}

Raw represents a not yet processed tag.

type Tag

type Tag interface {
	Type() Type

	// String can be used to render the whole tag including the children.
	// The format may be chosen by the implementation, but it has to fit to the
	// other interface used implementations.
	String() string

	Placeholder() string
}

Tag which was parsed from the code.

func Code

func Code(input Raw) (Tag, error)

func Doc

func Doc(input Raw) (Tag, error)
func ProjectLink(input Raw) (Tag, error)

type Type

type Type string
var (
	TypeDoc     Type = "DOC"
	TypeLink    Type = "LINK"
	TypeCode    Type = "CODE"
	TypeCodeEnd Type = "CODE_END"
)

Jump to

Keyboard shortcuts

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