From 5e213d0db1bf1674e9a3374a9c0325b9a150c5d8 Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Tue, 21 Aug 2018 19:16:18 -0400 Subject: [ios, build] Improve jazzy readme generation - Include changelogs for all releases in the current semver minor series. - Use template for jazzy readme. --- platform/ios/scripts/document.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'platform/ios/scripts/document.sh') diff --git a/platform/ios/scripts/document.sh b/platform/ios/scripts/document.sh index 407d5f9adf..19fce4a0f9 100755 --- a/platform/ios/scripts/document.sh +++ b/platform/ios/scripts/document.sh @@ -4,8 +4,12 @@ set -e set -o pipefail set -u +function step { >&2 echo -e "\033[1m\033[36m* $@\033[0m"; } +function finish { >&2 echo -en "\033[0m"; } +trap finish EXIT + if [ -z `which jazzy` ]; then - echo "Installing jazzy…" + step "Installing jazzy…" CIRCLECI=${CIRCLECI:-false} if [[ "${CIRCLECI}" == true ]]; then @@ -28,11 +32,10 @@ RELEASE_VERSION=$( echo ${SHORT_VERSION} | sed -e 's/^ios-v//' -e 's/-.*//' ) rm -rf /tmp/mbgl mkdir -p /tmp/mbgl/ + +step "Generating readme and release notes" README=/tmp/mbgl/README.md -cp platform/ios/docs/doc-README.md "${README}" -# http://stackoverflow.com/a/4858011/4585461 -echo "## Changes in version ${RELEASE_VERSION}" >> "${README}" -sed -n -e '/^## /{' -e ':a' -e 'n' -e '/^## /q' -e 'p' -e 'ba' -e '}' platform/ios/CHANGELOG.md >> "${README}" +node platform/ios/scripts/release-notes.js jazzy >> "${README}" rm -rf ${OUTPUT} mkdir -p ${OUTPUT} @@ -40,6 +43,7 @@ mkdir -p ${OUTPUT} cp -r platform/darwin/docs/img "${OUTPUT}" cp -r platform/ios/docs/img "${OUTPUT}" +step "Generating jazzy docs for ${SHORT_VERSION}…" DEFAULT_THEME="platform/darwin/docs/theme" THEME=${JAZZY_THEME:-$DEFAULT_THEME} @@ -53,6 +57,7 @@ jazzy \ --root-url https://www.mapbox.com/ios-sdk/api/${RELEASE_VERSION}/ \ --theme ${THEME} \ --output ${OUTPUT} + # https://github.com/realm/jazzy/issues/411 find ${OUTPUT} -name *.html -exec \ - perl -pi -e 's/BRANDLESS_DOCSET_TITLE/iOS SDK $1/, s/Mapbox\s+(Docs|Reference)/Mapbox iOS SDK $1/' {} \; + perl -pi -e 's/BRANDLESS_DOCSET_TITLE/iOS SDK $1/, s/Mapbox\s+(Docs|Reference)/Mapbox Maps SDK for iOS $1/' {} \; -- cgit v1.2.1