Skip to content

Commit

Permalink
use tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
goetas committed Nov 15, 2021
1 parent e666647 commit f0170aa
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@ version: 2

sphinx:
configuration: Resources/doc/conf.py

python:
install:
- requirements: Resources/doc/requirements.txt
9 changes: 6 additions & 3 deletions Resources/doc/annotations-reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,11 @@ All of them have the same options as ``@Route``.

Example:

.. configuration-block::
.. tabs::

.. code-block:: php-annotations
.. tab:: Annotations

.. code-block:: php
// src/Controller/BlogController.php
namespace App\Controller;
Expand All @@ -114,8 +116,9 @@ Example:
// ...
}
}
.. tab:: Attributes

.. code-block:: php-attributes
.. code-block:: php
// src/Controller/BlogController.php
namespace App\Controller;
Expand Down
9 changes: 9 additions & 0 deletions Resources/doc/conf.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
# -*- coding: utf-8 -*-

import sys, os
from sphinx.highlighting import lexers
from pygments.lexers.web import PhpLexer

project = 'FriendsOfSymfony / FOSRestBundle'
author = 'FriendsOfSymfony community'

extensions = [
'sphinx_tabs.tabs'
]

# This will be used when using the shorthand notation
highlight_language = 'php'

# enable highlighting for PHP code not between <?php ... ?> by default
lexers['php'] = PhpLexer(startinline=True)
2 changes: 2 additions & 0 deletions Resources/doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
sphinx_rtd_theme
sphinx-tabs

0 comments on commit f0170aa

Please sign in to comment.