Contribute to Website

The source code for doctrine-project.org is completely open source and easy for you to setup locally so you can submit contributions back to the project.

Installation

First, create a fork of the repository and clone it to a directory like /data:

$ cd /data
$ git clone [email protected]:username/doctrine-website.git

Next run composer install to install all of the dependencies.

$ cd doctrine-website
$ composer install

Coding Standards

Copy the pre-commit hook to .git/hooks/pre-commit to ensure coding standards are maintained:

$ cp pre-commit .git/hooks/pre-commit

Configuration

Copy the app/config/local.yml.dist config file that came with the repository:

$ cp app/config/local.yml.dist app/config/local.yml

Edit your Hosts File

Edit your /etc/hosts file and point lcl.doctrine-project.org at your local web server. You will need to setup a virtual host in your web server and point the root directory at /data/doctrine-website/build-dev.

Build Documentation

Now are you ready to start building the website! First, build the documentation with the build-docs command.

This command will clone all the repositories for the documentation and switch to the appropriate branches for each version of a project when you pass the --sync-git option.

$ ./doctrine build-docs --sync-git

API Documentation

By default only the RST docs are built. You need to pass the --api option to also generate the API docs:

$ ./doctrine build-docs --sync-git --api

We use Sami for generating the PHP API documentation for each project.

Search Indexes

To build the Algolia search indexes pass the --search option:

$ ./doctrine build-docs --sync-git --search

You will need to have the doctrine.search.algolia.admin_api_key parameter in app/config/local.yml in order to update the Algolia search indexes.

Build the Website

Now you are ready to build the website for the first time:

$ ./doctrine build-website

Go take a look at lcl.doctrine-project.org and the local website should render. The built code for the website is written to /data/doctrine-website/build-dev.

Watch for Changes

You can watch for changes in the source code and automatically build the website:

$ ./doctrine watch

The browser will automatically refresh after the build finishes.

Submitting Pull Requests

If you see something that could be improved or a bug that needs fixing, submit a pull request with the changes to doctrine/doctrine-website.

You can also take a look at the list of open issues on GitHub and look for something that needs help.