elastic / crd-ref-docs

Generates Kubernetes CRD API reference documentation
Apache License 2.0
103 stars 53 forks source link

feat: parse markers #55

Closed tenstad closed 1 year ago

tenstad commented 1 year ago

Parses all CRD markers so that e.g. default and validation markers may be used to generate doc.

The markers are not used for anything right now, but can be seen by adding {{ $type.Markers}} and {{ .Markers }} in type.tpl, which results in:

#### Guestbook
map[kubebuilder:object:root:[true] kubebuilder:subresource:status:[{}]]
#### Rating
map[kubebuilder:validation:Maximum:[5] kubebuilder:validation:Minimum:[1]]
| `page` _integer_ | Page indicates the page number | map[kubebuilder:default:[{1}]]
| `a` _[Underlying1](#underlying1)_ |  | map[kubebuilder:default:[{b}]]
tenstad commented 1 year ago

@thbkrkr to keep it clean, I think we should merge this one as is, without doing anything with the markers just yet. WDYT?

thbkrkr commented 1 year ago

@thbkrkr to keep it clean, I think we should merge this one as is, without doing anything with the markers just yet. WDYT?

Yes, that sounds good to me.

mowies commented 1 year ago

@thbkrkr @tenstad any plans on when this will be released? Really looking forward to it! 🎉

thbkrkr commented 1 year ago

@mowies It's released: https://github.com/elastic/crd-ref-docs/releases/tag/v0.0.10.

mowies commented 1 year ago

Thanks! 🙌🏼