@@ -7,25 +7,26 @@ The Symfony2 documentation uses `reStructuredText`_ as its markup language and
7
7
reStructuredText
8
8
----------------
9
9
10
- reStructuredText "is an easy-to-read, what-you-see-is-what-you-get plaintext
11
- markup syntax and parser system".
10
+ reStructuredText * "is an easy-to-read, what-you-see-is-what-you-get plaintext
11
+ markup syntax and parser system" * .
12
12
13
13
You can learn more about its syntax by reading existing Symfony2 `documents `_
14
14
or by reading the `reStructuredText Primer `_ on the Sphinx website.
15
15
16
- If you are familiar with Markdown, be careful as things are sometimes very
17
- similar but different:
16
+ .. caution ::
18
17
19
- * Lists starts at the beginning of a line (no indentation is allowed);
18
+ If you are familiar with Markdown, be careful as things are sometimes very
19
+ similar but different:
20
20
21
- * Inline code blocks use double-ticks (````like this`` ``).
21
+ * Lists starts at the beginning of a line (no indentation is allowed);
22
+ * Inline code blocks use double-ticks (````like this`` ``).
22
23
23
24
Sphinx
24
25
------
25
26
26
27
Sphinx is a build system that adds some nice tools to create documentation
27
28
from reStructuredText documents. As such, it adds new directives and
28
- interpreted text roles to standard reST `markup `_.
29
+ interpreted text roles to the standard reST `markup `_.
29
30
30
31
Syntax Highlighting
31
32
~~~~~~~~~~~~~~~~~~~
@@ -71,7 +72,7 @@ directive to show the configuration in all supported configuration formats
71
72
72
73
.. code-block:: xml
73
74
74
- <!-- Configuration in XML // -->
75
+ <!-- Configuration in XML -->
75
76
76
77
.. code-block:: php
77
78
@@ -87,35 +88,29 @@ The previous reST snippet renders as follow:
87
88
88
89
.. code-block :: xml
89
90
90
- <!-- Configuration in XML // -->
91
+ <!-- Configuration in XML -->
91
92
92
93
.. code-block :: php
93
94
94
95
// Configuration in PHP
95
96
96
97
The current list of supported formats are the following:
97
98
98
- +-----------------+-------------+
99
- | Markup format | Displayed |
100
- +=================+=============+
101
- | html | HTML |
102
- +-----------------+-------------+
103
- | xml | XML |
104
- +-----------------+-------------+
105
- | php | PHP |
106
- +-----------------+-------------+
107
- | yaml | YAML |
108
- +-----------------+-------------+
109
- | jinja | Twig |
110
- +-----------------+-------------+
111
- | html+jinja | Twig |
112
- +-----------------+-------------+
113
- | html+php | PHP |
114
- +-----------------+-------------+
115
- | ini | INI |
116
- +-----------------+-------------+
117
- | php-annotations | Annotations |
118
- +-----------------+-------------+
99
+ =============== ==============
100
+ Markup format Displayed
101
+ =============== ==============
102
+ html HTML
103
+ xml XML
104
+ php PHP
105
+ yaml YAML
106
+ jinja Twig
107
+ html+jinja Twig
108
+ html+php PHP
109
+ ini INI
110
+ php-annotations Annotations
111
+ php-standalone Standalone Use
112
+ php-symfony Framework Use
113
+ =============== ==============
119
114
120
115
Adding Links
121
116
~~~~~~~~~~~~
@@ -169,53 +164,14 @@ Testing Documentation
169
164
To test documentation before a commit:
170
165
171
166
* Install `Sphinx `_;
172
-
173
- * Run the `Sphinx quick setup `_;
174
-
175
- * Install the Sphinx extensions (see below);
176
-
167
+ * Install the Sphinx extensions using git submodules: ``git submodule update --init ``;
168
+ * (Optionally) Install the bundle docs and CMF docs: ``bash install.sh ``;
177
169
* Run ``make html `` and view the generated HTML in the ``build `` directory.
178
170
179
- Installing the Sphinx extensions
180
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
181
-
182
- * Download the extension from the `source `_ repository
183
-
184
- * Copy the ``sensio `` directory to the ``_exts `` folder under your source
185
- folder (where ``conf.py `` is located)
186
-
187
- * Add the following to the ``conf.py `` file:
188
-
189
- .. code-block :: py
190
-
191
- # ...
192
- sys.path.append(os.path.abspath(' _exts' ))
193
-
194
- # adding PhpLexer
195
- from sphinx.highlighting import lexers
196
- from pygments.lexers.web import PhpLexer
197
-
198
- # ...
199
- # add the extensions to the list of extensions
200
- extensions = [... , ' sensio.sphinx.refinclude' , ' sensio.sphinx.configurationblock' , ' sensio.sphinx.phpcode' ]
201
-
202
- # enable highlighting for PHP code not between ``<?php ... ?>`` by default
203
- lexers[' php' ] = PhpLexer(startinline = True )
204
- lexers[' php-annotations' ] = PhpLexer(startinline = True )
205
- lexers[' php-standalone' ] = PhpLexer(startinline = True )
206
- lexers[' php-symfony' ] = PhpLexer(startinline = True )
207
-
208
- # use PHP as the primary domain
209
- primary_domain = ' php'
210
-
211
- # set URL for API links
212
- api_url = ' http://api.symfony.com/master/%s '
213
-
214
171
.. _reStructuredText : http://docutils.sourceforge.net/rst.html
215
172
.. _Sphinx : http://sphinx-doc.org/
216
173
.. _documents : https://github.com./symfony/symfony-docs
217
174
.. _reStructuredText Primer : http://sphinx-doc.org/rest.html
218
175
.. _markup : http://sphinx-doc.org/markup/
219
176
.. _Pygments website : http://pygments.org/languages/
220
- .. _source : https://github.com./fabpot/sphinx-php
221
177
.. _Sphinx quick setup : http://sphinx-doc.org/tutorial.html#setting-up-the-documentation-sources
0 commit comments