mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-02-24 22:49:06 -06:00
add extension name to adoc template
Signed-off-by: Christian Richter <crichter@owncloud.com>
This commit is contained in:
@@ -22,6 +22,11 @@ type ConfigField struct {
|
||||
VersionInfo string
|
||||
}
|
||||
|
||||
type templateData struct {
|
||||
ExtensionName string
|
||||
Fields []ConfigField
|
||||
}
|
||||
|
||||
func main() {
|
||||
fmt.Println("Generating adoc documentation for environment variables:")
|
||||
content, err := ioutil.ReadFile("../../docs/templates/ADOC.tmpl")
|
||||
@@ -52,7 +57,12 @@ m := map[string]interface{}{
|
||||
log.Fatalf("Failed to create target file: %s", err)
|
||||
}
|
||||
defer targetFile.Close()
|
||||
if err := tpl.Execute(targetFile, fields); err != nil {
|
||||
|
||||
td := templateData{
|
||||
ExtensionName: replacer.Replace(pkg),
|
||||
Fields: fields,
|
||||
}
|
||||
if err := tpl.Execute(targetFile, td); err != nil {
|
||||
log.Fatalf("Failed to execute template: %s", err)
|
||||
}
|
||||
}
|
||||
|
||||
4
docs/templates/ADOC.tmpl
vendored
4
docs/templates/ADOC.tmpl
vendored
@@ -1,5 +1,5 @@
|
||||
[caption=]
|
||||
.Environment variables for the frontend extension
|
||||
.Environment variables for the {{ .ExtensionName }} extension
|
||||
[width="100%",cols="~,~,~,~",options="header"]
|
||||
|===
|
||||
| Name
|
||||
@@ -7,7 +7,7 @@
|
||||
| Default Value
|
||||
| Description
|
||||
|
||||
{{- range .}}
|
||||
{{- range .Fields}}
|
||||
| `{{.Name}}`
|
||||
| {{.Type}}
|
||||
| {{.DefaultValue}}
|
||||
|
||||
Reference in New Issue
Block a user