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.
First, create a fork of the
repository and clone
it to a directory like
$ cd /data
$ git clone [email protected]:username/doctrine-website.git
composer install && yarn install to install all of the dependencies.
$ cd doctrine-website
$ composer install && yarn install
pre-commit hook to
.git/hooks/pre-commit to ensure
coding standards are maintained:
$ cp pre-commit .git/hooks/pre-commit
config/local.yml.dist config file that came with the
$ cp config/local.yml.dist config/local.yml
In order to build the website, you will need to configure a GitHub API key
doctrine.website.github.http_token parameter in your
You can create an API token by going to the Personal access tokens
section on the GitHub website.
Algolia Search Indexes
In order to build the Algolia search indexes you will need to configure the
doctrine.website.algolia.admin_api_key parameter in your
This key is not distribute to anyone, is optional and is not required in order to build
Edit your Hosts File
/etc/hosts file and point
your local web server. You will need to setup a virtual host in your web
server and point the root directory at
Sync Project Repositories
First you need to checkout or update the repositories for each project.
$ ./bin/console sync-repositories
Build Website Data
The website build process relies on data that is dynamically pulled from Git, GitHub API
and YAML files in the
config folder. To build the website data, run the
$ ./bin/console build-website-data
Now are you ready to start building the website! Build the documentation with the
$ ./bin/console build-docs
By default only the RST docs are built. You need to pass the
option to also generate the API docs:
$ ./bin/console build-docs --api
We use Sami for generating the PHP API documentation for each project.
To build the Algolia search indexes pass the
$ ./bin/console build-docs --search
You will need to have the
config/local.yml in order to update the Algolia search
Build the Website
Now you are ready to build the website for the first time:
$ ./bin/console 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
Watch Frontend Assets
After the initial build you can watch for frontend asset changes to update the stylesheets.
$ npm run watch
This process will run in the foreground and recompile the assets when a change is made to them. After refreshing the browser you should see the new assets loaded.
The Doctrine documentation is written in a markup language called
reStructuredText (RST). It is an easy-to-read, what-you-see-is-what-you-get plaintext markup syntax and parser system. The syntax is parsed by the doctrine/rst-parser library.
You can see examples of RST here.