Changeset 4863

Show
Ignore:
Timestamp:
07/01/08 09:16:41 (5 months ago)
Author:
brunojm
Message:

updated docs fixing typos and highlight some parts

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/docs/main/BasicMoves.rst

    r4575 r4863  
     1TurboGears 2 at a glance 
     2======================== 
    13 
    2  
    3  
    4  
    5 TurboGears 2 at a glance 
    6 =========================== 
    7  
    8 :Status: Work in progres 
     4:Status: Work in progress 
    95 
    106TurboGears 2, like TurboGears 1 and many other modern web frameworks, uses a pattern called "Model View Controller", or "MVC" pattern.  Basically the MVC pattern is an attempt to separate the code which handles what the user sees (the view) from the code that responds to user actions (the controller) and code that changes the state of data (the model).  
     
    128The goal of the MVC pattern is to help you create more flexible software, and since web-applications tend to have more user-interface changes than anything else, it's particularly designed so that you can change the `view` code without necessarily having to change anything else.  
    139 
    14 You have to follow the tutorial `quickstart a project <QuickStart>`_ and serve the project first. 
     10You have to follow the tutorial `Quickstart a TurboGears 2 Project <QuickStart.html>`_ and serve the project first. 
    1511Then we could exam some basic moves the you could do with TurboGears 2. 
    1612 
    1713 
    1814Hello World using template 
    19 ------------------------------- 
     15-------------------------- 
    2016 
    2117Let's take advantage of that fact and make update our view with a Hello World headline.  
     
    2319To keep the tutorial small and simple, we make a assumption that you already have some knowledge about html tags. 
    2420 
    25 Edit helloworld/templates/index.html, add a <h1> tag like this:: 
     21Edit helloworld/templates/index.html, add a <h1> tag like this: 
     22 
     23.. code-block:: html 
    2624 
    2725  ... 
     
    3937-------------------------------- 
    4038 
    41 Open a new file, edit the content as a simple html file:: 
     39Open a new file, edit the content as a simple html file: 
     40 
     41.. code-block:: html 
    4242 
    4343    <html> 
     
    6161In this case we will add a new method called hello, which just returns a string.   TG2 allows us to bypass the template process and return a string directly to the http response, which will be returned to the browser directly.   
    6262 
    63 Edit controller/root.py:: 
     63Edit controller/root.py: 
     64 
     65.. code-block:: python 
    6466 
    6567  from my-project-name.lib.base import BaseController 
     
    8284So far we're getting somewhere, we've been returning plaintext for every incoming request. But you might have noticed how the default welcome page work.  
    8385 
    84 We can edit index template, use controllers to define new url's. But let's take it one step further and create yet another new URL, plug plug real templates into the controllers, and this time rather than returning a string, we'll return a dictionary:: 
     86We can edit index template, use controllers to define new url's. But let's take it one step further and create yet another new URL, plug plug real templates into the controllers, and this time rather than returning a string, we'll return a dictionary: 
     87 
     88.. code-block:: python 
    8589 
    8690  from helloworld.lib.base import BaseController 
     
    101105 
    102106That means that we've now got a 'hello' variable in our template which we can use, and we attach the template 'helloworld.templates.index' to 'new_hello' method. So let's edit helloworld/template/index.html to replace the h1 tag we  
    103 added earlier with:: 
     107added earlier with: 
     108 
     109.. code-block:: html 
    104110 
    105111  <h1 py:replace="hello">hello</h1> 
     
    113119 
    114120 
    115 Not every template has dynamic content and therefore may not need arguments. In that case, just return an empty dictionary:: 
     121Not every template has dynamic content and therefore may not need arguments. In that case, just return an empty dictionary: 
     122 
     123.. code-block:: python 
    116124 
    117125  @expose(template="helloworld.templates.index") 
  • trunk/docs/main/CommandLine.rst

    r4370 r4863  
    1  
    2  
    31 
    42Use TurboGears Command Line Tools 
  • trunk/docs/main/Contributing.rst

    r4699 r4863  
    1 ##This is an official page. Only editors and admins can change it. 
    2  
    3  
    4  
    51Contributing to TurboGears 
    62========================== 
  • trunk/docs/main/Deployment.rst

    r4575 r4863  
    1  
    2 ## Please see the page "DocHelp" for guidelines on contributing TurboGears documentation! 
    3  
    4  
    5  
    61Deployment options 
    72==================== 
  • trunk/docs/main/DevStatus.rst

    r4370 r4863  
    1 ## Please see the page "DocHelp" for guidelines on contributing TurboGears documentation! 
    2  
    3  
    4  
    51TurboGears 2 Project Status 
    62=========================== 
  • trunk/docs/main/DownloadInstall.rst

    r4854 r4863  
     1.. highlight:: bash 
     2 
    13How to install TurboGears 2 
    2 ============================= 
    3  
    4 Installing Turbogears2 has been made simple with the advent of the package index.  We recommend installing Turbogears2 into a virtual environment 
     4=========================== 
     5 
     6Installing TurboGears 2 has been made simple with the advent of the package index.  We recommend installing TurboGears 2 into a virtual environment 
    57so that any existing packages will not interfere.  The basic installation goes as follows: 
    68 
    7 1. Install setuptools 
    8  
    9 2. Install virtualenv 
    10  
    11 3. Create a virtualenv for your project 
    12  
    13 4. switch to the virtualenv 
    14  
    15 5. easy_install turbogears development package 
    16  
    17 6. profit. 
     91. Install ``setuptools`` 
     10 
     112. Install ``virtualenv`` 
     12 
     133. Create a ``virtualenv`` for your project 
     14 
     154. Switch to the ``virtualenv`` 
     16 
     175. ``easy_install`` TurboGears development package 
     18 
     196. Profit 
    1820 
    1921 
    2022Prerequisites: 
    21 ----------------------- 
    22 * python 2.4 or 2.5 
    23 * appropriate python development package (python*-devel python*-dev) 
     23-------------- 
     24 
     25* Python 2.4 or 2.5 
     26* Appropriate python development package (python*-devel python*-dev) 
    2427 
    2528Setting up setuptools: 
    26 ----------------------- 
    27  
    28  $ curl http://peak.telecommunity.com/dist/ez_setup.py | sudo python 
    29  
     29---------------------- 
     30 
     31.. code-block:: bash 
     32 
     33        $ curl http://peak.telecommunity.com/dist/ez_setup.py | sudo python 
    3034 
    3135Setting up a Virtual Environment: 
    32 ----------------------------------- 
    33  
    34  $ sudo easy_install virtualenv 
    35  
    36   produces: 
    37   :: 
     36--------------------------------- 
     37 
     38First, install ``virtualenv`` using this command: 
     39 
     40.. code-block:: bash 
     41         
     42        $ sudo easy_install virtualenv 
     43 
     44will output something like: 
     45 
     46.. code-block:: text 
    3847 
    3948    Searching for virtualenv 
     
    4251    Downloading http://pypi.python.org/packages/2.5/v/virtualenv/virtualenv-1.1-py2.5.egg#md5=1db8cdd823739c79330a138327239551 
    4352    Processing virtualenv-1.1-py2.5.egg 
    44     creating /Users/percious/oss/tgdev/lib/python2.5/site-packages/virtualenv-1.1-py2.5.egg 
    45     Extracting virtualenv-1.1-py2.5.egg to /Users/percious/oss/tgdev/lib/python2.5/site-packages 
    46     Adding virtualenv 1.1 to easy-install.pth file 
    47     Installing virtualenv script to /Users/percious/oss/tgdev/bin 
    48  
    49     Installed /Users/percious/oss/tgdev/lib/python2.5/site-packages/virtualenv-1.1-py2.5.egg 
     53    ..... 
    5054    Processing dependencies for virtualenv 
    5155    Finished processing dependencies for virtualenv 
    5256 
    53  $ virtualenv tg2env --no-site-packages 
    54   produces: 
    55   :: 
     57Create a virtual environment: 
     58 
     59.. code-block:: bash 
     60         
     61        $ virtualenv --no-site-packages tg2env 
     62 
     63that produces:: 
    5664 
    5765     Using real prefix '/usr/local' 
    58      New python executable in tgdev/bin/python 
     66     New python executable in tg2env/bin/python 
    5967     Installing setuptools............done. 
    6068 
    61  $ cd tg2env 
    62  
    63  $ source bin/activate 
    64   and now your prompt should look something like: 
    65   :: 
    66  
    67     (tg2dev)usrname@host:tgdev $ 
    68  
    69 Install Turbogears2: 
     69.. code-block:: bash 
     70 
     71        $ cd tg2env 
     72 
     73.. code-block:: bash 
     74         
     75        $ source bin/activate 
     76 
     77and now your prompt should look something like:: 
     78 
     79        (tg2env)usrname@host:tgenv$ 
     80 
     81Install Turbogears 2 
    7082--------------------- 
    71  $ easy_install -i http://www.turbogears.org/2.0/downloads/1.9.7a1/index tg.devtools 
    72  
    73   a whole bunch of packages should download.  (this will take a little while) 
     83 
     84.. code-block:: bash 
     85 
     86        $ easy_install -i http://www.turbogears.org/2.0/downloads/1.9.7a1/index tg.devtools 
     87 
     88A whole bunch of packages should download.  (this will take a little while) 
    7489 
    7590Validate the installation: 
    76 ---------------------------- 
     91-------------------------- 
    7792 
    7893To check if you installed TurboGears 2 correctly, type 
    7994 
    80  $ paster --help 
    81  
    82   should look something like: 
    83   :: 
     95.. code-block:: bash 
     96         
     97        $ paster --help 
     98 
     99should look something like:: 
    84100 
    85101    Usage: paster [paster_options] COMMAND [command_options] 
     
    118134 
    119135 
    120 Installing the development version of Turbogears2 (from source) 
     136Installing the development version of Turbogears 2 (from source) 
    121137================================================================ 
    122  
    123138 
    124139Installing Pylons from Source: 
     
    146161 
    147162Installing TurboGears 2 from Source: 
    148 ------------------------------------------------ 
     163------------------------------------ 
    149164 
    150165TurboGears 2 are constructed by a bunch of packages. 
     
    199214When installing on Mac OSX, if you get an error mentioning "No local packages or download links found for RuleDispatch", you can try the solution posted to the `ToscaWidgets discussion list <http://groups.google.com/group/toscawidgets-discuss/browse_thread/thread/cb6778810e96585d>`_, which advises downloading it directly:: 
    200215 
    201  . $ sudo easy_install -U -f http://toscawidgets.org/download/wo_speedups/ RuleDispatch 
     216 $ sudo easy_install -U -f http://toscawidgets.org/download/wo_speedups/ RuleDispatch 
    202217 
    203218If you get the following error when starting a project with ``paster serve``:: 
    204219 
    205  . AttributeError: 'WSGIRequest' object has no attribute 'accept_language' 
     220 AttributeError: 'WSGIRequest' object has no attribute 'accept_language' 
    206221 
    207222update your Pylons checkout with ``hg update`` and try again. 
     
    209224If ``python setup.py develop`` gives you:: 
    210225 
    211  . Traceback (most recent call last): 
    212   . File "setup.py", line 3, in <module> 
    213    . from ez_setup import use_setuptools 
     226 Traceback (most recent call last): 
     227  File "setup.py", line 3, in <module> 
     228    from ez_setup import use_setuptools 
    214229 
    215230 
  • trunk/docs/main/LogSetup.rst

    r4370 r4863  
    1  
    2  
    31Configuring and using the Logging System 
    42========================================= 
  • trunk/docs/main/OfflineInstall.rst

    r4370 r4863  
    1 ## Please see the page "DocHelp" for guidelines on contributing TurboGears documentation! 
    2  
    3  
    41:status: Unofficial 
    52 
  • trunk/docs/main/Profile.rst

    r4575 r4863  
    1 ## Please see the page "DocHelp" for guidelines on contributing TurboGears documentation! 
    2  
    3  
    41 
    52Profiling your app 
  • trunk/docs/main/QuickStart.rst

    r4626 r4863  
    1  
    2  
     1.. highlight:: bash 
    32 
    43Quickstarting a TurboGears 2 project 
    54==================================== 
    65 
    7 :Status: Work in progres 
     6:Status: Work in progress 
    87 
    98.. contents:: Table of Contents 
    109    :depth: 2 
    11  
    1210 
    1311Now that you've got TurboGears installed. TurboGears 2 extends the 'paster' command line tool to provide a suite of tools for working with TurboGears 2 projects. A few will be touched upon in this tutorial, check the 'paster --help' command for a full listing. 
  • trunk/docs/main/SimpleWidgetForm.rst

    r4633 r4863  
    1 ## This is a contributed page. You must be logged in to change it. 
    2 #acl EditorGroup:read,write Known:read,write All:read 
    3  
    4  
    5  
    61Simple Widget Form Tutorial 
    72=========================== 
  • trunk/docs/main/TGandPyAMF.rst

    r4370 r4863  
    44============================== 
    55 
    6 :Status: Work in progres 
     6:Status: Work in progress 
    77 
    88.. contents:: Table of Contents