rapidsai / frigate

Frigate is a tool for automatically generating documentation for your Helm charts
https://frigate.readthedocs.io
Other
83 stars 25 forks source link

Get the description added from the comment added above the variable #67

Open shyam-ks opened 1 year ago

shyam-ks commented 1 year ago

is there anyway to get the description added from the comment added above the variable

| Parameter                | Description             | Default        |
| ------------------------ | ----------------------- | -------------- |
| `imagePullPolicy` |  | `"Always"` |

# Can it ready the description from 

# Image pull policy description. is there a way to read this?
imagePullPolicy: Always # Now its reading from if its the same line as the variable
jacobtomlinson commented 1 year ago

This currently isn't possible. I looked into this at some point but couldn't easily figure out how to get consistent behaviour with ruaml. There are questions to be answered like:

If someone wants to look into this and open a PR I'd be happy to discuss/review.

shyam-ks commented 1 year ago
  • What happens if there are multiple lines of comments above?

If the logic picks the line above the variable as a comment, it will be easier to manage the comments in terms of readability. Even if there are multi-line comments, reading the one just above the variable should fix it. I believe this is what you meant by multi line comment

# Pull policy
# Image pull policy description. 
imagePullPolicy: Always 

or standardize comments format to use ## or # --

jacobtomlinson commented 1 year ago

Sure. Do you have any interest in working on this and opening a PR?

johbo commented 1 year ago

Just bumped into this, looking currently at Frigate as an alternative to helm-docs.

It is using the prefix # -- to flag something as a comment. The option to put comments right above a parameter is really of value, it's keeping the source file very readable and still allows to automatically generate the README an other auxiliary documentation.

Does anyone already have a view or gut feeling what it would take to add this capability? I've skimmed through the ruyaml documentation and not come across any examples for regular comments. The docs seem to mainly be focused on end-of-line comments attached to something.

Pointer: https://github.com/norwoodj/helm-docs

jacobtomlinson commented 1 year ago

It would be great to add this but I don't have the capacity to look at this at the moment. I'd be very happy to review PRs from folks.