norwoodj / helm-docs

A tool for automatically generating markdown documentation for helm charts
GNU General Public License v3.0
1.41k stars 188 forks source link

Proposal: pretty pring json values #116

Open mac2000 opened 3 years ago

mac2000 commented 3 years ago

Sample yml:

loki:
  enabled: true
  tolerations:
  # -- because we are deploying to a system node need this toleration
  - key: "dedicated.deckhouse.io"
    operator: "Equal"
    value: "system"
    effect: "NoSchedule"
  persistence:
    storageClassName: local-storage
    enabled: true
    # -- size will be used for persisten volume and passed to loki configs
    size: 10Gi
    # -- node on which data will be stored, make sure to create `/mnt/kubernetes/loki`
    node: kube-stage-system-0

Gives an output:

Key Type Default Description
loki.enabled bool true
loki.persistence.enabled bool true
loki.persistence.node string "kube-stage-system-0" node on which data will be stored, make sure to create /mnt/kubernetes/loki
loki.persistence.size string "10Gi" size will be used for persisten volume and passed to loki configs
loki.persistence.storageClassName string "local-storage"
loki.tolerations[0] object {"effect":"NoSchedule","key":"dedicated.deckhouse.io","operator":"Equal","value":"system"} because we are deploying to a system node need this toleration

Which forces scroll and description column becomes really small

Will be nice if output will be:

Key Type Default Description
loki.enabled bool true
loki.persistence.enabled bool true
loki.persistence.node string "kube-stage-system-0" node on which data will be stored, make sure to create `/mnt/kubernetes/loki`
loki.persistence.size string "10Gi" size will be used for persisten volume and passed to loki configs
loki.persistence.storageClassName string "local-storage"
loki.tolerations[0] object
{
  "effect": "NoSchedule",
  "key": "dedicated.deckhouse.io",
  "operator": "Equal",
  "value": "system"
}
because we are deploying to a system node need this toleration

Unfortunately it seems that GitHub markdown does not allow multiline values in tables so there is no other way than render HTML table.

norwoodj commented 2 years ago

I like this idea, I'd happily look at a PR if you submit one