MCPcopy Create free account
hub / github.com/PerpetualSoftware/pad / BuildFrontmatter

Function BuildFrontmatter

internal/cli/editor.go:91–100  ·  view source on GitHub ↗

BuildFrontmatter creates YAML frontmatter from document metadata.

(title, docType, status, tags string)

Source from the content-addressed store, hash-verified

89
90// BuildFrontmatter creates YAML frontmatter from document metadata.
91func BuildFrontmatter(title, docType, status, tags string) string {
92 var b strings.Builder
93 b.WriteString("---\n")
94 b.WriteString(fmt.Sprintf("title: %s\n", title))
95 b.WriteString(fmt.Sprintf("type: %s\n", docType))
96 b.WriteString(fmt.Sprintf("status: %s\n", status))
97 b.WriteString(fmt.Sprintf("tags: %s\n", tags))
98 b.WriteString("---\n\n")
99 return b.String()
100}

Callers

nothing calls this directly

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected