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

Support for lists #9

Open
robertgates55 opened this issue Jun 15, 2020 · 5 comments
Open

Support for lists #9

robertgates55 opened this issue Jun 15, 2020 · 5 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@robertgates55
Copy link

robertgates55 commented Jun 15, 2020

Thanks for this - really nice.

Got really excited and migrated to this format throughout, and then found that it doesn't look to handle list objects?

Some of the main values blocks in our helm chart look like:

tenants:
  # Some desc
- name: tenant_name
  features:
    # Some other desc
    bob: foo

Which you often see documented like:

Parameter Description
tenants[0].name Some desc
tenants[0].features.bob Some other desc

Is this possible? Is this easily implemented if not?

@tamalsaha
Copy link
Contributor

You are right that lists are not handled. I did not handle it because it is not clear to me how to handle that in the docs. In your example, if here are multiple array elements how does it show up in the doc?

@robertgates55
Copy link
Author

I think just displaying the index inside square brackets seems to be closest to a standard that I’ve seen - tenants[0], tenants[1] etc - and then leaving it up to users to annotate the different elements accordingly?

@robertgates55
Copy link
Author

Reread your question:

tenants:
  # Some desc
- name: tenant_name
  features:
    # A feature
  - name: bob
    # Some other desc
    bob: foo

Would get you:
tenants[0].features[0].name

And I think for clarity you’d maybe only ever display the 0th indexed element of any list - comments on eg the second index would be ignored?

@tamalsaha
Copy link
Contributor

I see that you want to document the structure of the list type values field. If you want to do so, you need to make changes to https://github.com/kubepack/chart-doc-gen/blob/master/walk/associative_sequence.go#L15 file. I am open to prs.

@tamalsaha tamalsaha added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Jun 23, 2020
@norwoodj
Copy link

norwoodj commented Oct 5, 2020

@robertgates55 my tool helm-docs supports lists in the way you describe already. Why not give it a try?

@tamalsaha I wonder if you've seen this project. Seems to do basically the same thing you're attempting here but has been around a couple years so has many more features.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants