[ios] Split API index from package readme

The API index page serves a different purpose than the readme. It doesn’t need installation instructions, but it does need a brief What’s New section.
This commit is contained in:
Minh Nguyễn
2016-01-22 12:15:50 -08:00
committed by Minh Nguyễn
parent 83deed6a88
commit f65ff9ef30
4 changed files with 22 additions and 3 deletions

View File

@@ -14,12 +14,22 @@ if [ -z `which jazzy` ]; then
fi
OUTPUT=${OUTPUT:-documentation}
README=${README:-README.md}
BRANCH=$( git describe --tags --match=ios-v*.*.* --abbrev=0 )
SHORT_VERSION=$( echo ${BRANCH} | sed 's/^ios-v//' )
RELEASE_VERSION=$( echo ${SHORT_VERSION} | sed -e 's/^ios-v//' -e 's/-.*//' )
rm -rf /tmp/mbgl
mkdir -p /tmp/mbgl/
README=/tmp/mbgl/README.md
cp ios/docs/doc-README.md "${README}"
# http://stackoverflow.com/a/4858011/4585461
echo "## Changes in version ${RELEASE_VERSION}" >> "${README}"
sed -n -e '/^## iOS/{' -e ':a' -e 'n' -e '/^##/q' -e 'p' -e 'ba' -e '}' CHANGELOG.md >> "${README}"
rm -rf ${OUTPUT}
mkdir -p ${OUTPUT}
jazzy \
--sdk iphonesimulator \
--github-file-prefix https://github.com/mapbox/mapbox-gl-native/tree/${BRANCH} \

View File

@@ -228,4 +228,4 @@ sed -i '' \
cp ${README} "${OUTPUT}"
step "Generating API documentation…"
make idocument OUTPUT="${OUTPUT}/documentation" README=${README}
make idocument OUTPUT="${OUTPUT}/documentation"