Documentation
¶
Overview ¶
Package hyperlink provides terminal hyperlink configuration for clog.
Index ¶
- func ClearFormats()
- func Enabled() bool
- func OSC8(url, text string) string
- func PathDisplayText(path string, line, column int) string
- func ResolvePathURL(path string, line, column int) string
- func Restore(s Snapshot)
- func SetColumnFormat(format string)
- func SetDirFormat(format string)
- func SetEnabled(e bool)
- func SetFileFormat(format string)
- func SetLineFormat(format string)
- func SetPathFormat(format string)
- func SetPreset(name string) error
- type Snapshot
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PathDisplayText ¶
PathDisplayText returns the display string for a path hyperlink.
func ResolvePathURL ¶
ResolvePathURL builds the full hyperlink URL for a file path.
func Restore ¶
func Restore(s Snapshot)
Restore resets the hyperlink configuration to a previously saved Snapshot.
func SetColumnFormat ¶
func SetColumnFormat(format string)
SetColumnFormat configures the URL format for file+line+column hyperlinks.
Accepts a full format string or a preset name (e.g. "vscode"). Known presets: cursor, kitty, macvim, textmate, vscode, vscode-insiders, vscodium.
Use {path}, {line}, and {column} (or {col}) as placeholders.
func SetDirFormat ¶
func SetDirFormat(format string)
SetDirFormat configures the URL format for directory hyperlinks.
Accepts a full format string or a preset name. Falls back to SetPathFormat if not set.
func SetEnabled ¶
func SetEnabled(e bool)
SetEnabled enables or disables all hyperlink rendering. When disabled, hyperlink functions return plain text without OSC 8 sequences.
func SetFileFormat ¶
func SetFileFormat(format string)
SetFileFormat configures the URL format for file-only hyperlinks (used by Path and PathLink with line 0, when the path is not a directory).
Accepts a full format string or a preset name. Falls back to SetPathFormat if not set.
func SetLineFormat ¶
func SetLineFormat(format string)
SetLineFormat configures the URL format for file+line hyperlinks.
Accepts a full format string or a preset name (e.g. "vscode").
func SetPathFormat ¶
func SetPathFormat(format string)
SetPathFormat configures the generic fallback URL format for any path.
Accepts a full format string or a preset name.