Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BestPractices] restructured text format for the installation instructions template #5283

Merged
merged 1 commit into from
May 25, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
# adding PhpLexer
from sphinx.highlighting import lexers
from pygments.lexers.compiled import CLexer
from pygments.lexers.special import TextLexer
from pygments.lexers.text import RstLexer
from pygments.lexers.web import PhpLexer

# -- General configuration -----------------------------------------------------
Expand Down Expand Up @@ -97,14 +99,18 @@
# -- Settings for symfony doc extension ---------------------------------------------------

# enable highlighting for PHP code not between ``<?php ... ?>`` by default
lexers['markdown'] = TextLexer()
lexers['php'] = PhpLexer(startinline=True)
lexers['php-annotations'] = PhpLexer(startinline=True)
lexers['php-standalone'] = PhpLexer(startinline=True)
lexers['php-symfony'] = PhpLexer(startinline=True)
lexers['rst'] = RstLexer()
lexers['varnish3'] = CLexer()
lexers['varnish4'] = CLexer()

config_block = {
'markdown': 'Markdown',
'rst': 'reStructuredText',
'varnish3': 'Varnish 3',
'varnish4': 'Varnish 4'
}
Expand Down
112 changes: 81 additions & 31 deletions cookbook/bundles/best_practices.rst
Original file line number Diff line number Diff line change
Expand Up @@ -209,52 +209,102 @@ Installation Instructions
In order to ease the installation of third-party bundles, consider using the
following standardized instructions in your ``README.md`` file.

.. code-block:: text
.. configuration-block::

Installation
============
.. code-block:: markdown

Step 1: Download the Bundle
---------------------------
Installation
============

Open a command console, enter your project directory and execute the
following command to download the latest stable version of this bundle:
Step 1: Download the Bundle
---------------------------

```bash
$ composer require <package-name> "~1"
```
Open a command console, enter your project directory and execute the
following command to download the latest stable version of this bundle:

This command requires you to have Composer installed globally, as explained
in the [installation chapter](https://getcomposer.org/doc/00-intro.md)
of the Composer documentation.
```bash
$ composer require <package-name> "~1"
```

Step 2: Enable the Bundle
-------------------------
This command requires you to have Composer installed globally, as explained
in the [installation chapter](https://getcomposer.org/doc/00-intro.md)
of the Composer documentation.

Then, enable the bundle by adding the following line in the `app/AppKernel.php`
file of your project:
Step 2: Enable the Bundle
-------------------------

```php
<?php
// app/AppKernel.php
Then, enable the bundle by adding the following line in the `app/AppKernel.php`
file of your project:

// ...
class AppKernel extends Kernel
{
public function registerBundles()
```php
<?php
// app/AppKernel.php

// ...
class AppKernel extends Kernel
{
$bundles = array(
// ...
public function registerBundles()
{
$bundles = array(
// ...

new <vendor>\<bundle-name>\<bundle-long-name>(),
);

new <vendor>\<bundle-name>\<bundle-long-name>(),
);
// ...
}

// ...
}
```

// ...
}
```
.. code-block:: rst

Installation
============

Step 1: Download the Bundle
---------------------------

Open a command console, enter your project directory and execute the
following command to download the latest stable version of this bundle:

.. code-block:: bash

$ composer require <package-name> "~1"

This command requires you to have Composer installed globally, as explained
in the `installation chapter`_ of the Composer documentation.

Step 2: Enable the Bundle
-------------------------

Then, enable the bundle by adding the following line in the ``app/AppKernel.php``
file of your project:

.. code-block:: php

<?php
// app/AppKernel.php

// ...
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
// ...

new <vendor>\<bundle-name>\<bundle-long-name>(),
);

// ...
}

// ...
}

.. _`installation chapter`: https://getcomposer.org/doc/00-intro.md

This template assumes that your bundle is in its ``1.x`` version. If not, change
the ``"~1"`` installation version accordingly (``"~2"``, ``"~3"``, etc.)
Expand Down