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)
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").
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).
The pages are generated with Goldsv0.8.2. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds.