Merge pull request #3696 from owncloud/adoc-fixes

doc fixes
This commit is contained in:
Christian Richter
2022-05-05 14:36:41 +02:00
committed by GitHub
3 changed files with 10 additions and 5 deletions

View File

@@ -15,7 +15,7 @@ import (
{{- end}})
type ConfigField struct {
Name string
EnvVars []string
DefaultValue string
Type string
Description string
@@ -86,8 +86,9 @@ func GetAnnotatedVariables(s interface{}) []ConfigField {
if !ok {
continue
}
v := fmt.Sprintf("%v", value.Interface())
fields = append(fields, ConfigField{Name: strings.ReplaceAll(env, ";", " +\n"), DefaultValue: v, Description: desc, Type: value.Type().Name()})
v := fmt.Sprintf("%v", value.Interface())
td := strings.Split(env, ";")
fields = append(fields, ConfigField{EnvVars: td, DefaultValue: v, Description: desc, Type: value.Type().Name()})
case reflect.Ptr:
// PolicySelectors in the Proxy are being skipped atm
// they are not configurable via env vars, if that changes

View File

@@ -2,6 +2,7 @@ package main
import (
"fmt"
"html"
"io/ioutil"
"log"
"os"
@@ -76,7 +77,7 @@ func GetAnnotatedVariables(s interface{}) []ConfigField {
continue
}
v := fmt.Sprintf("%v", value.Interface())
fields = append(fields, ConfigField{Name: strings.ReplaceAll(env, ";", "<br/>"), DefaultValue: v, Description: desc, Type: value.Type().Name()})
fields = append(fields, ConfigField{Name: strings.ReplaceAll(env, ";", "<br/>"), DefaultValue: html.EscapeString(strings.Replace(v, "|", "\\|", -1)), Description: desc, Type: value.Type().Name()})
case reflect.Ptr:
// PolicySelectors in the Proxy are being skipped atm
// they are not configurable via env vars, if that changes

View File

@@ -8,7 +8,10 @@
| Description
{{- range .Fields}}
| `{{.Name}}`
{{ $numVars := len .EnvVars }}
| {{- range $i, $value := .EnvVars }}{{- if $i }} +{{ end }}
`{{- $value }}`
{{- end }}
| {{.Type}}
| {{.DefaultValue}}
| {{.Description}}