Autogenerate md documentation for kubectl

This does away with the giant dump from cobra for kubectl and instead
generates md files which contain similar information, but one per verb.
This might work well as part of the cobra project, instead of doing it
in kube, but this gets us nice, linked, documentation right now.  If
people like it, I will try to get something similar into cobra.
This commit is contained in:
Eric Paris
2015-01-31 14:08:59 -05:00
parent 9e9fb9457f
commit a6beb2e7df
32 changed files with 1553 additions and 1120 deletions

View File

@@ -91,19 +91,12 @@ if [[ ! -x "$gendocs" || ! -x "$genman" ]]; then
exit 1
fi
KUBECTL_DOC="docs/kubectl.md"
echo "diffing ${KUBECTL_DOC} against generated output from ${gendocs}"
"${gendocs}" | diff "${KUBE_ROOT}/${KUBECTL_DOC}" - && echo "${KUBECTL_DOC} up to date." || {
echo "${KUBECTL_DOC} is out of date. Please run hack/run-gendocs.sh"
exit 1
}
DOCROOT="${KUBE_ROOT}/docs/"
TMP_DOCROOT="${KUBE_ROOT}/docs_tmp/"
cp -a "${DOCROOT}" "${TMP_DOCROOT}"
echo "diffing ${DOCROOT} against generated output from ${genman}"
${genman} "${TMP_DOCROOT}/man/man1/"
${gendocs} "${TMP_DOCROOT}"
set +e
diff -Naupr "${DOCROOT}" "${TMP_DOCROOT}"
ret=$?