diff --git a/apmpackage/README.md b/apmpackage/README.md index 4dd765eb143..9209c67a7a7 100644 --- a/apmpackage/README.md +++ b/apmpackage/README.md @@ -10,7 +10,7 @@ #### Update / fix a package 1. Actual work - - Make changes in `apmpackage/apm/`, `apmpackage/docs/README.template.md` and/or code as needed + - Make changes in `apmpackage/apm/` and/or code as needed - Run `make update`. That will update fields, pipeline and doc files based on apm-server fields and pipeline defs. 2. Run the registry diff --git a/apmpackage/docs/README.template.md b/apmpackage/apm/0.1.0/_dev/docs/README.template.md similarity index 100% rename from apmpackage/docs/README.template.md rename to apmpackage/apm/0.1.0/_dev/docs/README.template.md diff --git a/apmpackage/cmd/gen-package/gendocs.go b/apmpackage/cmd/gen-package/gendocs.go index 9ca93c63c2f..42d85601021 100644 --- a/apmpackage/cmd/gen-package/gendocs.go +++ b/apmpackage/cmd/gen-package/gendocs.go @@ -36,10 +36,10 @@ func generateDocs(inputFields map[string][]field, version string) { MetricsExample: loadExample("metricsets.json"), ErrorExample: loadExample("errors.json"), } - t := template.New(docsTemplateFilePath) + t := template.New(docsTemplateFilePath(version)) tmpl, err := t.Funcs(map[string]interface{}{ "Trim": strings.TrimSpace, - }).ParseFiles(docsTemplateFilePath) + }).ParseFiles(docsTemplateFilePath(version)) if err != nil { panic(err) } diff --git a/apmpackage/cmd/gen-package/paths.go b/apmpackage/cmd/gen-package/paths.go index d15b858e257..0a966a9f96b 100644 --- a/apmpackage/cmd/gen-package/paths.go +++ b/apmpackage/cmd/gen-package/paths.go @@ -19,7 +19,9 @@ package main import "path/filepath" -var docsTemplateFilePath = "apmpackage/docs/README.template.md" +func docsTemplateFilePath(version string) string { + return filepath.Join("apmpackage/apm/", version, "/_dev/docs/README.template.md") +} func docsFilePath(version string) string { return filepath.Join("apmpackage/apm/", version, "/docs/README.md")