SalladShooter / phyal

Quickly build websites without the hassle of HTML
https://phyal.vercel.app/
MIT License
34 stars 3 forks source link

Could `attributes` be a `dict`? #11

Closed Matt-DESTROYER closed 2 months ago

Matt-DESTROYER commented 2 months ago

Could attributes of Tags be a dictionary? Would it make more sense given that you can't have duplicate attributes?

# ...

class Tag:

    def __init__(self, name, text=''):
        self.name = name
        self.attributes = []
        self.children = []
        self.text = text

    def attribute(self, key, value):
        self.attributes.append((key, value))
        return self

# ...
SalladShooter commented 2 months ago

Hi thanks for the suggestion, and yes! I should probably be able make this change for the next big update planned to release soon (0.3.0).

Matt-DESTROYER commented 2 months ago

Would you be open to contributions? Or is this more of a personal project? :)

SalladShooter commented 2 months ago

@Matt-DESTROYER Yes, PHYAL started as a solo project, but in the grand scheme I always wanted community contributions. If you want to work on current source code I can invite you to the source code Repl and GitHub Repo.

SalladShooter commented 2 months ago

Would you be open to contributions

@Matt-DESTROYER If you have more ideas, that would be great, especially to keep future updates going.