package diagram

Import Path
	github.com/AlexanderGrooff/mermaid-ascii/pkg/diagram (on go.dev)

Dependency Relation
	imports 3 packages, and imported by one package

Involved Source Files config.go interface.go utils.go
Package-Level Type Names (total 3)
/* sort by: | */
Config holds configuration for diagram rendering. This replaces global variables and makes the rendering functions testable and thread-safe. BoxBorderPadding is the padding between text and border in graph nodes GraphDirection is the direction of graph layout ("LR" or "TD") PaddingBetweenX is the horizontal space between nodes in graphs PaddingBetweenY is the vertical space between nodes in graphs SequenceMessageSpacing is the vertical space between messages (lifeline segments) SequenceParticipantSpacing is the horizontal space between participants SequenceSelfMessageWidth is the width of self-message loops ShowCoords displays coordinate debugging information (for development) StyleType determines output format for graph diagrams ("cli" or "html") This controls whether graphs use colored output (html) or plain text (cli) UseAscii determines whether to use ASCII characters (true) or Unicode box-drawing characters (false) Verbose enables detailed logging Validate checks if the configuration values are valid. Returns an error if any values are invalid or would cause rendering issues. func DefaultConfig() *Config func NewCLIConfig(useAscii, showCoords, verbose bool, boxBorderPadding, paddingX, paddingY int, graphDirection string) (*Config, error) func NewConfig(useAscii bool, graphDirection, styleType string) (*Config, error) func NewTestConfig(useAscii bool, styleType string) *Config func NewWebConfig(useAscii bool, boxBorderPadding, paddingX, paddingY int) (*Config, error) func Diagram.Render(config *Config) (string, error) func github.com/AlexanderGrooff/mermaid-ascii/pkg/sequence.Render(sd *sequence.SequenceDiagram, config *Config) (string, error)
ConfigError represents an invalid configuration value. Field string Message string Value interface{} (*ConfigError) Error() string *ConfigError : error
Diagram is the interface for all diagram types (graph, sequence, etc.) ( Diagram) Parse(input string) error ( Diagram) Render(config *Config) (string, error) ( Diagram) Type() string
Package-Level Functions (total 7)
DefaultConfig returns a Config with sensible defaults. The returned config is guaranteed to pass validation.
func NewCLIConfig(useAscii, showCoords, verbose bool, boxBorderPadding, paddingX, paddingY int, graphDirection string) (*Config, error)
NewConfig creates a new Config with the provided values and validates them. Returns an error if any values are invalid. For default values, use DefaultConfig() instead.
NewTestConfig creates a Config for testing with sensible defaults. The styleType parameter determines output format ("cli" or "html").
func NewWebConfig(useAscii bool, boxBorderPadding, paddingX, paddingY int) (*Config, error)
removeComments removes Mermaid comment lines from input. This function is shared between graph and sequence diagram parsers. It handles both full-line comments (%% at start) and inline comments (%% after content).
SplitLines splits input on both actual newlines and escaped newlines (for curl compatibility).