@@ -33,6 +33,9 @@ import (
3333 _ "github.com/redpanda-data/connect/v4/public/components/all"
3434)
3535
36+ //go:embed templates/bloblang_about.adoc.tmpl
37+ var templateBloblAboutRaw string
38+
3639//go:embed templates/bloblang_functions.adoc.tmpl
3740var templateBloblFunctionsRaw string
3841
@@ -61,6 +64,7 @@ var templateTestsRaw string
6164var templateTemplatesRaw string
6265
6366var (
67+ templateBloblAbout * template.Template
6468 templateBloblFunctions * template.Template
6569 templateBloblMethods * template.Template
6670 templatePlugin * template.Template
7276)
7377
7478func init () {
79+ templateBloblAbout = template .Must (template .New ("bloblang about" ).Parse (templateBloblAboutRaw ))
7580 templateBloblFunctions = template .Must (template .New ("bloblang functions" ).Parse (templateBloblFunctionsRaw ))
7681 templateBloblMethods = template .Must (template .New ("bloblang methods" ).Parse (templateBloblMethodsRaw ))
7782 templatePlugin = template .Must (template .New ("plugin" ).Parse (templatePluginFieldsRaw + templatePluginRaw ))
@@ -114,6 +119,7 @@ func main() {
114119 getSchema ().Environment ().WalkScanners (viewForDir (path .Join (docsDir , "./scanners" )))
115120
116121 // Bloblang stuff
122+ doBloblangAbout (docsDir )
117123 doBloblangMethods (docsDir )
118124 doBloblangFunctions (docsDir )
119125
@@ -161,6 +167,15 @@ func viewForDir(docsDir string) func(string, *service.ConfigView) {
161167 }
162168}
163169
170+ func doBloblangAbout (dir string ) {
171+ var buf bytes.Buffer
172+ if err := templateBloblAbout .Execute (& buf , nil ); err != nil {
173+ panic (fmt .Sprintf ("Failed to generate docs for bloblang about: %v" , err ))
174+ }
175+
176+ create ("bloblang about" , filepath .Join (dir , "../.." , "guides" , "pages" , "bloblang" , "about.adoc" ), buf .Bytes ())
177+ }
178+
164179type functionCategory struct {
165180 Name string
166181 Specs []bloblang.TemplateFunctionData
0 commit comments