IGListKit/scripts/build_docs.sh
Jesse Squires 895de471ba Regenerate docs, move docs build script
Summary:
- Move docs script to `scripts/`
- Add small note on README about regenerating docs
- Re-gen docs (doing this because of all the recent spelling, etc. fixes -- note, no breaking changes have landed, so we're good to re-gen.)
Closes https://github.com/Instagram/IGListKit/pull/797

Differential Revision: D5162705

Pulled By: rnystrom

fbshipit-source-id: 83cb0f171c10526a8a4b5d8a746fc2226987f256
2017-05-31 21:01:49 -07:00

50 lines
1.2 KiB
Bash
Executable file

#!/bin/bash
if ! which jazzy >/dev/null; then
echo "Jazzy not detected: You can download it from https://github.com/realm/jazzy"
exit
fi
# Docs by jazzy
# https://github.com/realm/jazzy
# ------------------------------
SOURCE=Source
SOURCE_TMP=IGListKit
SOURCEDIR=Source/
COMMONDIR=Source/Common/
# store all the file names in Common folder
COMMONFILES=($(find Source/Common -maxdepth 1 -type f -exec basename {} \;))
# move files in Common folder to Source folder
for f in "${COMMONFILES[@]}"
do
mv $COMMONDIR$f $SOURCE
done
# temporary workaround when using SPM dir format
# https://github.com/realm/jazzy/issues/667
mv $SOURCE $SOURCE_TMP
jazzy \
--objc \
--clean \
--author 'Instagram' \
--author_url 'https://twitter.com/fbOpenSource' \
--github_url 'https://github.com/Instagram/IGListKit' \
--sdk iphonesimulator \
--module 'IGListKit' \
--framework-root . \
--umbrella-header $SOURCE_TMP/IGListKit.h \
--readme README.md \
--documentation "Guides/*.md" \
--output docs/
# restore the dir per the jazzy issue
mv $SOURCE_TMP $SOURCE
# move files back to Common folder
for f in "${COMMONFILES[@]}"
do
mv $SOURCEDIR$f $COMMONDIR
done