generateSlug() — graph2md Function Reference
Architecture documentation for the generateSlug() function in main.go from the graph2md codebase.
Entity Profile
Dependency Diagram
graph TD cb1308f3_ccc9_2add_e151_a235170fc89b["generateSlug()"] 19d7285e_2dbf_69a0_6ada_b2031521fd4e["main.go"] cb1308f3_ccc9_2add_e151_a235170fc89b -->|defined in| 19d7285e_2dbf_69a0_6ada_b2031521fd4e b8c81770_53e9_c49f_8a64_ee57b9b3bb27["main()"] b8c81770_53e9_c49f_8a64_ee57b9b3bb27 -->|calls| cb1308f3_ccc9_2add_e151_a235170fc89b 1a1d5ca6_82ee_dda2_e5fa_33bf55491e75["getStr()"] cb1308f3_ccc9_2add_e151_a235170fc89b -->|calls| 1a1d5ca6_82ee_dda2_e5fa_33bf55491e75 a781225f_9a20_1671_b529_7359613f73fc["toSlug()"] cb1308f3_ccc9_2add_e151_a235170fc89b -->|calls| a781225f_9a20_1671_b529_7359613f73fc style cb1308f3_ccc9_2add_e151_a235170fc89b fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
main.go lines 2092–2153
func generateSlug(node Node, label string) string {
props := node.Properties
switch label {
case "File":
path := getStr(props, "path")
if path == "" {
return ""
}
return toSlug("file-" + path)
case "Function":
name := getStr(props, "name")
filePath := getStr(props, "filePath")
if name == "" {
return ""
}
if filePath != "" {
return toSlug("fn-" + filepath.Base(filePath) + "-" + name)
}
return toSlug("fn-" + name)
case "Class":
name := getStr(props, "name")
filePath := getStr(props, "filePath")
if name == "" {
return ""
}
if filePath != "" {
return toSlug("class-" + filepath.Base(filePath) + "-" + name)
}
return toSlug("class-" + name)
case "Type":
name := getStr(props, "name")
filePath := getStr(props, "filePath")
if name == "" {
return ""
}
if filePath != "" {
return toSlug("type-" + filepath.Base(filePath) + "-" + name)
}
return toSlug("type-" + name)
case "Domain":
name := getStr(props, "name")
if name == "" {
return ""
}
return toSlug("domain-" + name)
case "Subdomain":
name := getStr(props, "name")
if name == "" {
return ""
}
return toSlug("subdomain-" + name)
case "Directory":
path := getStr(props, "path")
if path == "" || strings.Contains(path, "/app/repo-root/") {
return ""
}
return toSlug("dir-" + path)
default:
return ""
}
}
Domain
Subdomains
Defined In
Called By
Source
Frequently Asked Questions
What does generateSlug() do?
generateSlug() is a function in the graph2md codebase, defined in main.go.
Where is generateSlug() defined?
generateSlug() is defined in main.go at line 2092.
What does generateSlug() call?
generateSlug() calls 2 function(s): getStr, toSlug.
What calls generateSlug()?
generateSlug() is called by 1 function(s): main.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free