8000 feature #5283 [BestPractices] restructured text format for the instal… · symfony/symfony-docs@a7cff0d · GitHub
[go: up one dir, main page]

Skip to content

Commit a7cff0d

Browse files
committed
feature #5283 [BestPractices] restructured text format for the installation instructions template (xabbuh)
This PR was merged into the 2.3 branch. Discussion ---------- [BestPractices] restructured text format for the installation instructions template | Q | A | ------------- | --- | Doc fix? | no | New docs? | no | Applies to | all | Fixed tickets | Commits ------- 8845da0 [BestPractices] restructured text format for the installation instructions template
2 parents 7c1507c + 8845da0 commit a7cff0d

File tree

2 files changed

+87
-31
lines changed

2 files changed

+87
-31
lines changed

conf.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
# adding PhpLexer
2424
from sphinx.highlighting import lexers
2525
from pygments.lexers.compiled import CLexer
26+
from pygments.lexers.special import TextLexer
27+
from pygments.lexers.text import RstLexer
2628
from pygments.lexers.web import PhpLexer
2729

2830
# -- General configuration -----------------------------------------------------
@@ -97,14 +99,18 @@
9799
# -- Settings for symfony doc extension ---------------------------------------------------
98100

99101
# enable highlighting for PHP code not between ``<?php ... ?>`` by default
102+
lexers['markdown'] = TextLexer()
100103
lexers['php'] = PhpLexer(startinline=True)
101104
lexers['php-annotations'] = PhpLexer(startinline=True)
102105
lexers['php-standalone'] = PhpLexer(startinline=True)
103106
lexers['php-symfony'] = PhpLexer(startinline=True)
107+
lexers['rst'] = RstLexer()
104108
lexers['varnish3'] = CLexer()
105109
lexers['varnish4'] = CLexer()
106110

107111
config_block = {
112+
'markdown': 'Markdown',
113+
'rst': 'reStructuredText',
108114
'varnish3': 'Varnish 3',
109115
'varnish4': 'Varnish 4'
110116
}

cookbook/bundles/best_practices.rst

Lines changed: 81 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -209,52 +209,102 @@ Installation Instructions
209209
In order to ease the installation of third-party bundles, consider using the
210210
following standardized instructions in your ``README.md`` file.
211211

212-
.. code-block:: text
212+
.. configuration-block::
213213

214-
Installation
215-
============
214+
.. code-block:: markdown
216215
217-
Step 1: Download the Bundle
218-
---------------------------
216+
Installation
217+
============
219218
220-
Open a command console, enter your project directory and execute the
221-
following command to download the latest stable version of this bundle:
219+
Step 1: Download the Bundle
220+
---------------------------
222221
223-
```bash
224-
$ composer require <package-name> "~1"
225-
```
222+
Open a command console, enter your project directory and execute the
223+
following command to download the latest stable version of this bundle:
226224
227-
This command requires you to have Composer installed globally, as explained
228-
in the [installation chapter](https://getcomposer.org/doc/00-intro.md)
229-
of the Composer documentation.
225+
```bash
226+
$ composer require <package-name> "~1"
227+
```
230228
231-
Step 2: Enable the Bundle
232-
-------------------------
229+
This command requires you to have Composer installed globally, as explained
230+
in the [installation chapter](https://getcomposer.org/doc/00-intro.md)
231+
of the Composer documentation.
233232
234-
Then, enable the bundle by adding the following line in the `app/AppKernel.php`
235-
file of your project:
233+
Step 2: Enable the Bundle
234+
-------------------------
236235
237-
```php
238-
<?php
239-
// app/AppKernel.php
236+ 8000
Then, enable the bundle by adding the following line in the `app/AppKernel.php`
237+
file of your project:
240238
241-
// ...
242-
class AppKernel extends Kernel
243-
{
244-
public function registerBundles()
239+
```php
240+
<?php
241+
// app/AppKernel.php
242+
243+
// ...
244+
class AppKernel extends Kernel
245245
{
246-
$bundles = array(
247-
// ...
246+
public function registerBundles()
247+
{
248+
$bundles = array(
249+
// ...
250+
251+
new <vendor>\<bundle-name>\<bundle-long-name>(),
252+
);
248253
249-
new <vendor>\<bundle-name>\<bundle-long-name>(),
250-
);
254+
// ...
255+
}
251256
252257
// ...
253258
}
259+
```
254260
255-
// ...
256-
}
257-
```
261+
.. code-block:: rst
262+
263+
Installation
264+
============
265+
266+
Step 1: Download the Bundle
267+
---------------------------
268+
269+
Open a command console, enter your project directory and execute the
270+
following command to download the latest stable version of this bundle:
271+
272+
.. code-block:: bash
273+
274+
$ composer require <package-name> "~1"
275+
276+
This command requires you to have Composer installed globally, as explained
277+
in the `installation chapter`_ of the Composer documentation.
278+
279+
Step 2: Enable the Bundle
280+
-------------------------
281+
282+
Then, enable the bundle by adding the following line in the ``app/AppKernel.php``
283+
file of your project:
284+
285+
.. code-block:: php
286+
287+
<?php
288+
// app/AppKernel.php
289+
290+
// ...
291+
class AppKernel extends Kernel
292+
{
293+
public function registerBundles()
294+
{
295+
$bundles = array(
296+
// ...
297+
298+
new <vendor>\<bundle-name>\<bundle-long-name>(),
299+
);
300+
301+
// ...
302+
}
303+
304+
// ...
305+
}
306+
307+
.. _`installation chapter`: https://getcomposer.org/doc/00-intro.md
258308
259309
This template assumes that your bundle is in its ``1.x`` version. If not, change
260310
the ``"~1"`` installation version accordingly (``"~2"``, ``"~3"``, etc.)

0 commit comments

Comments
 (0)
0