add extensions for php rendering

This commit is contained in:
Julien Fastré 2015-03-27 19:42:16 +01:00
parent 489d1a5819
commit 951b65b511
3 changed files with 34 additions and 1 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "_exts/sphinx-php"]
path = _exts/sphinx-php
url = https://github.com/fabpot/sphinx-php.git

1
_exts/sphinx-php Submodule

@ -0,0 +1 @@
Subproject commit 52f7bd2216cc22ef52494f346c5643bb2a74513f

View File

@ -21,6 +21,14 @@ import os
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
sys.path.append(os.path.abspath('./../_exts/sphinx-php'))
# adding PhpLexer
from sphinx.highlighting import lexers
from pygments.lexers.compiled import CLexer
from pygments.lexers.web import PhpLexer
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
@ -31,7 +39,11 @@ import os
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.todo',
'sphinx.ext.todo',
'sensio.sphinx.refinclude',
'sensio.sphinx.configurationblock',
'sensio.sphinx.phpcode',
'sensio.sphinx.bestpractice',
]
# Add any paths that contain templates here, relative to this directory.
@ -97,6 +109,23 @@ pygments_style = 'sphinx'
# If true, keep warnings as "system message" paragraphs in the built documents.
#keep_warnings = False
# -- Settings for symfony doc extension ---------------------------------------------------
# enable highlighting for PHP code not between ``<?php ... ?>`` by default
lexers['php'] = PhpLexer(startinline=True)
lexers['php-annotations'] = PhpLexer(startinline=True)
lexers['php-standalone'] = PhpLexer(startinline=True)
lexers['php-symfony'] = PhpLexer(startinline=True)
lexers['varnish3'] = CLexer()
lexers['varnish4'] = CLexer()
config_block = {
'varnish3': 'Varnish 3',
'varnish4': 'Varnish 4'
}
# use PHP as the primary domain
primary_domain = 'php'
# set url for API links
api_url = 'http://api.symfony.com/master/%s'
# -- Options for HTML output ----------------------------------------------