Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

📖 Organize generated CRD documentation by API group #3110

Merged
merged 1 commit into from
Apr 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions docs/generators/crd-ref/run-crd-ref-gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,25 @@ $CONTAINER_ENGINE run --rm \
-v "${REPO_ROOT}"/docs/generators/crd-ref:/opt/crd-docs-generator/config"${BIND_MOUNT_OPTS}" \
quay.io/giantswarm/crd-docs-generator:${CRD_DOCS_GENERATOR_VERSION} \
--config /opt/crd-docs-generator/config/config.yaml

# Organise CRDs by API group
for file in ${DESTINATION}/*.md; do
filename=$(basename $file)
apigroup=$(basename $filename .md | cut -d. -f2-)
crdname=$(basename $filename .md | cut -d. -f1)
echo "${filename} | ${apigroup}"

mkdir -p "${DESTINATION}/${apigroup}"
mv "${file}" "${DESTINATION}/${apigroup}/${crdname}.md"
done

# Generate a .pages config file to override title case being applied to
# folder names by default (https://github.com/mkdocs/mkdocs/issues/2086)
echo "nav:" > ${DESTINATION}/.pages
for dir in ${DESTINATION}/*/; do
if [ -d "${dir}" ]; then
echo ${dir}
fi
apigroup=$(basename $dir)
echo " - ${apigroup}: ${apigroup}" >> ${DESTINATION}/.pages
done
Loading