You are currently viewing a snapshot of www.mozilla.org taken on April 21, 2008. Most of this content is highly out of date (some pages haven't been updated since the project began in 1998) and exists for historical purposes only. If there are any pages on this archive site that you think should be added back to www.mozilla.org, please file a bug.



mozilla.org content and cvs

Mike Shaver, Terry Weissman, and Jamie Zawinski
fantasai and benc

This document outlines important things you should know about adding content to a subtree of the mozilla.org website follow. Understand them well, for if you break your section of the website, you will have only yourself to blame. (Unless our instructions suck, of course, in which case we'll have to help you fix it, and you may mock us mercilessly.)

  1. About the mozilla.org Build System
  2. CVS Access to the Website Tree
    1. Anonymous Access
    2. CVS Account Access
  3. Checking Out
  4. Checking In
  5. Web-Based CVS Access with Doctor
  6. Bonsai
  7. Building mozilla.org
    1. Setting Up on Unix
    2. Setting Up on Windows
    3. Setting Up on Mac OS
    4. The Build Command

The mozilla.org Build System

The entire mozilla.org website is built off of a CVS tree of plain, unadorned HTML files. These and all other files on the website are contained in the html subdirectory of the website CVS root. A set of makefiles and Perl scripts periodically processes these files and places the result in an output subdirectory. The contents of the output subdirectory is what gets served up as the mozilla.org website. You can run this build process on your own machine by checking out the website CVS tree and building mozilla.org.

All files that are checked in to the CVS repository anywhere under the html directory will be visible on the web site.

By default, HTML files will have the standard mozilla.org left-edge menu appended to them; those HTML files listed in the NOWRAP file in the same directory will not be wrapped. (Only HTML files will ever be wrapped, so you needn't list images in NOWRAP.) Files listed in the NOMENU file in the same directory will be wrapped with just the horizontal headers and footers appended to them (without the sidebar menu).

Your files should look like the ones in the html directory, in that they should have only your content, and not the menu bar hackery. The menu bar hackery gets added through the dark magic of Perl. If you want something added to the left-side menu, you have to ask One Of Us to do it.

When adding or removing files, altering the NOWRAP file in any way, or—especially—editing either the root index.html or news.html, you must ensure that running gmake/make from the website root directory completes successfully. This will regenerate the Makefile to take into account the new files.

If you do something that horks the make process, then no new content can show up anywhere on mozilla.org until it is fixed. Breaking things in this way is therefore a fairly big deal, so don't do it. You wouldn't check in source code without making sure it compiled first, would you? Of course not. This is the same situation.

CVS Access to the Website Tree

There are two CVS repositories, the primary at cvs.mozilla.org and a secondary, read only at cvs-mirror.mozilla.org. The primary CVS repository is accessed via ssh. (If you're accessing the mirror, use pserver.)

For anonymous access

Set your $CVSROOT variable to

:pserver:anonymous@cvs-mirror.mozilla.org:/www

The password for anonymous is anonymous.

For access using your CVS account

Set your $CVSROOT variable to

your%address@cvs.mozilla.org:/www

Where it says your%address above, you would substitute your canonical email address, but replacing the @ character with %. For example, if your email address was foo@bar.com your $CVSROOT would be

foo%bar.com@cvs.mozilla.org:/www

Checking Out

Once $CVSROOT is set properly, you can check out the website. The entire tree is very large, so we suggest doing a checkout of the lowest-possible directory. For example, someone interested in Networking QA would probably check out just the /quality/networking directory:

cvs -z3 co mozilla-org/html/quality/networking

The -z3 is to compress things during transit.

If you need to build the website, you also need to check out the ScriptBase module:

cvs -z3 co ScriptBase

ScriptBase module is the smallest documentation module available and contains only the set of necessary scripts, the wrapper and a minimal set of docs.

The MozillaOrgTrim module checks out a partial version of the web site that's missing some of the larger pieces. The MozillaOrg module checks out the entire web site. For a complete list of modules type:

cvs co -c

Checking In

You must cvs add before committing a new file, and you should follow all the other rules of good CVS hygiene as well, such as properly tagging binary files with -kb to avoid corruption, etc.

In general, you are expected to behave responsibly, and to not modify files that you know nothing about. If you are not completely sure about what you are editing, opening a bug in "Documentation" and involving other well-informed contributors is a good idea.

There are a few files (in particular, mozilla-org/html/index.html and mozilla-org/html/news.html) that are tightly controlled; any attempt to check in changes to these files will fail. If you really need to make a change and the system refuses you, send mail to webmaster@mozilla.org.

Web-Based CVS Access with Doctor

If you do not have a CVS client or cannot use one, we have a webtool called Doctor which can be used to create and edit files. If you have an active CVS account, you can submit changes through Doctor. If you don't, you can still use Doctor to create a patch.

To use Doctor to edit an existing page, click on the "Edit this Page" link at the bottom of the document or enter its path in the text field on Doctor's main page. The page's HTML will be presented in an editable text field. Make your edits, and hit "Review Changes". Your changes will appear in "diff" format. If you have CVS access, you can commit your changes right there. If you do not have CVS access, you can copy the diff to a text file, which you should submit as a patch in Bugzilla.

To create a new page visit http://doctor.mozilla.org.

Doctor is not recommended for people who already know or are willing to learn CVS.

Bonsai

You can query the website CVS record at bonsai.

Building mozilla.org

To build mozilla.org you will need:

  • CVS (to check out the sources)
  • Perl 5
  • Template-Toolkit Perl module (2.13 or later)
  • DateManip Perl module
  • XML-Simple Perl module (needed to build front page)
  • GNU make

If you are planning to work with XML files on developer.mozilla.org, you will also need libxslt.

Setting up a Unix or Mac OS X Build Environment

If you're running Unix/Linux, you should know where to get your packages from. The package names are usually cvs, perl, and make. If you're on Mac, you already have perl, and you can get cvs and make by installing the Developer Tools CD.

The perl modules can be installed from CPAN with the following commands:

perl -MCPAN -e "install 'Template'"
perl -MCPAN -e "install 'Date::Manip'"
perl -MCPAN -e "install 'XML::Simple'"

Setting up a Windows Build Environment

There are, of course, multiple routes to getting the appropriate tools installed. I used ActivePerl (it comes with nicer documentation), but I'm told Cygwin perl also works.

  1. Install Cygwin
    1. When prompted to choose line endings, pick UNIX-style.
    2. When prompted to choose packages, make sure that cvs, patch, and make, are selected for installation. (Select libxslt as well if you need it.) If you want to install Perl through Cygwin rather than ActivePerl, select the perl package, too.
    3. Add the cygwin bin directory to your PATH environment variable. You can do this in the System dialog brought up by right-clicking My Computer (permanent, recommended) or by typing set PATH=C:\path_to_cygwin\bin;%PATH% at the command prompt (temporary, applies to that command session only). You also need to set a TZ environment variable to a time zone (such as PST) for the Date::Manip Perl module to work correctly.
  2. If you didn't install Perl through Cygwin, install ActivePerl, and tell it to add Perl to your PATH environment, too.
  3. Install the Template-Toolkit, DateManip, and XML-Simple Perl modules:
  4. If you have ActivePerl installed, you can install them with ppm:
    1. Start the DOS command prompt
    2. Type ppm and press Enter
    3. Follow the setup instructions, if any. (Don't worry about them too much.)
    4. Type the following commands into the ppm prompt:
      ppm>install Template-Toolkit
      ppm>install DateManip
      ppm>install XML-Simple
      ppm>quit
      
    If you installed perl via Cygwin instead of with ActivePerl, you can get the necessary perl modules from CPAN as on Unix:
    1. Start the DOS command prompt
    2. Type the following commands:
      >perl -MCPAN -e "install 'Template'"
      >perl -MCPAN -e "install 'Date::Manip'"
      >perl -MCPAN -e "install 'XML::Simple'"
      
      Perl will run you through some setup configuration (same as ppm's) the first time you install a module. Follow the instructions, but don't worry about them too much.

The Build Command

To build the mozilla.org tree, cd into mozilla-org and run make.

If you can't run make, try running the tools/munge.pl script directly.