Version b3 converts arguments like "data_a_b" to "data-a-b". It's not in
PyPI (I must have forgotten that step) but it's in the source. Version b4
will probably be out this weekend, with at least 'classes' and 'styles',
because I need that for a project.

There was some discussion about whether there is ever any use case to *not*
convert underscores; i.e., whether it needs to be switchable outside the
specific case of "data_" -> "data-". I don't think so because the HTML spec
seems to say that only hyphens are valid in attribute names.



On Fri, Jun 28, 2013 at 2:31 PM, Jonathan Vanasco <jonat...@findmeon.com>wrote:

>
>
> On Friday, June 28, 2013 5:04:08 PM UTC-4, Mike Orr wrote:
>>
>>
>> Are there any other syntactic sugar patterns that would be helpful in a
>> Javascript-rich or HTML 5 application?
>>
>
> you should support html5 custom data attributes , the *data-** syntax.
>
> ie:
>     <a href="http://example.com"; data-a="1" data-b-a="2">Link to
> Example.com</a>
>
> you can have one (or more) dashes in them, so I'm not sure how you could
> pass them in , other than as a dict
>
>     make_tag(... attrs={ 'data-a' :1 , 'data-b-a':2 }... )
>     make_tag(... data_attrs={ 'data-a' :1 , 'data-b-a':2 }... )
>     make_tag(... data_attrs={ 'a' :1 , 'b-a':2 }... )
>
> personally i would prefer one of the first two options; i'm only bringing
> up the last one to note my disapproval of it.
>
> --
> You received this message because you are subscribed to the Google Groups
> "pylons-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pylons-devel+unsubscr...@googlegroups.com.
> To post to this group, send email to pylons-devel@googlegroups.com.
> Visit this group at http://groups.google.com/group/pylons-devel.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 
Mike Orr <sluggos...@gmail.com>

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-devel+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/pylons-devel.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to