You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/README.md
+12-13Lines changed: 12 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,18 +1,17 @@
1
1
Mapbox GL JS has [API documentation](#api-documentation) and [examples](#examples).
2
2
3
-
## API Documentation
3
+
## Writing API Documentation
4
4
5
-
API documentation is written as [JSDoc comments](http://usejsdoc.org/) and processed with [documentationjs](http://documentation.js.org/). We aim to document all classes and methods, public and private. Mark private classes and methods with `@private`.
5
+
API documentation is written as [JSDoc comments](http://usejsdoc.org/) and processed with [documentationjs](http://documentation.js.org/).
6
6
7
-
Any interface not explicitly marked as `@private` will be displayed on the official [Mapbox GL JS documentation page](https://www.mapbox.com/mapbox-gl-js/api/). Internal interfaces can and should be documented with JSDoc comments but must be marked as `@private`.
7
+
- Classes, methods, events and anything else in the public interface must be documented with a JSDoc comment. Everything outside of the public interface may be documented and must be tagged as `@private`.
8
+
- Text within JSDoc comments may use markdown formatting. Code identifiers must be surrounded by \`backticks\`.
9
+
- Documentation must be written in complete gramatically-correct sentances.
10
+
- Documentation must specify measurement units when applicable.
11
+
- Documentation descriptions must contain more information than what is obvious from the identifier and JSDoc metadata.
12
+
-`@param` and `@property` descriptions should be capitalized and written as if completing a sentance beginning with "This is..." or "This...".
Examples are written as Jekyll posts in `docs/_posts/examples`. The Jekyll front matter should include the following items:
18
17
@@ -28,7 +27,7 @@ In the post body, write the HTML and JavaScript constituting the example.
28
27
* Do **not** use custom styles from your personal account. Use only the default `mapbox` account styles.
29
28
* When embedding literal JSON (GeoJSON or GL style snippets) into script code, double-quote property names and string values. Elsewhere, use single-quoted strings.
30
29
31
-
## Running Documentation Server Locally
30
+
## Running the Documentation Server Locally
32
31
33
32
To start a documentation server locally run
34
33
```bash
@@ -41,7 +40,7 @@ You can view the documentation at
41
40
open http://127.0.0.1:4000/mapbox-gl-js
42
41
```
43
42
44
-
## Troubleshooting
43
+
###Troubleshooting
45
44
46
45
Ensure you have the right version of all dependencies
47
46
@@ -56,7 +55,7 @@ jekyll -v
56
55
> jekyll 2.5.3
57
56
```
58
57
59
-
## Branch Usage
58
+
## Committing and Publishing Documentation
60
59
61
60
The mapbox-gl-js repository has both `master` and `mb-pages` as active branches. The **`master` branch** is used for mainline code development: the next version of mapbox-gl-js will come from the code in this branch, and it may contain documentation and examples for APIs that are not yet part of a public release. The **`mb-pages` branch** is published to https://www.mapbox.com/mapbox-gl-js/ on any push to the branch. For the purposes of documentation changes, use these two branches as follows:
<p>Mapbox GL JS is a JavaScript library that uses WebGL to render interactive maps from <ahref='https://www.mapbox.com/blog/vector-tiles'>vector tiles</a> and <ahref='https://www.mapbox.com/mapbox-gl-style-spec'>Mapbox GL styles</a><p>
22
-
<p>It is part of the <ahref='https://github.com/mapbox/mapbox-gl'>Mapbox GL ecosystem</a> which includes <ahref='https://www.mapbox.com/mobile/'>Mapbox Mobile</a>, a suite of compatible SDKs for native desktop and mobile applications.</p>
<p>Mapbox GL JS is a JavaScript library that uses WebGL to render interactive maps from <ahref='{{site.url}}/help/define-vector-tiles'>vector tiles</a> and <ahref='{{site.url}}/mapbox-gl-style-spec'>Mapbox GL styles</a>.<p>
22
+
<p>It is part of the <ahref='https://github.com/mapbox/mapbox-gl'>Mapbox GL ecosystem</a> which includes <ahref='{{site.url}}/mobile/'>Mapbox Mobile</a>, a compatible renderer written in C++ with bindings for desktop and mobile platforms.</p>
<p>To use the <ahref='https://www.mapbox.com/maps/'>vector tiles</a> and styles hosted on <ahref='http://mapbox.com'>Mapbox</a>, you must <ahref='https://www.mapbox.com/studio/signup/'>create an account</a> and <ahref='https://www.mapbox.com/studio/account/tokens/'>obtain an access token</a>. You can learn more about access tokens <ahref='https://www.mapbox.com/help/define-access-token/'>here</a>.
0 commit comments