timoni icon indicating copy to clipboard operation
timoni copied to clipboard

Module Markdown Optional Fields

Open nalum opened this issue 2 years ago • 8 comments

Based on feedback in https://github.com/cue-lang/cue/discussions/2783 this PR updates the Markdown document generation to pull the optional fields into the table data. This is done via the cue.Value.Fields() iterator.

nalum avatar Feb 02 '24 12:02 nalum

@stefanprodan with some feedback from the cue team I've gotten this so it now will print the definition of the field, see the README for the blueprints starter module. I want to refine the module so that name and namespace are not output, but wanted to bring it to your attention.

nalum avatar Mar 27 '24 14:03 nalum

I'm still not getting what I want from the labels and annotations though :/

nalum avatar Mar 27 '24 14:03 nalum

I have pulled and rebased the latest main, this behaves in the same way. I think the changes here are worth merging, I'll spend some time digging into cue releases since the initial work on this and see if I can get the result I initially wanted for annotations and labels.

nalum avatar Oct 03 '24 22:10 nalum

Hey @Nalum with this we remove the default column from the readme, would be possible to preserve it or we need to merge type with defaults? If so, I think we need to rename the type column to something else.

stefanprodan avatar Oct 04 '24 06:10 stefanprodan

I removed it because the type information have use the type and the default in one result, ~I had not found a way to get both separately at the time, maybe there is a way now, I'll dig into that too.~ scratch that, it was doing this, I can't recall the reason for making that change now.

Do you want to hold off on merging this for now so?

nalum avatar Oct 04 '24 07:10 nalum

Ah I think the goal was to show the cue type information as is. For example if we just had the type and default this would not show you the possible values:

| `test: startupAPICheck: service: type:` | `*"ClusterIP" \| "NodePort" \| "LoadBalancer" \| "ExternalName"` |

You would have this instead:

| `test: startupAPICheck: service: type:` | `string` | `ClusterIP` |

nalum avatar Oct 04 '24 08:10 nalum

I guess this adds a requirement to understand cue syntax :thinking:

nalum avatar Oct 04 '24 08:10 nalum