displaytext

package
v1.5.182 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2026 License: MIT Imports: 5 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 displaytext provides bounded, display-only text transformations shared by native and terminal views. It never changes stored tool messages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrettyJSON

func PrettyJSON(text string) string

PrettyJSON preserves numeric spelling/key order and leaves non-JSON alone. Reject deep or expansion-heavy inputs before json.Indent allocates output.

func PrettyJSONRead added in v1.5.89

func PrettyJSONRead(text string) string

PrettyJSONRead formats the JSON body of the read tool's numbered output. Each source line is prefixed with a line number and a tab; reformatting the body would otherwise fail json.Valid. Large minified documents are often cut by the read tool's per-line budget, so an incomplete prefix is still laid out structurally and the original truncation marker is retained. Line numbers and trailing read notices are preserved; a document that is not JSON-like is returned exactly as it came in.

Types

This section is empty.

Jump to

Keyboard shortcuts

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