mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Plugin configuration now lives in datasette.yaml/json
* Checkpoint, moving top-level plugin config to datasette.json * Support database-level and table-level plugin configuration in datasette.yaml Refs #2093
This commit is contained in:
parent
a4c96d01b2
commit
b2ec8717c3
10 changed files with 217 additions and 54 deletions
|
|
@ -184,7 +184,7 @@ This will return the ``{"latitude_column": "lat", "longitude_column": "lng"}`` i
|
|||
|
||||
If there is no configuration for that plugin, the method will return ``None``.
|
||||
|
||||
If it cannot find the requested configuration at the table layer, it will fall back to the database layer and then the root layer. For example, a user may have set the plugin configuration option like so:
|
||||
If it cannot find the requested configuration at the table layer, it will fall back to the database layer and then the root layer. For example, a user may have set the plugin configuration option inside ``datasette.yaml`` like so:
|
||||
|
||||
.. [[[cog
|
||||
from metadata_doc import metadata_example
|
||||
|
|
@ -234,11 +234,10 @@ If it cannot find the requested configuration at the table layer, it will fall b
|
|||
|
||||
In this case, the above code would return that configuration for ANY table within the ``sf-trees`` database.
|
||||
|
||||
The plugin configuration could also be set at the top level of ``metadata.yaml``:
|
||||
The plugin configuration could also be set at the top level of ``datasette.yaml``:
|
||||
|
||||
.. [[[cog
|
||||
metadata_example(cog, {
|
||||
"title": "This is the top-level title in metadata.json",
|
||||
"plugins": {
|
||||
"datasette-cluster-map": {
|
||||
"latitude_column": "xlat",
|
||||
|
|
@ -252,7 +251,6 @@ The plugin configuration could also be set at the top level of ``metadata.yaml``
|
|||
|
||||
.. code-block:: yaml
|
||||
|
||||
title: This is the top-level title in metadata.json
|
||||
plugins:
|
||||
datasette-cluster-map:
|
||||
latitude_column: xlat
|
||||
|
|
@ -264,7 +262,6 @@ The plugin configuration could also be set at the top level of ``metadata.yaml``
|
|||
.. code-block:: json
|
||||
|
||||
{
|
||||
"title": "This is the top-level title in metadata.json",
|
||||
"plugins": {
|
||||
"datasette-cluster-map": {
|
||||
"latitude_column": "xlat",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue