Skip to content

Commit c4677e1

Browse files
committed
Merge pull request symfony#1663 from richardmiller/adding_info_on_links_in_docs
Adding some information on adding links within the documentation
2 parents d8685bb + 5c7a13c commit c4677e1

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

contributing/documentation/format.rst

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,50 @@ The current list of supported formats are the following:
119119
| php-annotations | Annotations |
120120
+-----------------+-------------+
121121

122+
Adding Links
123+
~~~~~~~~~~~~
124+
125+
To add links to other pages in the documents use the following syntax:
126+
127+
.. code-block:: rst
128+
129+
:doc:`/path/to/page`
130+
131+
Using the path and filename of the page without the extension, for example:
132+
133+
.. code-block:: rst
134+
135+
:doc:`/book/controller`
136+
137+
:doc:`/components/event_dispatcher/introduction`
138+
139+
:doc:`/cookbook/configuration/environments`
140+
141+
The link text will be the main heading of the document linked to. You can
142+
also specify alternative text for the link:
143+
144+
.. code-block:: rst
145+
146+
:doc:`Spooling Email</cookbook/email/spool>`
147+
148+
You can also add links to the API documentation:
149+
150+
.. code-block:: rst
151+
152+
:class:`Symfony\\Component\\Routing\\Matcher\\ApacheUrlMatcher`
153+
154+
:method:`Symfony\\Component\\HttpKernel\\Bundle\\Bundle::build`
155+
156+
and to the PHP documentation:
157+
158+
.. code-block:: rst
159+
160+
:phpclass:`SimpleXMLElement`
161+
162+
:phpmethod:`DateTime::createFromFormat`
163+
164+
:phpfunction:`iterator_to_array`
165+
122166
Testing Documentation
123167
~~~~~~~~~~~~~~~~~~~~~
124168

0 commit comments

Comments
 (0)