Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Badges/Maintainers/Sources/..., Restyling of Default Template, No Trailing Spaces, No Multiple Empty Lines, ... #42

Merged
merged 12 commits into from
May 22, 2020
Merged
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/helm-docs
/cmd/helm-docs/helm-docs
dist
.idea/
*.iml
30 changes: 25 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,30 @@ The templates generated by the tool are shown below, and can be included in your
| Name | Description |
|------|-------------|
| chart.header | The main heading of the generated markdown file |
| chart.deprecationWarning | A deprecation warning which is displayed when the _deprecated_ field from the chart's `Chart.yaml` file is `true` |
| chart.description | A description line containing the _description_ field from the chart's `Chart.yaml` file, or "" if that field is not set |
| chart.version | The _version_ field from the chart's `Chart.yaml` file |
| chart.versionLine | A text line stating the current version of the chart |
| chart.versionBadge | A badge stating the current version of the chart |
| chart.type | The _type_ field from the chart's `Chart.yaml` file |
| chart.typeLine | A text line stating the current type of the chart |
| chart.sourceLink | The _home_ link from the chart's `Chart.yaml` file, or "" if that field is not set |
| chart.sourceLinkLine | A text line with the _home_ link from the chart's `Chart.yaml` file, or "" if that field is not set |
| chart.typeBadge | A badge stating the current type of the chart |
| chart.appVersion | The _appVersion_ field from the chart's `Chart.yaml` file |
| chart.appVersionLine | A text line stating the current appVersion of the chart |
| chart.appVersionBadge | A badge stating the current appVersion of the chart |
| chart.homepage | The _home_ link from the chart's `Chart.yaml` file, or "" if that field is not set |
| chart.homepageLine | A text line stating the current homepage of the chart |
| chart.maintainersHeader | The heading for the chart maintainers section |
| chart.maintainersTable | A table of the chart's maintainers |
| chart.maintainersSection | A section headed by the maintainersHeader from above containing the maintainersTable from above or "" if there are no maintainers |
| chart.sourcesHeader | The heading for the chart sources section |
| chart.sourcesList | A list of the chart's sources |
| chart.sourcesSection | A section headed by the sourcesHeader from above containing the sourcesList from above or "" if there are no sources |
| chart.kubeVersion | The _kubeVersion_ field from the chart's `Chart.yaml` file |
| chart.kubeVersionLine | A text line stating the required Kubernetes version for the chart |~~~~
| chart.requirementsHeader | The heading for the chart requirements section |
| chart.requirementsTable | A table of the chart's required sub-charts |
| chart.requirementsSection | A section headed by the requirementsHeader from above containing the requirementsTable from above or "" if there are no requirements |
| chart.requirementsSection | A section headed by the requirementsHeader from above containing the kubeVersionLine and/or the requirementsTable from above or "" if there are no requirements |
| chart.valuesHeader | The heading for the chart values section |
| chart.valuesTable | A table of the chart's values parsed from the `values.yaml` file (see below) |
| chart.valuesSection | A section headed by the valuesHeader from above containing the valuesTable from above or "" if there are no values |
Expand All @@ -106,11 +120,17 @@ If there is no `README.md.gotmpl` (or other specified gotmpl file) present, the
That template looks like so:
```
{{ template "chart.header" . }}
{{ template "chart.deprecationWarning" . }}

{{ template "chart.versionBadge" . }}{{ template "chart.typeBadge" . }}{{ template "chart.appVersionBadge" . }}

{{ template "chart.description" . }}

{{ template "chart.versionLine" . }}
{{ template "chart.homepageLine" . }}

{{ template "chart.maintainersSection" . }}

{{ template "chart.sourceLinkLine" . }}
{{ template "chart.sourcesSection" . }}

{{ template "chart.requirementsSection" . }}

Expand Down
11 changes: 5 additions & 6 deletions example-charts/custom-template/README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
custom-template
===============
# custom-template

Basically the same as the nginx-ingress chart, but using a custom template to include some other content

Current chart version is `0.2.0`

Source code can be found [here](https://github.com/norwoodj/helm-docs/tree/master/example-charts/custom-template)

## Additional Information

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore
et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
culpa qui officia deserunt mollit anim id est laborum.

## Chart Requirements
## Requirements

| Repository | Name | Version |
|------------|------|---------|
| @stable | nginx-ingress | 0.22.1 |

## Chart Values
## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
Expand Down
3 changes: 1 addition & 2 deletions example-charts/custom-template/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@

{{ template "chart.versionLine" . }}

{{ template "chart.sourceLinkLine" . }}

## Additional Information

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore
et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
Expand Down
19 changes: 19 additions & 0 deletions example-charts/full-template/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: v2
name: full-template
deprecated: true
version: "1.0.0"
type: application
appVersion: "13.0.0"
description: A chart for showing every README-element
home: "https://github.com/norwoodj/helm-docs/tree/master/example-charts/full-template"
maintainers:
- email: norwood.john.m@gmail.com
name: John Norwood
sources: ["https://github.com/norwoodj/helm-docs/tree/master/example-charts/full-template"]
kubeVersion: "<=1.18"
engine: gotpl

dependencies:
- name: nginx-ingress
version: "0.22.1"
repository: "@stable"
153 changes: 153 additions & 0 deletions example-charts/full-template/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
# full-template

## `chart.deprecationWarning`

> **:exclamation: This Helm Chart is deprecated!**

## `chart.description`

A chart for showing every README-element

## `chart.version`

1.0.0

## `chart.versionLine`

Current chart version is `1.0.0`

## `chart.versionBadge`

![Version: 1.0.0](https://img.shields.io/badge/Version-1.0.0-informational?style=flat-square)

## `chart.type`

application

## `chart.typeLine`

Current chart type is `application`

## `chart.typeBadge`

![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)

## `chart.appVersion`

13.0.0

## `chart.appVersionLine`

Current chart appVersion is `13.0.0`

## `chart.appVersionBadge`

![AppVersion: 13.0.0](https://img.shields.io/badge/AppVersion-13.0.0-informational?style=flat-square)

## `chart.homepage`

https://github.com/norwoodj/helm-docs/tree/master/example-charts/full-template

## `chart.homepageLine`

**Homepage:** <https://github.com/norwoodj/helm-docs/tree/master/example-charts/full-template>

## `chart.maintainersHeader`

## Maintainers

## `chart.maintainersTable`

| Name | Email | Url |
| ---- | ------ | --- |
| John Norwood | norwood.john.m@gmail.com | |

## `chart.maintainersSection`

## Maintainers

| Name | Email | Url |
| ---- | ------ | --- |
| John Norwood | norwood.john.m@gmail.com | |

## `chart.sourcesHeader`

## Source Code

## `chart.sourcesList`

* <https://github.com/norwoodj/helm-docs/tree/master/example-charts/full-template>

## `chart.sourcesSection`

## Source Code

* <https://github.com/norwoodj/helm-docs/tree/master/example-charts/full-template>

## `chart.kubeVersion`

<=1.18

## `chart.kubeVersionLine`

Kubernetes: `<=1.18`

## `chart.requirementsHeader`

## Requirements

## `chart.requirementsTable`

| Repository | Name | Version |
|------------|------|---------|
| @stable | nginx-ingress | 0.22.1 |

## `chart.requirementsSection`

## Requirements

Kubernetes: `<=1.18`

| Repository | Name | Version |
|------------|------|---------|
| @stable | nginx-ingress | 0.22.1 |

## `chart.valuesHeader`

## Values

## `chart.valuesTable`

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| controller.extraVolumes[0].configMap.name | string | `"nginx-ingress-config"` | Uses the name of the configmap created by this chart |
| controller.extraVolumes[0].name | string | `"config-volume"` | |
| controller.image.repository | string | `"nginx-ingress-controller"` | |
| controller.image.tag | string | `"18.0831"` | |
| controller.ingressClass | string | `"nginx"` | Name of the ingress class to route through this controller |
| controller.name | string | `"controller"` | |
| controller.persistentVolumeClaims | list | the chart will construct this list internally unless specified | List of persistent volume claims to create. For very long comments, break them into multiple lines. |
| controller.podLabels | object | `{}` | The labels to be applied to instances of the controller pod |
| controller.publishService.enabled | bool | `false` | Whether to expose the ingress controller to the public world |
| controller.replicas | int | `nil` | Number of nginx-ingress pods to load balance between |
| controller.service.annotations."external-dns.alpha.kubernetes.io/hostname" | string | `"stupidchess.jmn23.com"` | Hostname to be assigned to the ELB for the service |
| controller.service.type | string | `"LoadBalancer"` | |

## `chart.valuesSection`

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| controller.extraVolumes[0].configMap.name | string | `"nginx-ingress-config"` | Uses the name of the configmap created by this chart |
| controller.extraVolumes[0].name | string | `"config-volume"` | |
| controller.image.repository | string | `"nginx-ingress-controller"` | |
| controller.image.tag | string | `"18.0831"` | |
| controller.ingressClass | string | `"nginx"` | Name of the ingress class to route through this controller |
| controller.name | string | `"controller"` | |
| controller.persistentVolumeClaims | list | the chart will construct this list internally unless specified | List of persistent volume claims to create. For very long comments, break them into multiple lines. |
| controller.podLabels | object | `{}` | The labels to be applied to instances of the controller pod |
| controller.publishService.enabled | bool | `false` | Whether to expose the ingress controller to the public world |
| controller.replicas | int | `nil` | Number of nginx-ingress pods to load balance between |
| controller.service.annotations."external-dns.alpha.kubernetes.io/hostname" | string | `"stupidchess.jmn23.com"` | Hostname to be assigned to the ELB for the service |
| controller.service.type | string | `"LoadBalancer"` | |
115 changes: 115 additions & 0 deletions example-charts/full-template/README.md.gotmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
{{ template "chart.header" . }}
## `chart.deprecationWarning`








{{ template "chart.deprecationWarning" . }}

## `chart.description`

{{ template "chart.description" . }}

## `chart.version`

{{ template "chart.version" . }}

## `chart.versionLine`

{{ template "chart.versionLine" . }}

## `chart.versionBadge`

{{ template "chart.versionBadge" . }}

## `chart.type`

{{ template "chart.type" . }}

## `chart.typeLine`

{{ template "chart.typeLine" . }}

## `chart.typeBadge`

{{ template "chart.typeBadge" . }}

## `chart.appVersion`

{{ template "chart.appVersion" . }}

## `chart.appVersionLine`

{{ template "chart.appVersionLine" . }}

## `chart.appVersionBadge`

{{ template "chart.appVersionBadge" . }}

## `chart.homepage`

{{ template "chart.homepage" . }}

## `chart.homepageLine`

{{ template "chart.homepageLine" . }}

## `chart.maintainersHeader`

{{ template "chart.maintainersHeader" . }}

## `chart.maintainersTable`

{{ template "chart.maintainersTable" . }}

## `chart.maintainersSection`

{{ template "chart.maintainersSection" . }}

## `chart.sourcesHeader`

{{ template "chart.sourcesHeader" . }}

## `chart.sourcesList`

{{ template "chart.sourcesList" . }}

## `chart.sourcesSection`

{{ template "chart.sourcesSection" . }}

## `chart.kubeVersion`

{{ template "chart.kubeVersion" . }}

## `chart.kubeVersionLine`

{{ template "chart.kubeVersionLine" . }}

## `chart.requirementsHeader`

{{ template "chart.requirementsHeader" . }}

## `chart.requirementsTable`

{{ template "chart.requirementsTable" . }}

## `chart.requirementsSection`

{{ template "chart.requirementsSection" . }}

## `chart.valuesHeader`

{{ template "chart.valuesHeader" . }}

## `chart.valuesTable`

{{ template "chart.valuesTable" . }}

## `chart.valuesSection`

{{ template "chart.valuesSection" . }}
Loading