Anonymous committed 0c28fc4

Module documentation.

Comments (0)

Files changed (3)


 <img src="_images/webhelpers-logo.png" width="100" height="110" 
     style="float:left; margin-right:1em" />
-<p>WebHelpers is a collection of utility functions useful in web application
-templates, controller/view code, and non-web applications.  It consists of
-several independent subpackages:</p>
+<p>WebHelpers contains a wide variety of functions for web application
+templates, MVC controller code, and non-web applications.  Main features:
-<br clear="all" />
+    <ul>
+        <li>Works with any web framework</li>
+        <li>An HTML tag generator that smartly escapes text content
+        to prevent cross-site scripting attacks and double-escaping</li>
+        <li>Convenience functions to produce form tags, links, and other common
+        tags.</li>
+        <li>A <code>ModelTags</code> object </li>
+    </ul>
+It consists of
+several independent subpackages for generating HTML tags and form tags,
+text processing, displaying records a pageful at a time, generating Atom and
+RSS feeds, number formatting and  statistical calculations, handling MIME
+types, and more.  There are also high-level container types, including a value
+counter and accumulator.  There are lists of country names, country codes, US
+states, Canadian provinces, and UK counties.:</p>
 <table style="border:outset">
     <tr><th>constants</th><td>Countries &amp; states for address forms
-    <tr><th>containers</th><td>Helpers for collections</td></tr>
+    <tr><th>containers</th><td>High-level containers &amp; counters</td></tr>
     <tr><th>date</th><td>Date/time helpers</td></tr>
-    <tr><th>feedgenerator</th><td>Create RSS or Atom feeds</td></tr>
-    <tr><th>html</th><td>HTML tags and form tags</td></tr>
+    <tr><th>feedgenerator</th><td>Create Ato and RSS feeds</td></tr>
+    <tr><th>html</th><td>Generate HTML tags and form tags</td></tr>
     wiki-like text to HTML</td></tr>
-    <tr><th>media</th><td>Image files</td></tr>
+    <tr><th>media</th><td>Image file calculations</td></tr>
     <tr><th>mimehelper</th><td>MIME types</td></tr>
-    <tr><th>misc/util</th><td>Other helpers</td></tr>
     <tr><th>number</th><td>Formatters and statistics</td></tr>
     <tr><th>paginate</th><td>Display records a pageful at a time
     <tr><th>text</th><td>Text processing</td></tr>
+<br clear="all" />
 <p>WebHelpers is pure Python and has no dependencies.  However, a few
 helpers depend on 
 <a href="">Routes</a>, 
-<a href="">Pylons</a>, 
 <a href="">unidecode</a>, 
 <a href="">WebOb</a>
-as noted in their documentation.  WebHelpers comes with an extensive set of
-unit tests.</p>
+as noted in their documentation.  The Pylons helpers are designed for <a
+href="">Pylons</a>' request/response/session objects but
+can easily be ported to another web framework.  WebHelpers comes with an
+extensive set of unit tests.</p>
 <p>For support/question/patches, please use the `
 <a href="">Pylons mailing list</a>.</p>
   <p>Download <a href="">WebHelpers PDF documentation</a>.</p>
-  <h2>Developers / Source Code</h2>
-  <p>WebHelpers' Mercurial repository can be found at
-    <a href=""><tt></tt></a>.</p>
+  <h2>Development</h2>
+  <p>WebHelpers source code is at BitBucket.</p>
+  <blockquote>
+    <a href="">Overview</a> -
+    <a href="">Wiki</a> -
+    <a href="">Source code</a>  -
+    <a href="">Bug tracker</a>
+  </blockquote>
+  <p>To check out the Mercurial repository:</p>
-    <p>To check it out:</p>
-      <pre>hg clone</pre>
+  <pre>hg clone</pre>
 {% endblock %}


+   date
+   feedgenerator
 .. toctree::
    :maxdepth: 1


 from datetime import datetime
 import time
-__all__ = ['distance_of_time_in_words']
+__all__ = ["distance_of_time_in_words", "time_ago_in_words"]
 def _process_carryover(deltas, carry_over):
     """A helper function to process negative deltas based on the deltas
     Setting ``round`` to true will check the granularity finer than the
-    set granularity and if the value is greater than 50% of it's range
+    set granularity and if the value is greater than 50% of its range
     the value at granularity will be increased by 1
     Return approximate-time-distance string for ``from_time`` till now.
-    See ``distance_of_time_in_words`` -- same here, but ``to_time`` is 
-    fixed to ````.
+    Same as ``distance_of_time_in_words`` but the endpoint is now.
     return distance_of_time_in_words(from_time,, 
         granularity, round)