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

feature: output results as json (or other formats) #168

Open
lrstanley opened this issue Jan 4, 2023 · 2 comments
Open

feature: output results as json (or other formats) #168

lrstanley opened this issue Jan 4, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@lrstanley
Copy link

Would be awesome to have an option of exporting the values made available to the go templates, as JSON (or similar), rather than requiring them to be processed through the helm chart. This would allow more complex usecases, like:

  1. direct generation to HTML
  2. dynamic single page applications
  3. having a main/core readme, which includes partial data for each chart, and links to it (think this but more details/info/etc).
  4. allow additional templating that isn't supported by go templates

It should be as straightforward as adding an output-format flag (or similar) that lets you change the format. Multiple formats could be supported relatively easily, without much (if any) maintenance overhead.

I have two primary usecases myself that would greatly benefit from this feature:

  1. I want to generate custom badges, images, and similar within the readme, that use the chart name and description. Some of these things would require URL encoding the results, which isn't possible currently with the templates.
  2. I want to have a "main" readme, which uses data for each of the charts, and generates one readme with basic info about each chart, and links to each charts readme. I would like to take advantage of some of the data that is pulled out by helm-docs.

If I could get the results as JSON, I could pipe that into my own go/pongo2/p2/jinja/etc template.

If this feature makes sense, I can submit a PR to implement.

@Nepo26 Nepo26 added the enhancement New feature or request label Jun 29, 2023
@Nepo26
Copy link
Collaborator

Nepo26 commented Jun 29, 2023

This makes some sense but I'm not sure if just implementing some output flag would be the way to go about it. But I can see it working.

Can you provide an example of what you are trying to accomplish with the badges and images?

Feel free to submit a PR on this feature @lrstanley as I think it could go well, at least for debugging I know it makes sense.

@Nepo26 Nepo26 added this to the General Cleanup milestone Jul 25, 2023
@lrstanley
Copy link
Author

I looked at implementing this, however, it looks like the "documentation" portion of helm-docs is too engrained at multiple levels today to make it a simple implementation. Ideally, some of the sub-packages should include the entire dataset, which then is passed to docs/templating, however, the document sub-package is doing too much business logic. Feels like an anti-pattern.

May revisit myself if things are refactored in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: No status
Development

No branches or pull requests

2 participants