-
-
Notifications
You must be signed in to change notification settings - Fork 698
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Maybe let plugins define custom serve options? #1591
Comments
The challenge here is avoiding clashes. What if a plugin adds an option that I later want to use for a new Datasette core feature? Or what if two plugins define the same option? Maybe the solution is to make them use namespaces defined by the plugin name. How about this:
It's a bit verbose having an option that itself then takes THREE strings: plugin name, setting name, setting value - but it would work. |
Is it possible to parse things like |
I try to stick pretty closely to what Click supports, and Click likes you to define options explicitly so that it can display them in the output of But... that makes me think that actually showing these options in
That's not great help! The alternative would be to allow plugins to register their extra options with the command - which would mean the help output could look like this instead:
This feels like a good argument to me for plugins to explicitly register their settings. I'm not sure if I should enforce the |
Another option: if I make plugin settings a higher level concept in Datasette than they are at the moment, I could allow them to be set either using I want to make changes to that anyway, because I'm increasingly uncomfortable with plugin settings ending up in the "metadata" mechanism. |
You can already run Or I could even have available plugin settings show up as a list at the bottom of the
|
The It's a bit of a messy hack to compensate for metadata being visible. Maybe I could replace that mechanism with the proposed plugin configuration rethink from this issue. I still like the debug benefits of making plugin settings public - perhaps add a rule that if a plugin setting has a |
There's actually already a way to move regular Datasette Maybe extending that mechanism to handle plugins would be a neat path forward here. |
https://twitter.com/psychemedia/status/1481171650934714370
I've thought something like this might be useful for other plugins in the past, too.
The text was updated successfully, but these errors were encountered: