Skip to content

Latest commit

 

History

History
57 lines (40 loc) · 2.34 KB

HACKING-DOC.adoc

File metadata and controls

57 lines (40 loc) · 2.34 KB

Contributing to Documentation

Tip
This is the operator documentation. For Korrel8r itself go to the Korrel8r project

Operator documentation includes:

  • API documentation for the Korrel8r "Custom Resource".

  • Information displayed by OperatorHub to describe operators.

The documentation is generated from comments and fields in .go and .yaml source files. Edit the source files directly, then generate a preview of your work as described below.

Tip
Files with extra information for doc writers have // DOCNOTE comments.
Warning
Be careful not to change the surrounding code when editing documentation comments and fields.

Custom Resource API documentation

The API documentation is generated from Go source code comments.

Note
Source file

../api/v1alpha1/korrel8r_types.go

Generated file

../doc/zz_api-ref.doc

Command

make doc

Tip
make does nothing if the generated files are already up to date. Modify a source file to get make to create a new generated file.

Go comments are marked up according to Go Doc Comment rules. Generation starts at type Korrel8r struct and recursively descends into all the types it references. Normally all types that are relevant for documentation are grouped in the same *_types.go file.

API comments are used in several contexts:

  • HTML pages for documentation web sites. The locally generated ../doc/zz_api-ref.doc is an example. Pages could be generated in other formats for specific sites.

  • The cluster itself serves the documentation via commands like kubectl explain korrel8r.

  • Console-like applications often provide this information to help the user in editing resources.

OperatorHub descriptions

OperatorHub uses description fields from the ClusterServiceVersion YAML file to display an operator.

Note
Source file

../config/manifests/bases/korrel8r.clusterserviceversion.yaml

Online preview page

https://operatorhub.io/preview

How to preview

Paste the contents of ../config/manifests/bases/korrel8r.clusterserviceversion.yaml into the the form on the preview page.

Caution
Do not edit YAML files in the ../bundle/ directory. Your changes will be over-written. ../bundle files are generated from the source files under the ../config directory.