mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Experimental load_metadata() hook, refs #357
This commit is contained in:
parent
df2879ee2a
commit
d11fd2cbaa
5 changed files with 20 additions and 8 deletions
|
|
@ -17,7 +17,8 @@ Options:
|
|||
--cors Enable CORS by serving Access-Control-Allow-Origin: *
|
||||
--load-extension PATH Path to a SQLite extension to load
|
||||
--inspect-file TEXT Path to JSON file created using "datasette inspect"
|
||||
-m, --metadata FILENAME Path to JSON file containing license/source metadata
|
||||
-m, --metadata TEXT Path to JSON file containing license/source metadata, or
|
||||
input to a metadata plugin
|
||||
--template-dir DIRECTORY Path to directory containing custom templates
|
||||
--plugins-dir DIRECTORY Path to directory containing custom plugins
|
||||
--static MOUNT:DIRECTORY Serve static files from this directory at /MOUNT/...
|
||||
|
|
|
|||
|
|
@ -813,3 +813,12 @@ This example plugin adds a ``x-databases`` HTTP header listing the currently att
|
|||
await app(scope, recieve, wrapped_send)
|
||||
return add_x_databases_header
|
||||
return wrap_with_databases_header
|
||||
|
||||
.. _plugin_load_metadata:
|
||||
|
||||
load_metadata(metadata_value)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Return a Python dictionary of metadata configuration values. The ``metadata_value`` argument will be the value passed to the ``-m`` or ``--metadata`` argument to ``datasette serve``.
|
||||
|
||||
Only one plugin can implement this at a time. The first registered plugin will get to provide the metadata dictionary, while all other plugins will be ignored.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue