So, I wrote some instructions on my website bout setting up the API module for D6, and want to put them up at: http://drupal.org/node/26669

First, the page needs to two new headings:

Drupal 5 Instructions

(existing content starting at step 1. Also headings will need to be moved down one to h3)

Drupal 6 Instructions

These instructions are for installing the API Modulein a Drupal 6 environment. Please note that that the API module can parse any documented Drupal code, including contributed module. Meaning that the code you parse and the code you use to run your site are not necessarily the same. In fact, it may also be a good idea to keep the code that you are parsing outside of the site that is running the API module. These instructions are made with that assumption.

Step 01: Install and Setup Site

These are the basics steps for getting your site going.

  1. Download Drupal 6 at: http://drupal.org/project/drupal
  2. Install Drupal. See: http://drupal.org/getting-started/install
  3. Download and Install Job Queue module, which is a dependency of API module: http://drupal.org/project/job_queue
  4. Download and Install API module: http://drupal.org/project/api
  5. Change permissions for API module as needed at: admin/user/permissions

Step 02: Set-up Code "Repositories"

This step involves creating a place to store the code that you want to parse. We will go through instructions for a Drupal 6 code base, but this can be applied to any version of Drupal and contributed modules and themes. This also includes getting the supplemental developer documentation from CVS.

  1. Create a place for your code to go:
    mkdir -p /path/to/your/code/repos/
    cd /path/to/your/code/repos/
  2. Get the most recent version of Drupal 6 code base (see http://drupal.org/node/320 for more information). Note that we are naming our directory drupal-6. We could also get any version of Drupal 6 here.
    cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal co -r DRUPAL-6 -d drupal-6 drupal
  3. Get the extra developer documentation directly from CVS. This is the part of the documentation that brings pieces together and provides different subjects. It provides the main front page at http://api.drupal.org and the provides the different groups and subject. This also provides all the different documentation for the hooks in core, which are pretty useful.

    Go to the Drupal root of our Drupal 6 repo.
    cd /path/to/your/code/repos/drupal-6

    Checkout the developer documentation from CVS. Note that this command gets the Drupal 6 version.:
    cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib checkout -r DRUPAL-6--1 contributions/docs/developer

Step 03: Set-up API Module and Index Code

This section will tell you how to use the API module interface and how to index the code in the repo we set up above. The term "branch" is used here because of its association of use with the different Drupal branches. In reality, a "branch" is really just sets of code.

  1. Go to the site you set up in Step 01, and add a new Branch at: admin/settings/api/branches/new. Fill out the form with the following values:
    URL Label
    This is the string that will be used in the URL for the documentation that is created. I suggest: drupal-6
    Page Label
    This is the actual title of the branch of code. It will be used in tabs and blocks. I suggest: Drupal 6
    Directories
    This is a list of absolute paths to the place(s) where your code is. This is where we put in the value from Step 02. /path/to/your/code/repos/drupal-6

    Click Save Branch.

  2. Re-index the documentation at admin/settings/api/refresh. Click Reindex.

    Re-indexing is a very resource intensive tasks and is done through cron. The API module also uses the Job Queue module so that cron will only do as much as it can each time. This means that you can either wait for cron to run a few times, or run cron manually a few times at: admin/reports/status/run-cron

  3. Go to your new api documentation at: api. The content should resemble the content at http://api.drupla.org.

Step 04: Some Extra Flair

Some extra steps if you want.

  1. Enable the API blocks at: admin/build/blocks
  2. Index PHP functions at: admin/settings/api/php
  3. Use Steps 02 and 03 to create a Branch for Drupal 5.
  4. Use Steps 02 and 03 to create a Branch for Drupal 6 Contributed Modules that you use. Or, simply include contributed modules into your Drupal 6 code base that is already being indexed.

Comments

heather’s picture

This looks like a great addition. You have two options, you can make the 6.x version a new page, and link between the two. Or you can add it into the page as you suggest.

Consider that the user may want to print out your detailed instructions. Therefore, they are either using 6.x or 5.x, in that case they may not want to print out a long page. I would recommend a 2nd page, considering the length of the existing page.

You could have:
"Your own api.drupal.org site"- With general info and links to these two pages:
- Drupal API instructions for 5.x
- Drupal API instructions for 6.x

What do you think?

zzolo’s picture

Hey Heather,

Well, my feelings are against another page. My heart is having the same page with different tabs (like translations), which is what I think the redesign will go towards, form what I understand.

But, we are in the here and now. I guess the best way is to have an overview page that links to each article, and each article linking to the other.

If you like this, I will be happy to get it done.

Thanks,
zzolo

zzolo’s picture

Gonna do it!

zzolo’s picture

Status: Active » Closed (fixed)

OK, done: http://drupal.org/node/425940

API Issues to update project pages: http://drupal.org/node/425952