Home / Function/ mermaidID() — graph2md Function Reference

mermaidID() — graph2md Function Reference

Architecture documentation for the mermaidID() function in main.go from the graph2md codebase.

Entity Profile

Dependency Diagram

graph TD
  7c6c6867_1122_3e6c_37a2_aeb678869b84["mermaidID()"]
  19d7285e_2dbf_69a0_6ada_b2031521fd4e["main.go"]
  7c6c6867_1122_3e6c_37a2_aeb678869b84 -->|defined in| 19d7285e_2dbf_69a0_6ada_b2031521fd4e
  style 7c6c6867_1122_3e6c_37a2_aeb678869b84 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

main.go lines 1648–1660

func mermaidID(nodeID string) string {
	// Create valid Mermaid node ID from arbitrary string
	id := strings.Map(func(r rune) rune {
		if (r >= 'a' && r <= 'z') || (r >= 'A' && r <= 'Z') || (r >= '0' && r <= '9') || r == '_' {
			return r
		}
		return '_'
	}, nodeID)
	if id == "" {
		id = "node"
	}
	return id
}

Subdomains

Defined In

Frequently Asked Questions

What does mermaidID() do?
mermaidID() is a function in the graph2md codebase, defined in main.go.
Where is mermaidID() defined?
mermaidID() is defined in main.go at line 1648.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free