Skip to content

Commit f24d9ec

Browse files
twmbclaude
andcommitted
docs: add bloblang about page with expanded literals section
Closes #1115 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 58ef8c3 commit f24d9ec

File tree

3 files changed

+819
-0
lines changed

3 files changed

+819
-0
lines changed

cmd/tools/docs_gen/main.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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
3740
var templateBloblFunctionsRaw string
3841

@@ -61,6 +64,7 @@ var templateTestsRaw string
6164
var templateTemplatesRaw string
6265

6366
var (
67+
templateBloblAbout *template.Template
6468
templateBloblFunctions *template.Template
6569
templateBloblMethods *template.Template
6670
templatePlugin *template.Template
@@ -72,6 +76,7 @@ var (
7276
)
7377

7478
func 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+
164179
type functionCategory struct {
165180
Name string
166181
Specs []bloblang.TemplateFunctionData

0 commit comments

Comments
 (0)