Skip to content

Commit

Permalink
Add docs for generating docs
Browse files Browse the repository at this point in the history
  • Loading branch information
pwittrock committed Mar 21, 2018
1 parent 6d0f20b commit cccf9bf
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,16 @@ kubebuilder init --domain example.com

# Create a new API and controller
kubebuilder create resource --group bar --version v1alpha1 --kind Foo
kubectl apply -f hack/sample/foo.yaml

# Install and run your API into the cluster for your current kubeconfig context
GOBIN=$(pwd)/bin go install <PROJECT_PACKAGE>/cmd/controller-manager
bin/controller-manager --kubeconfig ~/.kube/config
kubectl apply -f hack/sample/foo.yaml

# Build your documentation
kubebuilder create example --group bar --version v1alpha1 --kind Foo
kubebuilder docs
```

See the [user guide](docs/tools_user_guide.md) for more details
Expand Down
23 changes: 23 additions & 0 deletions docs/creating_reference_documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Building reference documentation

## Build reference documentation

You may build Kubernetes style reference documentation for your APIs to `docs/reference/build/index.html` by
running `kubebuilder docs`.

**Note:** There is currently an issue where building docs does not work if multiple versions of APIs for the
same group are defined.

## Create an example for your API

You may create an example that will be included in the reference documentation by running the following command
and editing the newly created file:

```sh
kubebuilder create example --group <group> --version <version> --kind <kind>
```

## Add overview or API group documentation

You may add information about the API groups or creating an overview by editing the .md files
under `docs/reference/static_includes`.
15 changes: 15 additions & 0 deletions docs/tools_user_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,18 @@ export CONTROLLER_IMAGE=<controller-image>
kubectl run $NAME --serviceaccount=installer --image=$INSTALL_IMAGE --restart=OnFailure -- ./installer \
--controller-image=$CONTROLLER_IMAGE --name=$NAME
```

## Build docs for your APIs

It will be helpful for your users to have API documentation. You can generate Kubernetes style APIs using
kubebuilder:

```sh
# Create and edit an example for each API
kubebuilder create example --group group --version version --kind kind

# Generate the docs to docs/reference/build/index.html
kubebuilder docs
```

For more information see [creating reference documentation](creating_reference_documentation.md)

0 comments on commit cccf9bf

Please sign in to comment.