watson.html.elements

class watson.html.elements.TagMixin(**kwargs)[source]

Simple tag mixin used for all html tags.

All keyword arguments that get passed to __init__ will be converted into attributes for the element.

attributes

dict – a dictionary of attributes associated with the tag.

__init__(**kwargs)[source]
watson.html.elements.flatten_attributes(attrs, keep_empty=False)[source]

Flattens attributes into a single string of key=value pairs.

Attributes are sorted alphabetically.