Closed buzzingwires closed 1 year ago
Thanks for your contribution, but I think it's better if people use (key, value) pairs in cases like this. For example:
with tag("label", ("for", "shampoo")):
text("hello")
I only keep the klass
shortcut to avoid breaking people's code, but if I were to design this library today I wouldn't add it.
Understood! Firstly, my apologies for not reading the main documentation more closely, since it already states this approach should be used for reserved keywords other than 'class', and thank you for clarifying your design paradigm. I agree the key/value notation is ultimately a lot more orthogonal.
'for' is another reserved keyword like 'class', and will not work as a keyword parameter for 'tag()', 'stag()', etc'. Allow 'phor' to be passed to specify the 'for' attribute, instead. Additionally, the new structure of the code will allow more substitutions to be easily added by placing entries in the dict '_attr_key_translations' in 'simpledoc.py'