What is Drupal Documentation?
Members of the Drupal community can write and edit all sorts of Drupal documentation:
- Community Documentation pages on Drupal.org
- Programming API reference on api.drupal.org
- Communication and marketing pages on Drupal.org
- Help pages within the core Drupal software
- Documentation embedded in and distributed with contributed modules and themes
- Externally-hosted documentation (blog posts, etc.), some of which gets posted to Planet Drupal
You can be part of this effort! By writing and reviewing documentation, you will:
- Learn more about Drupal
- Share your knowledge with other Drupalists
- Gain experience in technical writing and editing, with friendly mentoring
- Build your reputation
- Help the Drupal open-source community by improving the documentation
... and there are many other reasons people write free documentation.
Who can contribute
Anyone can contribute to Drupal documentation. We especially welcome the contributions of Drupal beginners. In fact, beginners have a distinct advantage over the experts, because they can more easily spot the places where documentation is lacking.
How to contribute
To find a documentation task to work on, browse through the New contributor tasks page, especially the 'Anyone' and 'Writers' sections, and find tasks in each that are related to Drupal documentation. The tasks are written up with detailed instructions and links to background material.
If you're already familiar with the procedures, check out the Current Priorities page to learn about the immediate documentation writing and editing priorities of the documentation team.
You can also read the Contributing to documentation FAQ.
This page documents a high-level overview of the current best practice recommendations for contributing change requests, in the form of a patch file, to projects (e.g., modules, themes, Drupal core, etc) hosted on Drupal.org using Git. For a more advanced workflow with Git, please refer to the Advanced patch contributor guide. Drush issue queue commands makes it easier and faster to create and work with patches.
Note 1: If you're unfamiliar with patching Drupal, please read the Getting Involved section on Patches.
Note 2: If you choose to create patches with a tool other than Git, be sure to produce a -p1 patch; the old -p0 format was phased out in 2011
There is a short video on Applying and Creating Patches with Git that covers much of this material as well.
Quick and simple patch
This section is written to be a step-by-step guide to help someone contribute their first patch.
Select the dev version that you wish to patch/update. This is typically the current Drupal release with the module's version and '-dev' appended. ex: 7.x-1.x-dev. Make patches against the -dev version because it is the latest code. Note that when you're working on the -dev branch with git, you won't actually append '-dev' to the branch name or see '-dev' in the branch name. Just the fact that the branch name ends in '.x' (e.g. 7.x-1.x) means it is a development branch. Any changes since the last release, 7.x-1.2, will already be in the -dev branch.
Copy the "git clone --branch .. " command
git branch [issue-number]-[issue-description]
ex: git branch 1234-fix-for-header
To see if it worked:
Notice the '*', it tells which branch git is using. To use the new branch, tell git to checkout the files from branch 1234-fix-for-header. Note: 'git checkout branch-name' replaces all of the revision-ed files in the directory with the files from that branch, essentially swapping out one version for another. In our case, the files are the same so there isn't any noticeable change. (To quickly fill in the branch-name, start typing and hit 'tab'.)
git checkout 1234-fix-for-header
Now make the changes you want to the modules or themes. You can use git to see about general changes you've made, specific changes you made, add files you created, and commit your work.
When you're ready to make a patch. Go to the folder of the module or theme. Commit any changes you've made, then use 'git diff 7.x-1.x' to review the changes that will go into the patch.
(To exit git diff, simply press q.)
When you're ready, create the patch with this command:
git diff 7.x-1.x > [project_name]-[short-description]-[issue-number]-[comment-number].patch
Now go upload the patch! congratulations on helping to make Drupal better!