mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-07-18 04:54:54 +00:00
Linking to API object definitions from docs
This commit is contained in:
@@ -92,7 +92,8 @@ fi
|
||||
echo "+++ Versioning documentation and examples"
|
||||
|
||||
# Update the docs to match this version.
|
||||
HTML_PREVIEW_PREFIX="https://htmlpreview.github.io/?https://github.com/GoogleCloudPlatform/kubernetes"
|
||||
HTML_PREVIEW_PREFIX="https://htmlpreview.github.io/\?https://github.com/GoogleCloudPlatform/kubernetes"
|
||||
|
||||
md_dirs=(docs examples)
|
||||
md_files=()
|
||||
for dir in "${md_dirs[@]}"; do
|
||||
@@ -101,15 +102,17 @@ done
|
||||
for doc in "${mdfiles[@]}"; do
|
||||
$SED -ri \
|
||||
-e '/<!-- BEGIN STRIP_FOR_RELEASE -->/,/<!-- END STRIP_FOR_RELEASE -->/d' \
|
||||
-e "s|(releases.k8s.io)/[^/]+|\1/${NEW_VERSION}|" \
|
||||
-e "s|(releases.k8s.io)/[^/]+|\1/${NEW_VERSION}|g" \
|
||||
"${doc}"
|
||||
|
||||
# Replace /HEAD in html preview links with /NEW_VERSION.
|
||||
$SED -ri -e "s|(${HTML_PREVIEW_PREFIX}/HEAD)|${HTML_PREVIEW_PREFIX}/${NEW_VERSION}|"
|
||||
$SED -ri -e "s|(${HTML_PREVIEW_PREFIX}/HEAD)|${HTML_PREVIEW_PREFIX}/${NEW_VERSION}|" "${doc}"
|
||||
|
||||
is_versioned_tag='<!-- TAG IS_VERSIONED -->'
|
||||
is_versioned_tag="<!-- BEGIN MUNGE: IS_VERSIONED -->
|
||||
<!-- TAG IS_VERSIONED -->
|
||||
<!-- END MUNGE: IS_VERSIONED -->"
|
||||
if ! grep -q "${is_versioned_tag}" "${doc}"; then
|
||||
echo "${is_versioned_tag}" >> "${doc}"
|
||||
echo -e "\n\n${is_versioned_tag}\n\n" >> "${doc}"
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
Reference in New Issue
Block a user