Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Commit 6944037

Browse files
committed
[ios] Tweaked jazzy templates
Copied jazzy templates, then inlined full library name into templates. Defined custom document categories. Moved jazzy configuration into YAML file. Corrected struct documentation.
1 parent ca924b0 commit 6944037

12 files changed

+243
-15
lines changed

.jazzy.yaml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
module_name: Mapbox
2+
#module_name: Mapbox iOS SDK
3+
author_name: Mapbox
4+
author_url: https://www.mapbox.com/
5+
github_url: https://github.com/mapbox/mapbox-gl-native
6+
dash_url: https://www.mapbox.com/ios-sdk/docsets/Mapbox.xml
7+
copyright: '© 2014–2015 [Mapbox](https://www.mapbox.com/). See [license](https://github.com/mapbox/mapbox-gl-native/blob/master/LICENSE.md) for more details.'
8+
9+
objc_mode: Yes
10+
skip_undocumented: Yes
11+
hide_documentation_coverage: Yes
12+
umbrella_header: include/mbgl/ios/Mapbox.h
13+
template_directory: ios/docs/templates
14+
15+
custom_categories:
16+
- name: Map
17+
children:
18+
- MGLAccountManager
19+
- MGLMapCamera
20+
- MGLMapView
21+
- MGLMapViewDelegate
22+
- MGLStyle
23+
- MGLUserTrackingMode
24+
- name: Annotations
25+
children:
26+
- MGLAnnotation
27+
- MGLAnnotationImage
28+
- MGLMultiPoint
29+
- MGLPointAnnotation
30+
- MGLPolygon
31+
- MGLPolyline
32+
- MGLOverlay
33+
- MGLShape
34+
- MGLUserLocation
35+
- name: Geometry
36+
children:
37+
- MGLCoordinateBounds
38+
- MGLCoordinateBoundsEqualToCoordinateBounds
39+
- MGLCoordinateBoundsGetCoordinateSpan
40+
- MGLCoordinateBoundsIsEmpty
41+
- MGLCoordinateBoundsMake
42+
- MGLCoordinateBoundsOffset
43+
- MGLCoordinateSpan
44+
- MGLCoordinateSpanEqualToCoordinateSpan
45+
- MGLCoordinateSpanMake
46+
- MGLCoordinateSpanZero
47+
- MGLDegreesFromRadians
48+
- MGLRadiansFromDegrees
49+
- MGLStringFromCoordinateBounds

include/mbgl/ios/MGLGeometry.h

+9-5
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@
66

77
NS_ASSUME_NONNULL_BEGIN
88

9-
/** Defines the area spanned by an MGLCoordinateBounds. */
10-
typedef struct {
9+
/** Defines the area spanned by an `MGLCoordinateBounds`. */
10+
typedef struct MGLCoordinateSpan {
11+
/** Latitudes spanned by an `MGLCoordinateBounds`. */
1112
CLLocationDegrees latitudeDelta;
13+
/** Longitudes spanned by an `MGLCoordinateBounds`. */
1214
CLLocationDegrees longitudeDelta;
1315
} MGLCoordinateSpan;
1416

15-
/** Creates a new MGLCoordinateSpan from the given latitudinal and longitudinal deltas. */
17+
/** Creates a new `MGLCoordinateSpan` from the given latitudinal and longitudinal deltas. */
1618
NS_INLINE MGLCoordinateSpan MGLCoordinateSpanMake(CLLocationDegrees latitudeDelta, CLLocationDegrees longitudeDelta) {
1719
MGLCoordinateSpan span;
1820
span.latitudeDelta = latitudeDelta;
@@ -30,12 +32,14 @@ NS_INLINE BOOL MGLCoordinateSpanEqualToCoordinateSpan(MGLCoordinateSpan span1, M
3032
extern const MGLCoordinateSpan MGLCoordinateSpanZero;
3133

3234
/** A rectangular area as measured on a two-dimensional map projection. */
33-
typedef struct {
35+
typedef struct MGLCoordinateBounds {
36+
/** Coordinate at the southwest corner. */
3437
CLLocationCoordinate2D sw;
38+
/** Coordinate at the northeast corner. */
3539
CLLocationCoordinate2D ne;
3640
} MGLCoordinateBounds;
3741

38-
/** Creates a new MGLCoordinateBounds structure from the given southwest and northeast coordinates. */
42+
/** Creates a new `MGLCoordinateBounds` structure from the given southwest and northeast coordinates. */
3943
NS_INLINE MGLCoordinateBounds MGLCoordinateBoundsMake(CLLocationCoordinate2D sw, CLLocationCoordinate2D ne) {
4044
MGLCoordinateBounds bounds;
4145
bounds.sw = sw;

include/mbgl/ios/MGLOverlay.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ NS_ASSUME_NONNULL_BEGIN
1313
1414
You use overlays to layer more sophisticated content on top of a map view. For example, you could use an overlay to show the boundaries of a national park or trace a bus route along city streets. The Mapbox iOS SDK defines several concrete classes that conform to this protocol and define standard shapes.
1515
16-
Because overlays are also annotations, they have similar usage pattern to annotations. When added to a map view using the `addOverlay:` method, that view detects whenever the overlay’s defined region intersects the visible portion of the map. At that point, the map view asks its delegate to provide a special overlay view to draw the visual representation of the overlay. If you add an overlay to a map view as an annotation instead, it is treated as an annotation with a single point.
16+
Because overlays are also annotations, they have similar usage pattern to annotations. When added to a map view using the `-addOverlay:` method, that view detects whenever the overlay’s defined region intersects the visible portion of the map. At that point, the map view asks its delegate to provide a special overlay view to draw the visual representation of the overlay. If you add an overlay to a map view as an annotation instead, it is treated as an annotation with a single point.
1717
*/
1818
@protocol MGLOverlay <MGLAnnotation>
1919

include/mbgl/ios/MGLTypes.h

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
NS_ASSUME_NONNULL_BEGIN
1414

15+
/** Indicates an error occurred in the Mapbox iOS SDK. */
1516
extern NSString * const MGLErrorDomain;
1617

1718
/** The mode used to track the user location on the map. */

ios/docs/templates/doc.mustache

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<title>{{name}} {{kind}} Reference</title>
5+
<link rel="stylesheet" type="text/css" href="{{path_to_root}}css/jazzy.css" />
6+
<link rel="stylesheet" type="text/css" href="{{path_to_root}}css/highlight.css" />
7+
<meta charset='utf-8'>
8+
<script src="{{path_to_root}}js/jquery.min.js" defer></script>
9+
<script src="{{path_to_root}}js/jazzy.js" defer></script>
10+
</head>
11+
<body>
12+
{{#dash_type}}
13+
<a name="//apple_ref/{{language_stub}}/{{dash_type}}/{{name}}" class="dashAnchor"></a>
14+
{{/dash_type}}
15+
<a title="{{name}} {{kind}} Reference"></a>
16+
{{> header}}
17+
<div class="content-wrapper">
18+
<p id="breadcrumbs">
19+
<a href="{{path_to_root}}index.html">Mapbox iOS SDK Reference</a>
20+
<img id="carat" src="{{path_to_root}}img/carat.png" />
21+
{{name}} {{kind}} Reference
22+
</p>
23+
</div>
24+
<div class="content-wrapper">
25+
{{> nav}}
26+
<article class="main-content">
27+
<section>
28+
<section class="section">
29+
{{^hide_name}}<h1>{{name}}</h1>{{/hide_name}}
30+
{{#declaration}}
31+
<div class="declaration">
32+
<div class="language">
33+
{{{declaration}}}
34+
</div>
35+
</div>
36+
{{/declaration}}
37+
{{{overview}}}
38+
</section>
39+
{{> tasks}}
40+
</section>
41+
{{> footer}}
42+
</article>
43+
</div>
44+
</body>
45+
</div>
46+
</html>

ios/docs/templates/footer.mustache

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<section id="footer">
2+
{{{copyright}}}
3+
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v{{jazzy_version}}</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
4+
</section>

ios/docs/templates/header.mustache

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<header>
2+
<div class="content-wrapper">
3+
<p><a href="https://www.mapbox.com/ios-sdk/">Mapbox iOS SDK</a>{{#doc_coverage}} ({{doc_coverage}}% documented){{/doc_coverage}}</p>
4+
{{#github_url}}
5+
<p class="header-right"><a href="{{github_url}}"><img src="{{path_to_root}}img/gh.png"/>View on GitHub</a></p>
6+
{{/github_url}}
7+
{{#dash_url}}
8+
<p class="header-right"><a href="{{dash_url}}"><img src="{{path_to_root}}img/dash.png"/>Install in Dash</a></p>
9+
{{/dash_url}}
10+
</div>
11+
</header>

ios/docs/templates/nav.mustache

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<nav class="sidebar">
2+
<ul class="nav-groups">
3+
{{#structure}}
4+
<li class="nav-group-name">
5+
<a href="{{path_to_root}}{{section}}.html">{{section}}</a>
6+
<ul class="nav-group-tasks">
7+
{{#children}}
8+
<li class="nav-group-task">
9+
<a href="{{path_to_root}}{{url}}">{{name}}</a>
10+
</li>
11+
{{/children}}
12+
</ul>
13+
</li>
14+
{{/structure}}
15+
</ul>
16+
</nav>

ios/docs/templates/parameter.mustache

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<tr>
2+
<td>
3+
<code>
4+
<em>{{name}}</em>
5+
</code>
6+
</td>
7+
<td>
8+
<div>
9+
{{{discussion}}}
10+
</div>
11+
</td>
12+
</tr>

ios/docs/templates/task.mustache

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
<div class="task-group">
2+
{{#name}}
3+
<div class="task-name-container">
4+
<a name="/{{uid}}"></a>
5+
<a name="//apple_ref/{{language_stub}}/Section/{{name}}" class="dashAnchor"></a>
6+
<a href="#/{{uid}}">
7+
<h3 class="section-name">{{name}}</h3>
8+
</a>
9+
</div>
10+
{{/name}}
11+
<ul>
12+
{{#items}}
13+
<li class="item">
14+
<div>
15+
<code>
16+
<a name="/{{usr}}"></a>
17+
<a name="//apple_ref/{{language_stub}}/{{dash_type}}/{{name}}" class="dashAnchor"></a>
18+
<a class="token" href="#/{{usr}}">{{name}}</a>
19+
</code>
20+
{{#default_impl_abstract}}
21+
<span class="declaration-note">
22+
Default implementation
23+
</span>
24+
{{/default_impl_abstract}}
25+
{{#from_protocol_extension}}
26+
<span class="declaration-note">
27+
Extension method
28+
</span>
29+
{{/from_protocol_extension}}
30+
</div>
31+
<div class="height-container">
32+
<div class="pointer-container"></div>
33+
<section class="section">
34+
<div class="pointer"></div>
35+
{{#abstract}}
36+
<div class="abstract">
37+
{{{abstract}}}
38+
{{#url}}
39+
<a href="{{{path_to_root}}}{{{url}}}" class="slightly-smaller">See more</a>
40+
{{/url}}
41+
</div>
42+
{{/abstract}}
43+
{{#default_impl_abstract}}
44+
<h4>Default Implementation</h4>
45+
<div class="default_impl abstract">
46+
{{{default_impl_abstract}}}
47+
</div>
48+
{{/default_impl_abstract}}
49+
{{#declaration}}
50+
<div class="declaration">
51+
<h4>Declaration</h4>
52+
<div class="language">
53+
<p class="aside-title">{{language}}</p>
54+
{{{declaration}}}
55+
</div>
56+
</div>
57+
{{/declaration}}
58+
{{#parameters.count}}
59+
<div>
60+
<h4>Parameters</h4>
61+
<table class="graybox">
62+
<tbody>
63+
{{#parameters}}
64+
{{> parameter}}
65+
{{/parameters}}
66+
</tbody>
67+
</table>
68+
</div>
69+
{{/parameters.count}}
70+
{{#return}}
71+
<div>
72+
<h4>Return Value</h4>
73+
{{{return}}}
74+
</div>
75+
{{/return}}
76+
{{#github_token_url}}
77+
<div class="slightly-smaller">
78+
<a href="{{{github_token_url}}}">Show on GitHub</a>
79+
</div>
80+
{{/github_token_url}}
81+
</section>
82+
</div>
83+
</li>
84+
{{/items}}
85+
</ul>
86+
</div>

ios/docs/templates/tasks.mustache

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{{#tasks.count}}
2+
<section class="section task-group-section">
3+
{{#tasks}}
4+
{{> task}}
5+
{{/tasks}}
6+
</section>
7+
{{/tasks.count}}

scripts/ios/package.sh

+1-9
Original file line numberDiff line numberDiff line change
@@ -139,17 +139,9 @@ cat CHANGELOG.md | sed -n "/^## iOS ${DOCS_VERSION}/,/^##/p" | sed '$d' >> ${REA
139139
# below in the presence of --xcodebuild-arguments, so we have to duplicate those
140140
# arguments in --xcodebuild-arguments.
141141
jazzy \
142-
--xcodebuild-arguments "--objc,include/mbgl/ios/Mapbox.h,-x,objective-c,-isysroot,$(xcrun --show-sdk-path --sdk iphoneos)" \
143-
--objc \
144-
--skip-undocumented \
145-
--author Mapbox \
146-
--author_url https://www.mapbox.com/ \
147-
--github_url https://github.com/mapbox/mapbox-gl-native \
142+
--xcodebuild-arguments "--objc,include/mbgl/ios/Mapbox.h,-x,objective-c,-isysroot,$(xcrun --show-sdk-path --sdk iphonesimulator)" \
148143
--github-file-prefix https://github.com/mapbox/mapbox-gl-native/tree/${HASH} \
149144
--module-version ${DOCS_VERSION} \
150-
--umbrella-header include/mbgl/ios/Mapbox.h \
151-
--framework-root . \
152-
--module Mapbox \
153145
--readme ${README} \
154146
--root-url https://www.mapbox.com/ios-sdk/api/${DOCS_VERSION}/ \
155147
--output ${DOCS_OUTPUT}

0 commit comments

Comments
 (0)