zspecza / common-tags

🔖 Useful template literal tags for dealing with strings in ES2015+
Other
2k stars 61 forks source link

More generic name for `html` tag? #33

Closed yortus closed 8 years ago

yortus commented 8 years ago

I came across this library via 2ality. Thanks for this great collection of problem solvers!

My main use is for the html tag - but my template contains JavaScript source code, not HTML. In fact the html tag is pretty useful while generating any block-structured code with correct indenting.

It looks a little strange and not so self-documenting to see JavaScript source inside a html tagged template. At present I just import it using something like import {html as js} from 'common-tags', but it also looks a bit odd seeing html there.

So, I was wondering if this tag could have a more generic name (or at least an alias) exported from the library itself?

zspecza commented 8 years ago

Hi @yortus - glad you're enjoying the library! Sure, I can get down with adding an alias. Perhaps source or structured?

yortus commented 8 years ago

Great. source sounds good, or maybe codeBlock.

zspecza commented 8 years ago

@yortus - I've added source and codeBlock aliases for the html tag in #35. This is published on NPM as v1.2.0

yortus commented 8 years ago

That's awesome, thanks @declandewet!