WebHelpers provides functions useful in web applications: generating HTML tags, showing results a pageful at a time, etc. It may be used with any web framework or template engine.
The biggest difference between WebHelpers 0.6 and previous versions is the new HTML tag generator with smart escaping, and the new helpers written to replace the deprecated webhelpers.rails. A brief summary of the module layout is below; see the docstrings in the source for documentation.
- Country codes, states and provinces.
- High-level container objects and dict/list helpers.
- Date/time helpers. These currently format strings based on dates.
- A syndication feed library, used for generating RSS, Atom, etc. Ported from Django.
A package of HTML-related helpers.
- A library for generating HTML tags with smart escaping. All public symbols are imported into webhelpers.html.
- Text-to-HTML converters.
- Helpers producing chunks of HTML.
- A text to HTML converter. Normally invoked via webhelpers.tools.markdown(). (If you use this library directly, you may have to wrap the results in literal() to prevent double escaping.)
- Miscellaneous helpers that are neither text, numeric, container, or date.
- Numeric helpers and number formatters.
- A tool for letting you view a large sequence a screenful at a time, with previous/next links.
- The string module from Python 2.4. Useful if you're running on Python 2.3.
- Helpers producing simple HTML tags.
- Helpers producing string output, suitable for both HTML and non-HTML applications.
- Another text to HTML converter. Normally invoked via webhelpers.tools.textilize(). (If you use this library directly, you may have to wrap the results in literal() to prevent double escaping.)
- Helpers producing complex chunks of HTML.
- Miscellaneous functions.
The following modules/packages are deprecated and will be removed in a future version of WebHelpers:
- Older version of webhelpers.html, without smart escaping.
- Older version of webhelpers.paginate.
WebHelpers is package aimed at providing helper functions for use within web applications.
These functions are intended to ease web development with template languages by removing common view logic and encapsulating it in re-usable modules as well as occasionally providing objects for use within controllers to assist with common web development paradigms.
For support/question/patches, please use the Pylons mailing list.
WebHelpers does not have any install dependencies, but some functions depend on third-party libraries.
Version >= 1.7 but < 2.0 must be installed and running in the current web framework for:
- the regression tests in the source distribution
A future version of WebHelpers will be compatible with Routes 2, which is still in development.
The Flash class in webhelpers.session imports pylons.session. The class can easily be reimplemented in another web framework.