package lines

import "git.sr.ht/~bouncepaw/mycomarkup/v5/util/lines"

Package line provides a datatype for text lines that are generated by package tag.

Index

Types

type Line

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

Line is a line of text.

func IndentableFrom

func IndentableFrom(contents string) Line

IndentableFrom returns a line that you can and will indent. Use for most tags.

func UnindentableFrom

func UnindentableFrom(contents string) Line

UnindentableFrom returns a line that you cannot indent. Use for codeblocks and stuff like that.

func (Line) Contents

func (l Line) Contents() string

Contents returns line's contents

func (Line) Indented

func (l Line) Indented() Line

Indented returns a copy of the line with one more indentation (for indentable lines) or the same line (for unindentable lines).

func (Line) IsIndentable

func (l Line) IsIndentable() bool

IsIndentable is true if the line is indentable.

func (Line) String

func (l Line) String() string

String returns the line with the appropriate number of indentations (\t) and a newline.

Source Files

line.go

Version
v5.6.0 (latest)
Published
Nov 29, 2023
Platform
linux/amd64
Imports
1 packages
Last checked
8 hours ago

Tools for package owners.