support attribute splat operator
For a variable of type (string, string)[] or string[string] it should be possible to apply all items in the array as attributes for any tag such that the keys (or first items in tuples) are the attribute names and the values (or second items in tuples) are the attribute values.
So for a given variable like this
string[string] myAttrs = ["src": "image.png", "alt": "cool image", "title": "this is a cool image"];
it would be possible to splat it onto some kind of element, let's say a <div> element, for example with a syntax that could look like this:
div(*myAttrs, extra="attributes here")
resulting in this HTML: (attribute order not guaranteed with AA but should be guaranteed with list of tuples)
<div src="image.png" alt="cool image" title="this is a cool image" extra="attributes here">
This should be generic to work with any input ranges of key/value pairs or 2 item tuples as well as any value types. For attributes that are specified multiple times, or implicitly from other syntax, the same rules as typing out all the attributes now should apply. (e.g. combining .dot style class names with class attributes)
See https://forum.dlang.org/post/[email protected]