summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2010-11-27 23:42:04 -0500
committerChris McDonough <chrism@plope.com>2010-11-27 23:42:04 -0500
commit77d15aef3237b05b18af5630a31bfe50a8c443af (patch)
tree2427cb5cd2064963b46d23d9228c02e72e58da48 /docs
parente6261fa3a07c38cb8cd2877aa51f5c3ae8521782 (diff)
parent8069e93ea3d1d8a837ad427023f9f245fa3204e3 (diff)
downloadpyramid-77d15aef3237b05b18af5630a31bfe50a8c443af.tar.gz
pyramid-77d15aef3237b05b18af5630a31bfe50a8c443af.tar.bz2
pyramid-77d15aef3237b05b18af5630a31bfe50a8c443af.zip
Merge branch 'blaflamme-master'
Diffstat (limited to 'docs')
-rw-r--r--docs/conf.py3
-rw-r--r--docs/narr/project.rst21
2 files changed, 18 insertions, 6 deletions
diff --git a/docs/conf.py b/docs/conf.py
index 653f7ab15..3de2f7ac4 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -110,6 +110,9 @@ add_module_names = False
# The name of the Pygments (syntax highlighting) style to use.
#pygments_style = book and 'bw' or 'tango'
+# The default language to highlight source code in.
+highlight_language = 'guess'
+
# Options for HTML output
# -----------------------
diff --git a/docs/narr/project.rst b/docs/narr/project.rst
index 8901c1a4e..97db534cb 100644
--- a/docs/narr/project.rst
+++ b/docs/narr/project.rst
@@ -257,7 +257,7 @@ points to *your application* as opposed to any other section within the
``.ini`` file. For example, if your application ``.ini`` file might have a
``[app:MyProject]`` section that looks like so:
-.. code-block:: ini
+.. code-block:: guess
:linenos:
[app:MyProject]
@@ -271,7 +271,7 @@ points to *your application* as opposed to any other section within the
If so, you can use the following command to invoke a debug shell using
the name ``MyProject`` as a section name:
-.. code-block:: text
+.. code-block:: text
[chrism@vitaminf shellenv]$ ../bin/paster pshell development.ini MyProject
Python 2.4.5 (#1, Aug 29 2008, 12:27:37)
@@ -288,7 +288,7 @@ happen, even if you have IPython installed, you can pass the
``--disable-ipython`` flag to the ``pshell`` command to use a standard
Python interpreter shell unconditionally.
-.. code-block:: text
+.. code-block:: text
[chrism@vitaminf shellenv]$ ../bin/paster pshell --disable-ipython \
development.ini MyProject
@@ -303,7 +303,7 @@ Python interpreter shell unconditionally.
than an ``app``. For example, if you have the following ``.ini`` file
content:
- .. code-block:: ini
+ .. code-block:: guess
:linenos:
[app:MyProject]
@@ -432,7 +432,9 @@ name except for case). All :app:`Pyramid` ``paster`` -generated projects
share a similar structure.
The ``MyProject`` project we've generated has the following directory
-structure::
+structure:
+
+.. code-block:: text
MyProject/
|-- CHANGES.txt
@@ -493,6 +495,7 @@ serve``, as well as the deployment settings provided to that application.
The generated ``development.ini`` file looks like so:
.. literalinclude:: MyProject/development.ini
+ :language: guess
:linenos:
This file contains several "sections" including ``[app:MyProject]``,
@@ -618,6 +621,7 @@ distributing your application.
Our generated ``setup.py`` looks like this:
.. literalinclude:: MyProject/setup.py
+ :language: python
:linenos:
The ``setup.py`` file calls the setuptools ``setup`` function, which
@@ -655,7 +659,7 @@ file when distributing your application to other people, or when
versioning your application for your own use. For fun, you can try
this command now:
-.. code-block:: python
+.. code-block:: text
$ python setup.py sdist
@@ -686,6 +690,7 @@ contains various settings related to testing and internationalization:
Our generated ``setup.cfg`` looks like this:
.. literalinclude:: MyProject/setup.cfg
+ :language: guess
:linenos:
The values in the default setup file allow various commonly-used
@@ -733,6 +738,7 @@ This is the file named ``__init__.py``. The presence of an ``__init__.py``
also informs Python that the directory which contains it is a *package*.
.. literalinclude:: MyProject/myproject/__init__.py
+ :language: python
:linenos:
#. Line 1 imports the :term:`Configurator` class from
@@ -779,6 +785,7 @@ code which accepts a :term:`request` and which returns a
:term:`response`.
.. literalinclude:: MyProject/myproject/views.py
+ :language: python
:linenos:
This bit of code was registered as the view callable within ``__init__.py``
@@ -825,6 +832,7 @@ and provide APIs which mutate and return this data. We write a class
named ``MyModel`` that provides the behavior.
.. literalinclude:: MyProject/myproject/models.py
+ :language: python
:linenos:
#. Lines 1-2 define the MyModel class.
@@ -871,6 +879,7 @@ by view functions themselves. See :ref:`templates_used_directly` and
The ``tests.py`` module includes unit tests for your application.
.. literalinclude:: MyProject/myproject/tests.py
+ :language: python
:linenos:
This sample ``tests.py`` file has a single unit test defined within