Closed ju5t closed 3 years ago
@xiCO2k Either we use the HTML API or we use other. We need to decide on that.
I think the HTML api would be the better option.
I think it is a matter of preference. For me, using link
and line
are more intuitive than html tags and closer to its origin of the command line, and are, at least for me, easier to remember. I personally think html-tags have no place on the command line.
E.g. a span
is an inline-block and never has a line break, but on the command line a line break is often implied. So, if it has to be html, a div makes more sense. But as a div implies a container, often containing multiple elements, it can't be a div either. Eventually, a line is all that remains :)
Either way, I was hoping to find a middle ground by adding aliases.
My perfect world would probably be class-based elements, instead of method based. I realise this might be way beyond the point of deciding whether or not you should use html tags as a primary API. But it would probably give users a clean way of building their own heading, alert, block or any other element.
@nunomaduro I think it's probably better to close this PR as:
I understand the need to settle on one API, but in that case, this package is probably not for me (which is totally fine!). The idea is still cool and who knows, perhaps one day I look back and think that html on the command line is the right API :)
Edit: forgot to say, thanks for the awesome work you're doing though, I am a huge, huge fan of Laravel Zero, Larastan and when we're ready to move on to Pest, probably that too :)
This makes sure that the CLI purists (including myself) can use the old
line
method. The recently addeda()
aliases tolink()
. I know this is a personal opinion, but I think the package can support both uses.I was a bit unsure if I should test this. The other functions didn't seem to have tests either. I haven't jumped on the PEST train either (yet) but the docs are really clear, so it should be doable to make some tests for it if needed.
If you disagree with this feature, no worries. As a user you can always alias it yourself, if you want.
edit: I didn't change the underlying class methods, but it might be worthwhile aliasing them too? Perhaps in the future.