Anonymous avatar Anonymous committed 03f32b8

examguid_00: readability

Comments (0)

Files changed (4)

 Examples
 ========
 
-Before we proceed let setup `virtualenv`_ environment::
+Before we proceed let's setup a `virtualenv`_ environment::
 
     $ virtualenv env
     $ env/bin/easy_install wheezy.template
 Real World
 ----------
 
-There is real world example available in `wheezy.web`_ package. It can be found
-in `demo.template`_ application. The application has few screens: home, sign
+There is real world example available in the `wheezy.web`_ package. It can be found
+in the `demo.template`_ application. The application has a few screens: home, sign
 up, sign in, etc. The content implementation is available for jinja2, mako,
-tenjin, wheezy.template and wheezy.template (with preprocessor).
+tenjin, wheezy.template and for wheezy.template with preprocessor.
 
 The throughtput was captured using apache benchmark (concurrecy level 500,
 number of request 100K)::

doc/gettingstarted.rst

 -------
 
 :ref:`wheezy.template` requires `python`_ version 2.4 to 2.7 or 3.2+.
-It is independent of operating system. You can install it from `pypi`_
+It is operating system independent. You can install it from the `pypi`_
 site using `setuptools`_::
 
     $ easy_install wheezy.template
     $ hg clone http://bitbucket.org/akorn/wheezy.template
     $ cd wheezy.template
 
-Prepare `virtualenv`_ environment in *env* directory ::
+Prepare `virtualenv`_ environment in the *env* directory ::
 
     $ make env
 
 
     $ make test
 
-You can read how to compile from source code different versions of
-`python`_ in the `article`_ published on `mind reference`_ blog.
+You can read how to compile different versions of
+`python`_ from source code, in the `article`_ published on `mind reference`_ blog.
 
-You can run certain make targets with specific python version. Here
+You can run certain make targets with a specific python version. Here
 we are going to run `doctest`_ with python3.2::
 
     $ make env doctest-cover VERSION=3.2
 ------------
 
 :ref:`wheezy.template` is a `python`_ package written in pure Python code.
-It is a lightweight template library. The design goals achived:
+It is a lightweight template library. The design goals achieved with
+its development:
 
 * **Compact, Expressive, Clean:** Minimizes the number of keystrokes required
   to build a template. Enables fast and well read coding. You do not need to
   a compact and expressive syntax which is really clean and just pleasure
   to type.
 * **Intuitive, No time to Learn:** Basic Python programming skills
-  plus HTML markup. You are productive just from start. Use full power
+  plus HTML markup. You are productive right from the start. Use the full power
   of Python with minimal markup required to denote python statements.
 * **Do Not Repeat Yourself:** Master layout templates for inheritance;
   include and import directives for maximum reuse.

doc/userguide.rst

 
 :ref:`wheezy.template` uses :py:class:`~wheezy.template.engine.Engine` to store
 configuration information and load templates. Here is a typical example that
-loads templates from file system::
+loads templates from the file system::
 
     from wheezy.template.engine import Engine
     from wheezy.template.ext.core import CoreExtension
 -------
 
 Loader is used to provide template content to :py:class:`~wheezy.template.engine.Engine`
-by some name requested by application. So what is name and how each loader
-interprets it is up to loader implementation.
+by some name requested by an application. What exactly consitutes a name and how each loader
+interprets it, is up to the loader implementation.
 
 :ref:`wheezy.template` comes with the following loaders:
 
   dictionary (``templates`` - a dict where key corresponds to template name
   and value to template content).
 * :py:class:`~wheezy.template.loader.ChainLoader` - loads templates from
-  ``loaders`` until first succeed.
+  ``loaders`` in turn until one succeeds.
 
 Core Extension
 --------------
 Context
 ~~~~~~~
 
-In order to use variables passed to template you use ``require`` statement and
-list names you need to pick from context. These names becomes visible to the
+In order to use variables passed to a template you use ``require`` statement and
+list names you need to pick from the context. These names becomes
+visible from the ``require`` statement to the
 end of the template scope (imagine a single template is a python function).
 
 Context access syntax::
 Variables
 ~~~~~~~~~
 
-The application pass variables to template render via context. Variable access
+The application passes variables to the template renderer via context. Variable access
 syntax::
 
     @variable_name
 
     print(template.render({'name': 'John'}))
 
-Variable syntax is not limitted to a single name access. You are able to use
-full power of python to access items in dict, attributes, function calls, etc.
+Variable syntax is not limited to a single name access. You are able to use
+full power of python to access items in a dict, attributes, function calls, etc.
 
 Filters
 ~~~~~~~
 
 Variables can be formatted by filters. Filters are separated from the variable
-by ``!`` symbol. Filter syntax::
+by the ``!`` symbol. Filter syntax::
 
     @variable_name!filter1!filter2
 
-The filters are applied from left to right so above syntax is equvivalent to
+The filters are applied from left to right, so the above syntax is equvivalent to
 the following call::
 
     @filter1(filter2(variable_name))
 
     @user.age!s
 
-Assuming the age property of user is integer we apply string filter.
+Assuming the age property of user is integer we apply a string filter.
 
-You are able to use custom filters, here is an example how to use html escape
+You are able to use custom filters, here is an example on how to use html escape
 filter::
 
     try:
     # ... initialize Engine.
     engine.global_vars.update({'e': escape})
 
-First we try import optimized version of html escape from `wheezy.html`_
-package and if it is not available fallback to one from ``cgi`` package. Next we
-update engine global variables by escape function which is accessible as ``e``
+First we try import an optimized version of html escape from `wheezy.html`_
+package and if it is not available fallback to the one from the ``cgi`` package. Next we
+update the engine's global variables with the escape function, which is accessible as the ``e``
 filter name in template::
 
     @user.name!e
 Inheritance
 ~~~~~~~~~~~
 
-Template inheritance allows you build a master template that contains common
-layout of your site and defines areas that child templates can override.
+Template inheritance allows you to build a master template that contains common
+layout of your site and defines areas that a child templates can override.
 
 
 Master Template
 ^^^^^^^^^^^^^^^
 
-Master template is used to provide common layout of your site. Let define
-master template (name ``shared/master.html``)::
+Master template is used to provide common layout of your site. Let's define
+a master template (name ``shared/master.html``)::
 
     <html>
         <head>
 Child Template
 ^^^^^^^^^^^^^^
 
-Child templates are used to extend master templates via place holders defined::
+Child templates are used to extend master templates via the defined place holders::
 
     @extends("shared/master.html")
 
         </p>
     @end
 
-In this example, the @title and @content place holders are overriden by child
-templates.
+In this example, the @title and @content place holders are overriden by the child
+template.
 
 Include
 ~~~~~~~
 
-The include is useful to insert a template content just in place of call::
+The include is useful to insert a template content just in place of the statement::
 
     @include("shared/snippet/script.html")
 
 
     @textbox(name='username')
 
-Once imported you use these names as variables in template.
+Once imported you use these names as variables in a template.
 
 Code Extension
 --------------
 Preprocessor
 ------------
 
-The :py:class:`~wheezy.template.preprocessor.Preprocessor` process templates
-with syntax for preprocessor engine and vary runtime templates (with runtime
+The :py:class:`~wheezy.template.preprocessor.Preprocessor` processes templates
+with syntax for the preprocessor engine and varying runtime templates (with runtime
 engine factory) by some key function that is context driven. Here is an
 example::
 
                           key_factory=lambda ctx: ctx['locale'])
 
 In this example, the :py:class:`~wheezy.template.preprocessor.Preprocessor` is
-defined to use engine where token start
-is defined as '#', so any directives started with ``#`` are processed one time
-by preprocessor engine. The ``key_factory`` is dependent on runtime context
+defined to use engine with the start token 
+defined as '#'. Any directives starting with ``#`` are processed once only
+by the preprocessor engine. The ``key_factory`` is dependent on runtime context
 and particularly on 'locale'. This way runtime engine factory is varied by
-locale so locale dependent functions (``_`` and ``path_for``) processed only
-once by preprocessor. See complete example in `wheezy.web`_ `demo.template`_
+locale so locale dependent functions (``_`` and ``path_for``) are processed only
+once by the preprocessor. See complete example in `wheezy.web`_ `demo.template`_
 applicaiton.
 
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.