MCPcopy Create free account
hub / github.com/Unpackerr/unpackerr / writeDocusaurus

Function writeDocusaurus

init/config/docusaurus.go:49–57  ·  view source on GitHub ↗
(dir, file, content string)

Source from the content-addressed store, hash-verified

47}
48
49func writeDocusaurus(dir, file, content string) error {
50 _ = os.Mkdir(dir, dirMode)
51 date := "---\n## => Content Auto Generated, " +
52 strings.ToUpper(time.Now().UTC().Round(time.Second).Format("02 Jan 2006 15:04 UTC")) + "\n---\n\n"
53 filePath := filepath.Join(dir, file+".md")
54 log.Printf("Writing: %s, size: %d", filePath, len(content))
55 //nolint:wrapcheck
56 return os.WriteFile(filePath, []byte(date+content), fileMode)
57}
58
59// makeGenerated writes a special index file that the website can import.
60// Adds all param sections except global into a docusaurus import format.

Callers 2

createDocusaurusFunction · 0.85
makeGeneratedFunction · 0.85

Calls 1

PrintfMethod · 0.65

Tested by

no test coverage detected