The reference documentation for the latest release of the Knative is available at www.knative.dev.
The API source files are located at:
The Knative API reference documentation is manually generated using the
gen-api-reference-docs.sh tool. If you need to generate a new
version of the API docs for a recent update or for a new release, you can use
the following steps.
To learn more about the tool, see the gen-crd-api-reference-docs reference page.
You must meet the following requirements to run the gen-api-reference-docs.sh
tool:
- You need the following software installed:
- Clone knative/docs locally. For example:
git clone git@github.com:knative/docs.git
To generate a version of the API:
-
Ensure that your
GOPATHis empty. Thegen-api-reference-docs.shscript will result in theGOPATH should not be seterror if yourGOPATHis configured. You view the value by running the following command:echo $GOPATHIf your
GOPATHis already configured, temporarily clear theGOPATHvalue by running the following command:export GOPATH="" -
Locate the commits or tags that correspond to the version of the API that you want to generate:
-
To run the
gen-api-reference-docs.shcommand from thehackdirectory, you specify the commits or tags for each of the corresponding Knative component variables (KNATIVE_[component_name]_COMMIT):cd hack KNATIVE_SERVING_COMMIT=[commit_or_tag] \ KNATIVE_EVENTING_COMMIT=[commit_or_tag] \ KNATIVE_EVENTING_CONTRIB_COMMIT=[commit_or_tag] \ ./gen-api-reference-docs.shwhere
[commit_or_tag]is the commit or tag in the specific repo that represents the version of the API that you want to generate. Also see the example below.Result
The
gen-api-reference-docs.shtool generates the API in atmpfolder. After a successful build, the tool automatically opens that folder in thetmpdirectory. -
Copy the generated API files into the
docs/referencedirectory of your knative/docs clone.
You can now perform the necessary steps to open a PR, complete a review, and
merge the new API files into the appropriate branch of the knative/docs repo.
See the contributor flow for details
about requesting changes in the knative/docs repo.
To build a set of Knative API docs for v0.3, you can use the v0.3.0 the tags
from each of the Knative component repositories, like
Serving v0.3.0. If you want to
use a commit for Serving v0.3.0, you would use
4d198d.
Using tags from each repo, you would run the following command to generate the v0.3.0 API source files:
KNATIVE_SERVING_COMMIT=v0.3.0 \
KNATIVE_EVENTING_COMMIT=v0.3.0 \
KNATIVE_EVENTING_CONTRIB_COMMIT=v0.3.0 \
./gen-api-reference-docs.sh