utils

package
v0.0.0-...-dddee46 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Reset  = "\033[0m"
	Green  = "\033[32m"
	Red    = "\033[31m"
	Yellow = "\033[33m"
	Cyan   = "\033[36m"
	Bold   = "\033[1m"
)

Variables

This section is empty.

Functions

func ApplyCreationSteps

func ApplyCreationSteps(creationResponse string) bool

Applies creation steps based on the AI's response

func Color

func Color(line string, color string) string

func ComputeMD5

func ComputeMD5(path string) (string, error)

func Diff

func Diff(oldContent, newContent, filePath string)

Displays the differences between old and new content

func ExtractFileName

func ExtractFileName(urlStr string) (string, error)

func GetAvailableLanguages

func GetAvailableLanguages(lastAIResponse string) []string

func GetFilePathsInDirectory

func GetFilePathsInDirectory(dir string) []string

Retrieves file paths in a directory, skipping excluded directories

func HtmltoText

func HtmltoText(n *html.Node) string

func IsBinaryFile

func IsBinaryFile(filename string) bool

func IsDirectory

func IsDirectory(path string) bool

Checks if the path is a directory

func IsExcluded

func IsExcluded(name string, isDir bool) bool

func IsFile

func IsFile(path string) bool

Checks if the path is a file

func OpenTerm

func OpenTerm(fileName string, app string)

func ParseEditInstructions

func ParseEditInstructions(aiResponse string) map[string]string

Parses edit instructions from the AI's response

func ReadLines

func ReadLines(path string) ([]string, error)

func RenderMarkdown

func RenderMarkdown(txt string) string

func Snippet

func Snippet(text string, maxLength int) string

Snippet returns a truncated snippet of the text up to maxLength characters

func ToSnakeCase

func ToSnakeCase(s string) string

Types

type CodeBlock

type CodeBlock struct {
	Language string
	Content  string
}

func ExtractCodeBlocksByLanguage

func ExtractCodeBlocksByLanguage(response, language string) ([]CodeBlock, error)

Jump to

Keyboard shortcuts

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