Over the weekend Ben and I and others developed a plan to overhaul
WebHelpers.  A preliminary API proposal is here:
http://wiki.pylonshq.com/display/pylonsprojects/WebHelpers+ideas .
The main goals are:

    *  Consolidate the 21 submodules into a much smaller number.
    * Fix the bugs, inefficiencies, and unpythonic Rails'isms in the
functions.  Consider each function for API improvement or elimination.
    * Replace the paginator with Christoph Haas' improved one.
    * Convert the HTML-generation functions to use ElementTree. These
can be used by Genshi directly but will need a new default filter for
Mako. These will probably be moved from webhelpers.rails.* to
webhelpers.html.
    * Add support for more Javascript libraries, and write a common
function interface they should all provide.

The plan includes deprecating the 'rails' subpackage and some other
things, and providing equivalent functionality in other submodules.
Depending on the API we ultimately decide, this may or may not have a
significant impact on user code.  Currently the 'webhelpers' module
"import *"''s everything in 'rails', which are exposed as 'h' in
controllers and templates via 'myapp.lib.helpers'.  We will probably
continue this for the most-used functions, but lesser-used ones may
require dotted access or explicit imports.

The old functions will be available but deprecated in Pylons 0.9.7
(spring 2008), and eliminated in Pylons 1.0 (summer/fall).  The API is
not fixed yet and there's no reference implementation, so you'll have
to continue using the existing WebHelpers functions for now.

Feedback questions:

* Which parts of WebHelpers do you use besides url_for and the form tags?

* Do you use the 'hinclude', 'htmlgen', 'textile', or
'compress_resources'  helpers?

* There are three text-to-HTML helpers: 'htmlgen', 'textile',
'markdown'.  Do we need all of these or can we standardize on one?  Do
they even need to be in WebHelpers at all?  The user could import them
separately.

* 'simple_format' in 'webhelpers.rails.text' does your basic "text
paragraphs to <p> and single newlines to <br>" formatting.  But
displaying untrusted text requires more formatting than this,
especially escapling/removing disallowed tags.  Should we replace
'simple_formatting' with something more sophistocated, and if so,
what?

* Are you satisfied with Scriptaculous/Prototype?  Which other
Javascript libraries would you like to see in WebHelpers.  Do you use
any of the 'webhelpers.rails.prototype' functions besides
'link_to_remote'?  Ben wants to replace 'link_to_remote' with a
function that has more client-side-Javascript, to avoid the
inefficient eval of the JSON result.  Are there any other functions
which would be useful?

'url_for' will likely be changing to a smarter 'url' object, and moved
out of WebHelpers.  More info soon.

You can provide feedback in this thread and/or on the wiki page.
Please put anything complicated or super-important in the wiki, so it
doesn't slip through the cracks.

-- 
Mike Orr <[EMAIL PROTECTED]>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to