A step-by-step guide for third-party developers to contribute to html5rocks.com. Before you draft the article, read our writing tips.
HTML5Rocks runs on Google App Engine (Python). Before you check out the code, download the App Engine Python SDK. The SDK is not required, but highly recommended. You'll want to run a local development server and preview your changes before submitting a tutorial, sample, or patch.
If you're interested in writing an article, please file an issue and wait to hear from us before writing the content!
The entirety of HTML5Rocks (www, slides, playground, updates) is located on Github.
Each sub-domain points to a separate Google App Engine (Python) application with a corresponding repository.
- www.html5rocks.com: Source at www.html5rocks.com
- slides.html5rocks.com: Source at slides.html5rocks.com
- playground.html5rocks.com: Source at playground.html5rocks.com
- updates.html5rocks.com: Source at updates.html5rocks.com
To checkout the corresponding source, fork us an run the following command:
git clone git://github.com/html5rocks/www.html5rocks.com.git
- Install the App Engine SDK using either the Google App Engine launcher or by manually downloading the SDK (for advanced users working with multiple versions of the SDK for different projects) and making sure it's on your path.
- Open the project folder in a terminal, and start the server with
devappserver2.py .
- Import data by navigating to http://localhost:8080/database/load_all.
- You'll find your local version of html5rocks.com being served on http://localhost:8080
This section only applies if you are submitting a patch for us. The CLA mentioned below does not apply if you are giving us a brand new article or tutorial.
We'd love to accept your code patches! However, before we can take them, we have to jump a couple of legal hurdles.
Please fill out either the individual or corporate Contributor License Agreement.
- If you are an individual writing original source code and you're sure you own the intellectual property, then you'll need to sign an individual CLA.
- If you work for a company that wants to allow you to contribute your work to HTML5Rocks.com, then you'll need to sign a corporate CLA.
Follow either of the two links above to access the appropriate CLA and instructions for how to sign and return it. Once we receive it, we'll add you to the official list of contributors and be able to accept your patches.
- Sign the contributors license agreement above.
- Decide which code you want to submit. A submission should be a set of changes that addresses one issue in the issue tracker. Please don't mix more than one logical change per submittal, because it makes the history hard to follow. If you want to make a change (e.g. add a sample or feature) that doesn't have a corresponding issue in the issue tracker, please create one.
- Submitting: When you are ready to submit, send us a Pull Request!
If your contribution contains code, please make sure that it follows the style guide, otherwise we will have to ask you to make changes, and that's no fun for anyone.
To simplify PR reviews, please word-wrap HTML files at 80 characters or less.
- Our articles and case studies are licensed under Creative Commons Attribution 3.0 License. Be sure you are OK with that.
- If one doesn't already exist, Create a new issue so others can follow/comment on the progress of your work. Wait to hear from us before you start writing!
###Authoring process###
- If you are a new author, add yourself to
www.html5rocks.com/database/profiles.yaml
. We'll also need a.png
photo of you for the profiles page. - You'll be adding your tutorial/case study under
/content/tutorials/<api_topic>
. If an appropriate directory doesn't already exist, you'll need to create a new one. Our convention is/content/tutorials/<api_topic>/<tutorial_name>/<lang>/index.html
. These directories map to the live site athttp://www.html5rocks.com/<lang>/tutorials/<api_topic>/<tutorial_name>
, so please use good judgement when naming your new directory/tutorial. HTML files will automatically be parsed by the templating system, which is Django based. See Django template tags and filters for more information. - If you're writing a case study, add your article under
/content/tutorials/casestudies/
instead. - Copy
www.html5rocks.com/content/tutorials/tutorial.html.template
to your directory and replace its holder blocks (all optional) like{% block iscompatible %}
with your own feature detect and{% block share_image %}{% endblock %}
with the image that will get shared in social widgets. If you need styles or code in the<head>
, override the head block. Also remove the comments at the top, otherwise you'll get parsing errors. - Finally, add your article to the /database/tutorials.yaml file. This file is used for backing up our database. Modify a previous entry to match the details of your tutorial. When possible, try to use existent tags. If you're writing a case study, be sure to tag the article with the
type:casestudy
tag.
Submitting: When you are ready to send us your masterpiece, send us a Pull Request.
- A URL like
http://www.html5rocks.com/features/offline
uses a file in content/features/offline.html - New files should be created using what's in
feature_empty.html
of that same directory. It has a useful markup skeleton that'll save you time.
Submitting: When you are ready to send us your masterpiece, send us a Pull Request.
A few things to note about internationalization:
- All templates need to include the
i18n
library by adding{% include 'i18n' %}
as early as possible. - UI strings must be wrapped with
{% blocktrans %}
or{% trans ... %}
tags. These are well explained in http://docs.djangoproject.com/en/1.2/topics/i18n/. - Articles live one subdirectory deeper to encode their locale. For example: https://github.com/html5rocks/www.html5rocks.com/tree/master/content/tutorials//3d/css/en/index.html for example.
- Similarly, all case studies live in https://github.com/html5rocks/www.html5rocks.com/tree/master/content/tutorials/casestudies