This repo hosts all of the Android documentation for the Mapbox platform, including the Maps SDK, the Java SDK, the Navigation SDK, and Mapbox Plugins. Visit Mapbox Android Docs to view the live website.
To host this website locally, you'll need to have Node.js installed and setup via nvm.
This repository uses git submodules, so it needs to be cloned recursively to include:
examples/maps
, sourced frommapbox-android-demo
examples/navigation
, sourced frommapbox-navigation-android
git clone --recursive [email protected]:mapbox/android-docs.git
Change your working directory to the cloned repository:
cd android-docs
Use nvm
to install and use the version of node specified in .nvmrc
:
nvm install
nvm use
Upgrade your version of npm
:
npm install -g npm@6
To install site and build dependencies, run:
npm install
The Android documentation uses Batfish, a static-site generator powered by react and webpack. To get started contributing to the documentation and running the site locally you'll need to navigate to this projects folder and execute:
npm start
This will set up a server running at http://localhost:8080/android/. If you make changes to the source content, your browser should automatically refresh using livereload once you save the file.
To run the tests locally, run:
npm test
The test suite will lint JavaScript as well as:
- Run remark-linters that lint markdown files
- check for broken links
- validate the frontmatter on each page
- check for non-descriptive link text
- Run @mapbox/copyeditor to validate writing
- asserts the Mapbox documentation style guide
- checks spelling
- checks for plain language and suggests alternatives
If the tests return an error or warning, follow the guidance from the test to fix it.
To update the site for a Maps SDK or Navigation SDK release:
- Run
node scripts/update.js <product> <version>
. Where :<product>
is eithermaps
ornavigation
<version>
is the version number. It must follow the formatX.X.X
, whereX
is an integer. Optional: append the version number with-beta.X
or-rc.X
whereX
is also an integer.
- Commit and push the commits that are created.
Running scripts/update.js
will:
- Update the relevant variable in
src/constants.json
. - Add the new version number to the relevant data file (
src/data/*-version-numbers.json
). - Rewrite the relevant HTML redirects in the
api/
folder to point to the docs for the new version number.
If you'd like to add to this repo's Android documentation, please read the contribution guide to learn how to get started.