formatters

package
v0.13.3 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildNodeNames

func BuildNodeNames(paths []string) map[string]string

BuildNodeNames returns stable, distinct display names for file paths. Paths that share the same base name are disambiguated by increasing path suffix depth.

func SupportedFormats

func SupportedFormats() string

SupportedFormats returns a list of all supported output format names.

Types

type Formatter

type Formatter interface {
	// Format converts a dependency graph to a formatted string representation.
	Format(g depgraph.FileDependencyGraph, opts RenderOptions) (string, error)
	// GenerateURL creates a shareable URL for the formatted output.
	// Returns the URL and true if supported, or ("", false) if not.
	GenerateURL(output string) (string, bool)
}

Formatter is the interface that all graph formatters must implement.

type OutputFormat

type OutputFormat int

OutputFormat represents an output format type

const (
	OutputFormatDOT OutputFormat = iota
	OutputFormatMermaid
)

func ParseOutputFormat

func ParseOutputFormat(s string) (OutputFormat, bool)

ParseOutputFormat converts a string to OutputFormat

func (OutputFormat) String

func (f OutputFormat) String() string

String returns the string representation of the format

type RenderOptions

type RenderOptions struct {
	// Label is an optional title or label for the graph output.
	Label string
}

RenderOptions contains output-specific rendering options.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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