Sphinx extension for PHP projects

Installs: 27 722

Dependents: 1

Suggesters: 0

Security: 0

Stars: 154

Watchers: 10

Forks: 35

Open Issues: 6


v1.0.11 2018-04-20 11:27 UTC

This package is auto-updated.

Last update: 2020-02-05 22:57:42 UTC


You can install the extension by:

  • running sudo pip install git+https://github.com/fabpot/sphinx-php.git;

  • cloning the project and add sensio to your path (with something like sys.path.insert(0, os.path.abspath('./path/to/sensio'))).

  • Arch Linux users can use the AUR package

You can use the following extensions in your conf.py file:

  • sensio.sphinx.refinclude
  • sensio.sphinx.configurationblock
  • sensio.sphinx.phpcode
  • sensio.sphinx.bestpractice

To enable highlighting for PHP code not between <?php ... ?> by default:

# loading PhpLexer
from sphinx.highlighting import lexers
from pygments.lexers.web import PhpLexer

# enable highlighting for PHP code not between ``<?php ... ?>`` by default
lexers['php'] = PhpLexer(startinline=True)
lexers['php-annotations'] = PhpLexer(startinline=True)

And here is how to use PHP as the primary domain:

primary_domain = 'php'

Configure the api_url for links to the API:

api_url = 'http://api.symfony.com/master/%s'