Closed PranavMathur closed 5 years ago
That makes sense. Would the phrase for (key, value) in kwargs
work in any of the supported versions of Python? I think it has to iterate over kwargs.items()
in order to yield kv-pairs. I'll make some changes and be sure to test in older versions while I'm at it. Thank you!
You're right, it's kwargs.items()
.
It's on pypi now. Thanks for your contribution!
This PR adds a
simpledoc.data
method that adds HTML5 data attributes to the current tag. The method is called in the same way assimpledoc.attr
. It takes keyword arguments or (key, value) pairs, prefixes each key with "data-", then updates the current tag with the new attributes.The commit also includes documentation on the method, adapted from the documentation of
simpledoc.attr