Document

package
v0.2.40 Latest Latest
Warning

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

Go to latest
Published: May 12, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Document

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

Document is a generic data structure that represents a document.

func NewDocument added in v0.2.36

func NewDocument(sentences ...string) *Document

NewDocument creates a new document.

Parameters:

  • sentences: The sentences to add to the document.

Returns:

  • *Document: A pointer to the newly created document.

func (*Document) AddLine added in v0.2.36

func (d *Document) AddLine(sentences ...string) *Document

AddLine adds sentences to the document separated by a space. The line is split by the newline character.

Parameters:

  • line: The line to add.

Returns:

  • *Document: A pointer to the document. This allows for chaining.

Example:

  • AddLine("Hello,", "world!")
  • AddLine("This is a sentence.")

func (*Document) FString added in v0.2.36

func (d *Document) FString(indentLevel int) []string

FString returns the formatted string representation of the document.

Parameters:

  • indentLevel: The level of indentation.

Returns:

  • []string: The formatted string representation of the document.

func (*Document) String added in v0.2.36

func (d *Document) String() string

String returns the string representation of the document.

Returns:

  • string: The string representation of the document.

func (*Document) Tmp added in v0.2.37

func (d *Document) Tmp() []string

Jump to

Keyboard shortcuts

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