From 96524b998f7267bd2e1163acb87f5f532ead63ad Mon Sep 17 00:00:00 2001 From: nikhiljindal Date: Mon, 20 Jul 2015 00:44:11 -0700 Subject: [PATCH] Linking to API object definitions from docs --- build/mark-new-version.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/build/mark-new-version.sh b/build/mark-new-version.sh index 4024b8c189f..c71b33e9ef3 100755 --- a/build/mark-new-version.sh +++ b/build/mark-new-version.sh @@ -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 '//,//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='' + is_versioned_tag=" + + " 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