Skip to content

Commit

Permalink
add note on attribute names to set_attribute docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
srittau committed Mar 19, 2014
1 parent 722231e commit 4e6644e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion htmlgen/element.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,11 @@ def __init__(self, element_name):
self._styles = {}

def set_attribute(self, name, value):
"""Set a HTML attribute to a given string value.
"""Set an HTML attribute to a given string value.
The validity of an attribute name is not checked, please refer to
the HTML standard for allowed attribute names. A good guideline is
to use only alphanumeric characters and dashes.
>>> element = Element("div")
>>> element.set_attribute("title", "Test Title")
Expand Down

0 comments on commit 4e6644e

Please sign in to comment.