MCPcopy Create free account
hub / github.com/cloudwego/eino-examples / buildMermaidHTML

Function buildMermaidHTML

devops/visualize/mermaid.go:442–455  ·  view source on GitHub ↗
(code string)

Source from the content-addressed store, hash-verified

440}
441
442func buildMermaidHTML(code string) string {
443 return `<!doctype html>
444<html>
445<head>
446 <meta charset="utf-8">
447 <script src="https://unpkg.com/mermaid@10/dist/mermaid.min.js"></script>
448 <style>body{margin:0;padding:20px;background:#fff}</style>
449 <script>mermaid.initialize({startOnLoad:true});</script>
450</head>
451<body>
452 <div id="container" class="mermaid">` + code + `</div>
453</body>
454</html>`
455}
456
457func urlEncode(s string) string { // minimal percent-encoding for data URL
458 r := strings.NewReplacer("%", "%25", "#", "%23", "\n", "%0A", "\r", "%0D")

Callers 1

renderWithChromedpFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected