text

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: MIT Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package text groups the tools that work on plain text.

Index

Constants

View Source
const (
	LangUnified = "diff"
	LangSide    = "diff-side"
)

Result.Lang values the TUI uses to colour the output.

Variables

This section is empty.

Functions

func IdentWords added in v1.0.0

func IdentWords(s string, splitDigits bool) []string

IdentWords splits identifiers and phrases into words: at any character that is not a letter or a digit, at lower→upper (fooBar), before the last capital of an acronym (HTTPServer → HTTP Server) and, with splitDigits, between letters and digits (v2 → v 2).

func TitleWord added in v1.0.0

func TitleWord(w string) string

TitleWord capitalises the first letter and lowercases the rest.

Types

type Case added in v0.2.0

type Case struct{}

Case converts each line between naming styles (camelCase, snake_case…) and text cases (Title, Sentence…).

func (Case) Run added in v0.2.0

func (c Case) Run(ctx context.Context, req tool.Request) (tool.Result, error)

func (Case) Spec added in v0.2.0

func (Case) Spec() tool.Spec

type Diff

type Diff struct{}

Diff compares two texts by lines or by words.

func (Diff) Run

func (d Diff) Run(ctx context.Context, req tool.Request) (tool.Result, error)

func (Diff) Spec

func (Diff) Spec() tool.Spec

type Inspect added in v0.2.0

type Inspect struct{}

Inspect counts characters, words and lines, and sorts, deduplicates or reverses lines.

func (Inspect) Run added in v0.2.0

func (i Inspect) Run(ctx context.Context, req tool.Request) (tool.Result, error)

func (Inspect) Spec added in v0.2.0

func (Inspect) Spec() tool.Spec

type Markdown added in v1.0.0

type Markdown struct{}

Markdown previews Markdown. Run only passes the text through with Lang "markdown": render draws it with Glamour at the panel's width, in the run goroutine, like any other colouring. Without colour (pipes, NO_COLOR) the output is the source.

func (Markdown) Run added in v1.0.0

func (m Markdown) Run(ctx context.Context, req tool.Request) (tool.Result, error)

func (Markdown) Spec added in v1.0.0

func (Markdown) Spec() tool.Spec

Jump to

Keyboard shortcuts

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