Skip to content

Commit 4913529

Browse files
committed
Use code-block:: bash
1 parent 6b46644 commit 4913529

33 files changed

+649
-233
lines changed

docs/configuration.rst

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ If not set then the systems default local time zone is used.
7676

7777
Celery requires the :mod:`pytz` library to be installed,
7878
when using custom time zones (other than UTC). You can
79-
install it using :program:`pip` or :program:`easy_install`::
79+
install it using :program:`pip` or :program:`easy_install`:
80+
81+
.. code-block:: bash
8082
8183
$ pip install pytz
8284
@@ -404,7 +406,9 @@ Configuring the backend URL
404406
The Redis backend requires the :mod:`redis` library:
405407
http://pypi.python.org/pypi/redis/
406408

407-
To install the redis package use `pip` or `easy_install`::
409+
To install the redis package use `pip` or `easy_install`:
410+
411+
.. code-block:: bash
408412
409413
$ pip install redis
410414
@@ -509,7 +513,9 @@ Cassandra backend settings
509513
The Cassandra backend requires the :mod:`pycassa` library:
510514
http://pypi.python.org/pypi/pycassa/
511515

512-
To install the pycassa package use `pip` or `easy_install`::
516+
To install the pycassa package use `pip` or `easy_install`:
517+
518+
.. code-block:: bash
513519
514520
$ pip install pycassa
515521
@@ -741,7 +747,9 @@ that's is used both by the client and the broker to detect if
741747
a connection was closed.
742748

743749
Heartbeats are currently only supported by the ``pyamqp://`` transport,
744-
and this requires the :mod:`amqp` module::
750+
and this requires the :mod:`amqp` module:
751+
752+
.. code-block:: bash
745753
746754
$ pip install amqp
747755

docs/contributing.rst

Lines changed: 73 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -296,19 +296,31 @@ First you need to fork the Celery repository, a good introduction to this
296296
is in the Github Guide: `Fork a Repo`_.
297297

298298
After you have cloned the repository you should checkout your copy
299-
to a directory on your machine::
299+
to a directory on your machine:
300+
301+
.. code-block:: bash
300302
301303
$ git clone git@github.com:username/celery.git
302304
303305
When the repository is cloned enter the directory to set up easy access
304-
to upstream changes::
306+
to upstream changes:
307+
308+
.. code-block:: bash
305309
306310
$ cd celery
311+
312+
.. code-block:: bash
313+
307314
$ git remote add upstream git://github.com/celery/celery.git
315+
316+
.. code-block:: bash
317+
308318
$ git fetch upstream
309319
310320
If you need to pull in new changes from upstream you should
311-
always use the :option:`--rebase` option to ``git pull``::
321+
always use the :option:`--rebase` option to ``git pull``:
322+
323+
.. code-block:: bash
312324
313325
git pull --rebase upstream master
314326
@@ -338,12 +350,16 @@ To run the Celery test suite you need to install a few dependencies.
338350
A complete list of the dependencies needed are located in
339351
:file:`requirements/test.txt`.
340352

341-
Installing the test requirements::
353+
Installing the test requirements:
354+
355+
.. code-block:: bash
342356
343357
$ pip -E $VIRTUAL_ENV install -U -r requirements/test.txt
344358
345359
When installation of dependencies is complete you can execute
346-
the test suite by calling ``nosetests``::
360+
the test suite by calling ``nosetests``:
361+
362+
.. code-block:: bash
347363
348364
$ nosetests
349365
@@ -366,7 +382,9 @@ Some useful options to :program:`nosetests` are:
366382
Run with verbose output.
367383

368384
If you want to run the tests for a single test file only
369-
you can do so like this::
385+
you can do so like this:
386+
387+
.. code-block:: bash
370388
371389
$ nosetests celery.tests.test_worker.test_worker_job
372390
@@ -392,14 +410,18 @@ the steps outlined here: http://bit.ly/koJoso
392410
Calculating test coverage
393411
~~~~~~~~~~~~~~~~~~~~~~~~~
394412

395-
Code coverage in HTML::
413+
Code coverage in HTML:
414+
415+
.. code-block:: bash
396416
397417
$ nosetests --with-coverage3 --cover3-html
398418
399419
The coverage output will then be located at
400420
:file:`celery/tests/cover/index.html`.
401421

402-
Code coverage in XML (Cobertura-style)::
422+
Code coverage in XML (Cobertura-style):
423+
424+
.. code-block:: bash
403425
404426
$ nosetests --with-coverage3 --cover3-xml --cover3-xml-file=coverage.xml
405427
@@ -413,25 +435,33 @@ Running the tests on all supported Python versions
413435
There is a ``tox`` configuration file in the top directory of the
414436
distribution.
415437

416-
To run the tests for all supported Python versions simply execute::
438+
To run the tests for all supported Python versions simply execute:
439+
440+
.. code-block:: bash
417441
418442
$ tox
419443
420444
If you only want to test specific Python versions use the :option:`-e`
421-
option::
445+
option:
446+
447+
.. code-block:: bash
422448
423449
$ tox -e py25,py26
424450
425451
Building the documentation
426452
--------------------------
427453

428454
To build the documentation you need to install the dependencies
429-
listed in :file:`requirements/docs.txt`::
455+
listed in :file:`requirements/docs.txt`:
456+
457+
.. code-block:: bash
430458
431459
$ pip -E $VIRTUAL_ENV install -U -r requirements/docs.txt
432460
433461
After these dependencies are installed you should be able to
434-
build the docs by running::
462+
build the docs by running:
463+
464+
.. code-block:: bash
435465
436466
$ cd docs
437467
$ rm -rf .build
@@ -448,28 +478,36 @@ Verifying your contribution
448478
To use these tools you need to install a few dependencies. These dependencies
449479
can be found in :file:`requirements/pkgutils.txt`.
450480

451-
Installing the dependencies::
481+
Installing the dependencies:
482+
483+
.. code-block:: bash
452484
453485
$ pip -E $VIRTUAL_ENV install -U -r requirements/pkgutils.txt
454486
455487
pyflakes & PEP8
456488
~~~~~~~~~~~~~~~
457489

458490
To ensure that your changes conform to PEP8 and to run pyflakes
459-
execute::
491+
execute:
492+
493+
.. code-block:: bash
460494
461495
$ paver flake8
462496
463497
To not return a negative exit code when this command fails use the
464-
:option:`-E` option, this can be convenient while developing::
498+
:option:`-E` option, this can be convenient while developing:
499+
500+
.. code-block:: bash
465501
466502
$ paver flake8 -E
467503
468504
API reference
469505
~~~~~~~~~~~~~
470506

471507
To make sure that all modules have a corresponding section in the API
472-
reference please execute::
508+
reference please execute:
509+
510+
.. code-block:: bash
473511
474512
$ paver autodoc
475513
$ paver verifyindex
@@ -481,19 +519,28 @@ located in :file:`docs/internals/reference/`. If the module is public
481519
it should be located in :file:`docs/reference/`.
482520

483521
For example if reference is missing for the module ``celery.worker.awesome``
484-
and this module is considered part of the public API, use the following steps::
522+
and this module is considered part of the public API, use the following steps:
523+
524+
.. code-block:: bash
485525
486526
$ cd docs/reference/
487527
$ cp celery.schedules.rst celery.worker.awesome.rst
528+
529+
.. code-block:: bash
530+
488531
$ vim celery.worker.awesome.rst
489532
490533
# change every occurance of ``celery.schedules`` to
491534
# ``celery.worker.awesome``
492535
536+
.. code-block:: bash
537+
493538
$ vim index.rst
494539
495540
# Add ``celery.worker.awesome`` to the index.
496541
542+
.. code-block:: bash
543+
497544
# Add the file to git
498545
$ git add celery.worker.awesome.rst
499546
$ git add index.rst
@@ -808,15 +855,21 @@ The version number must be updated two places:
808855
After you have changed these files you must render
809856
the :file:`README` files. There is a script to convert sphinx syntax
810857
to generic reStructured Text syntax, and the paver task `readme`
811-
does this for you::
858+
does this for you:
859+
860+
.. code-block:: bash
812861
813862
$ paver readme
814863
815-
Now commit the changes::
864+
Now commit the changes:
865+
866+
.. code-block:: bash
816867
817868
$ git commit -a -m "Bumps version to X.Y.Z"
818869
819-
and make a new version tag::
870+
and make a new version tag:
871+
872+
.. code-block:: bash
820873
821874
$ git tag vX.Y.Z
822875
$ git push --tags

docs/django/first-steps-with-django.rst

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,32 @@ Configuring your Django project to use Celery
77

88
You need four simple steps to use celery with your Django project.
99

10-
1. Install the ``django-celery`` library::
10+
1. Install the ``django-celery`` library:
1111

12-
$ pip install django-celery
12+
.. code-block:: bash
1313
14-
2. Add the following lines to ``settings.py``::
14+
$ pip install django-celery
1515
16-
import djcelery
17-
djcelery.setup_loader()
16+
2. Add the following lines to ``settings.py``:
17+
18+
.. code-block:: python
19+
20+
import djcelery
21+
djcelery.setup_loader()
1822
1923
3. Add ``djcelery`` to ``INSTALLED_APPS``.
2024

2125
4. Create the celery database tables.
2226

23-
If you are using south_ for schema migrations, you'll want to::
27+
If you are using south_ for schema migrations, you'll want to:
28+
29+
.. code-block:: bash
2430
2531
$ python manage.py migrate djcelery
2632
27-
For those who are not using south, a normal ``syncdb`` will work::
33+
For those who are not using south, a normal ``syncdb`` will work:
34+
35+
.. code-block:: bash
2836
2937
$ python manage.py syncdb
3038
@@ -63,7 +71,9 @@ to import these modules.
6371

6472
For a simple demonstration create a new Django app called
6573
``celerytest``. To create this app you need to be in the directory
66-
of your Django project where ``manage.py`` is located and execute::
74+
of your Django project where ``manage.py`` is located and execute:
75+
76+
.. code-block:: bash
6777
6878
$ python manage.py startapp celerytest
6979
@@ -88,12 +98,16 @@ Starting the worker process
8898
In a production environment you will want to run the worker in the background
8999
as a daemon - see :ref:`daemonizing` - but for testing and
90100
development it is useful to be able to start a worker instance by using the
91-
``celery worker`` manage command, much as you would use Django's runserver::
101+
``celery worker`` manage command, much as you would use Django's runserver:
102+
103+
.. code-block:: bash
92104
93105
$ python manage.py celery worker --loglevel=info
94106
95107
For a complete listing of the command line options available,
96-
use the help command::
108+
use the help command:
109+
110+
.. code-block:: bash
97111
98112
$ python manage.py celery help
99113

0 commit comments

Comments
 (0)