- Notifications
You must be signed in to change notification settings - Fork1.5k
Extend plugin configuration#1062
-
Python plugins are a bit of a hidden feature since they are still a WIP, but we can fetch a python plugin like this: <py-config> plugins = ["http://my-awesome-python-plugin.com/plugin/my-plugin.py"]</py-config> Under the hood, we use the same logic as Using a list for plugins is a good and easy way to get plugins into a pyscript app. We could also allow users to use an extended plugin configuration. Plugin configuration proposed<py-config> [[plugins]] [plugins.hello-world] path = "http://my-awesome-python-plugin.com/plugin/my-plugin.py"</py-config> Or using json <py-configtype="json">plugins": [ { "hello-world": { "path": "http://my-awesome-python-plugin.com/plugin/my-plugin.py" } } ],</py-config> This could be a good way to allow users to pass specific configurations to the plugins, for example: <py-config> [[plugins]] [plugins.hello-world] path = "http://my-awesome-python-plugin.com/plugin/my-plugin.py" coffee = "Yes please"</py-config> Pyscript could then use those extra configurations available as hooks for the plugin itself (which I think is the idea of the Some concernsUsing this extended configuration does bring some issues. For once, it will be easier to have a bad config if you don't know toml/json. The code that ingests the config and looks over the plugins will have to be more complex to handle the more complex structure. |
BetaWas this translation helpful?Give feedback.
All reactions
Replies: 2 comments 1 reply
-
I like this plugin configuration quite a lot! Keeping the plugin attributes out of the root level of <py-config> is swell, and prevents us from running into naming collisions for plugin attributes down the road. +1 from me. One small comment on the proposed format - it feels slightly awkward that [plugins.dog-facts]path ="site/dogs.py"goodpet =true[plugins.alligator-warning]path ="site/gator.py"goodpet =false or in JSON {"plugins": {"dog-facts": {"goodpet":true,"path":"site/dogs.py" },"alligator-warning": {"goodpet":false,"path":"site/gator.py" } }} |
BetaWas this translation helpful?Give feedback.
All reactions
-
Oh that's much better! I don't really know how toml works that well that's why I thought we had to do the +1 on this one! |
BetaWas this translation helpful?Give feedback.
All reactions
-
Got to have a big ole conversation last week about Plugin metadata configuration at the February offsite - here's anupdated proposal for plugin configuration and what the |
BetaWas this translation helpful?Give feedback.