8000 mapbox.js/README.md at gh-pages · dominicbarnes/mapbox.js · GitHub
[go: up one dir, main page]

Skip to content

Latest commit

 

History

History
46 lines (33 loc) · 1.61 KB

README.md

File metadata and controls

46 lines (33 loc) · 1.61 KB

mapbox.js examples

Guidelines

  • The structure of an example is _posts/examplename/0100-01-01-examplename.html.
  • All files necessary for examples must be in their own directory.
  • Examples use hosted mapbox.js, with the latest deployed version.
  • Use the AirBnb style guide styles, but with 4 spaces not 2.
  • Example code should pass jshint
  • Where possible, examples should be cross-browser and touch-compatible.
  • Use long, descriptive names for variables.
  • Add comments for pitfalls where users might run into problems, and for parts of the code that users will need to modify to get things working.

Creating a new Example

To create a new example, git clone this branch:

git clone -b gh-pages git@github.com:mapbox/mapbox.js.git mapbox.js-site cd mapbox.js-site

You will need jekyll installed.

Run the site:

jekyll serve -w -p 4000

Edit the site. Existing examples are located here - copy one to a new file with the same naming convention to start a new example. Test your new example by going to http://localhost:4000/mapbox.js/ and finding and using it.

When you're done,

git add _posts/...newexample
git commit -m "Added a new example, showing off XYZ"
git push origin gh-pages

Updating the site to the latest deployed version of mapbox.js:

  • The version tag is updated in the _config.yml file under version:.
  • Rebuild the docs cd _docs && ./build.sh VERSION
  • Each example should be tested against the version change.
0