Skip to content

Commit

Permalink
Improve/update documentation generation process
Browse files Browse the repository at this point in the history
  • Loading branch information
captainbarbosa committed Sep 30, 2019
1 parent 50638da commit 9a02a15
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 14 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ xcuserdata
Pods
*.xcworkspace
*.xcuserstate
*documentation/api-docs/
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "jazzy-theme"]
path = annotations-framework-extension/documentation/jazzy-theme
[submodule "documentation/jazzy-theme"]
path = documentation/jazzy-theme
url = https://github.com/mapbox/jazzy-theme.git
2 changes: 1 addition & 1 deletion DEVELOPING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Generate the .xcworkspace for the framework extension by running `pod install`.
This project is documented with [Jazzy](https://github.com/realm/jazzy) (v0.10.0). To generate documentation from code comments, run the following command from the root directory of this project:

```
./annotations-framework-extension/documentation/generate_docs.sh
./documentation/generate_docs.sh
```

## Testing
Expand Down
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,21 @@ To install the Mapbox Annotation Extension using CocoaPods:

Create a Podfile with the following specification:

```
pod 'MapboxAnnotationExtension', '0.0.1-beta.1'
Run pod repo update && pod install and open the resulting Xcode workspace.
```
Run `pod repo update && pod install` and open the resulting Xcode workspace.

### Using Carthage
Alternatively, to install the Mapbox Annotation Extension using Carthage:

Create a Cartfile with the following dependency:

```
github "mapbox/mapbox-annotation-extension" ~> 0.0.1-beta.1
Run carthage update --platform iOS to build just the iOS dependencies.
```

Run `carthage update --platform iOS` to build just the iOS dependencies.

### Manual Installation

Expand Down
34 changes: 27 additions & 7 deletions documentation/generate_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,31 @@ set -e
set -o pipefail
set -u

echo "Generating docs..."
# platform/ios/jazzy.yml
function step { >&2 echo -e "\033[1m\033[36m* $@\033[0m"; }
function finish { >&2 echo -en "\033[0m"; }
trap finish EXIT

step "Checking for Jazzy installation"
if [ -z `which jazzy` ]; then
echo "Jazzy not found on this machine. Installing jazzy…"
gem install jazzy
if [ -z `which jazzy` ]; then
echo "Unable to install jazzy :("
exit 1
fi
fi

# Search for `s.version` in podspec, grab the first result,
# and return only the version between quotes
VERSION=$( grep -n "s.version" MapboxAnnotationExtension.podspec | head -n 1 | cut -d \" -f2 )

step "Jazzy installed. \nGenerating docs for Mapbox Annotation Extension ${VERSION}..."

jazzy \
--config annotations-framework-extension/documentation/jazzy.yml \
--output annotations-framework-extension/documentation/api-docs \
--readme annotations-framework-extension/README.md \
--title "Annotations Extension" \
--module-version v0.0.0-alpha.2
--config documentation/jazzy.yml \
--output documentation/api-docs \
--readme README.md \
--title Annotations Extension \
--module-version v${VERSION}

step "Documentation generated for Annotation Extension ${VERSION}! \nPublish it by copying docs to a new pull request in ios-sdk."
1 change: 1 addition & 0 deletions documentation/jazzy-theme
Submodule jazzy-theme added at 75b917
4 changes: 2 additions & 2 deletions documentation/jazzy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ objc: Yes
sdk: iphonesimulator
skip_undocumented: Yes
hide_documentation_coverage: Yes
umbrella_header: ../MapboxAnnotationsExtension/MapboxAnnotationsExtension.h
framework_root: ../MapboxAnnotationsExtension
umbrella_header: ../MapboxAnnotationExtension/MapboxAnnotationExtension.h
framework_root: ../MapboxAnnotationExtension
theme: jazzy-theme

custom_categories:
Expand Down

0 comments on commit 9a02a15

Please sign in to comment.