Skip to content

Commit 1c79755

Browse files
committed
[BestPractices] restructured text format for the installation instructions template
1 parent 2314cfe commit 1c79755

File tree

2 files changed

+84
-31
lines changed

2 files changed

+84
-31
lines changed

conf.py

+3
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
# adding PhpLexer
2424
from sphinx.highlighting import lexers
2525
from pygments.lexers.compiled import CLexer
26+
from pygments.lexers.special import TextLexer
2627
from pygments.lexers.web import PhpLexer
2728

2829
# -- General configuration -----------------------------------------------------
@@ -103,8 +104,10 @@
103104
lexers['php-symfony'] = PhpLexer(startinline=True)
104105
lexers['varnish3'] = CLexer()
105106
lexers['varnish4'] = CLexer()
107+
lexers['markdown'] = TextLexer()
106108

107109
config_block = {
110+
'markdown': 'Markdown',
108111
'varnish3': 'Varnish 3',
109112
'varnish4': 'Varnish 4'
110113
}

cookbook/bundles/best_practices.rst

+81-31
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+
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:: markdown
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)