Commit graph

45 commits

Author SHA1 Message Date
Simon Willison
3bb6409a6c render_cell() can now return an awaitable, refs 2021-08-08 16:05:00 -07:00
Simon Willison
de5ce2e563
datasette-pyinstrument 2021-08-08 10:37:51 -07:00
Simon Willison
6dd14a1221 Improved links to example plugins 2021-08-06 22:38:47 -07:00
Simon Willison
2208c3c68e
Spelling corrections plus CI job for codespell
* Use codespell to check spelling in documentation, refs #1417
* Fixed spelling errors spotted by codespell, closes #1417
* Make codespell a docs dependency

See also this TIL:  https://til.simonwillison.net/python/codespell
2021-08-03 09:36:38 -07:00
Simon Willison
a679d0de87 Fixed spelling of 'receive' in a bunch of places 2021-08-03 09:11:18 -07:00
Simon Willison
eccfeb0871 register_routes() plugin hook datasette argument, closes #1404 2021-07-26 16:16:46 -07:00
Simon Willison
e27dd7c12c Release 0.58
Refs #1365, #1371, #1377, #1384, #1387, #1388, #1389, #1394
2021-07-14 17:33:04 -07:00
Simon Willison
7ea678db22
Warn about potential changes to get_metadata hook, refs #1384 2021-07-14 17:19:31 -07:00
Simon Willison
ea627baccf Removed fallback parameter from get_metadata, refs #1384 2021-06-26 17:02:42 -07:00
Simon Willison
0d339a4897 Removed text about executing SQL, refs #1384 2021-06-26 16:04:39 -07:00
Simon Willison
089278b8db rST fix, refs #1384 2021-06-26 15:49:07 -07:00
Brandon Roberts
baf986c871
New get_metadata() plugin hook for dynamic metadata
The following hook is added:

    get_metadata(
      datasette=self, key=key, database=database, table=table,
      fallback=fallback
    )

This gets called when we're building our metdata for the rest
of the system to use. We merge whatever the plugins return
with any local metadata (from metadata.yml/yaml/json) allowing
for a live-editable dynamic Datasette.

As a security precation, local meta is *not* overwritable by
plugin hooks. The workflow for transitioning to live-meta would
be to load the plugin with the full metadata.yaml and save.
Then remove the parts of the metadata that you want to be able
to change from the file.

* Avoid race condition: don't mutate databases list

This avoids the nasty "RuntimeError: OrderedDict mutated during
iteration" error that randomly happens when a plugin adds a
new database to Datasette, using `add_database`. This change
makes the add and remove database functions more expensive, but
it prevents the random explosion race conditions that make for
confusing user experience when importing live databases.

Thanks, @brandonrobertz
2021-06-26 15:24:54 -07:00
Simon Willison
b1fd24ac9f skip_csrf(datasette, scope) plugin hook, refs #1377 2021-06-23 15:40:09 -07:00
Simon Willison
3a50015566
datasette-publish-now is now called datasette-publish-vercel 2021-06-23 12:51:19 -07:00
Simon Willison
403e370e5a
Fixed reference to default publish implementation 2021-06-23 12:50:19 -07:00
Simon Willison
d23a267138 Make request available to menu plugin hooks, closes #1371 2021-06-09 21:45:24 -07:00
Simon Willison
2bd9d54b27 Fix Jinja warnings, closes #1338, refs #1331 2021-05-23 18:41:50 -07:00
Simon Willison
9789b94da4 ?_facet_size=100 parameter, closes #1332 2021-05-22 17:34:33 -07:00
Simon Willison
6ad544df5e Fixed master -> main in a bunch of places, mainly docs 2021-03-23 09:19:41 -07:00
Simon Willison
7e3cfd9cf7
Clarify the name of plugin used in /-/static-plugins/ 2021-01-19 12:27:45 -08:00
Simon Willison
c38c42948c extra_body_script module support, closes #1187 2021-01-13 18:14:33 -08:00
Simon Willison
fa0c3777b8 script type=module support, closes #1186 2021-01-13 17:50:52 -08:00
Simon Willison
5a77f7a649 Updated docs renaming config to settings
- config.html is now settings.html
- ConfigOption in app.py is now Setting
- updated documentation unit tests

Refs #1106
2020-11-24 13:22:33 -08:00
Simon Willison
5eb8e9bf25 Removed words that minimize involved difficulty, closes #1089 2020-11-12 12:07:19 -08:00
Simon Willison
7b19492070 database_actions() plugin hook, closes #1077 2020-11-02 10:27:25 -08:00
Simon Willison
f0a740ac21 Remove load_plugin hook - closes #1073
Refs #1042

This reverts commit 81dea4b07a.
2020-10-31 09:21:22 -07:00
Simon Willison
81dea4b07a
load_template() plugin hook
Closes #1042
2020-10-30 10:47:18 -07:00
Simon Willison
2f7731e9e5 table_actions() plugin hook plus menu, closes #1066
Refs #690
2020-10-29 22:16:41 -07:00
Simon Willison
18a64fbb29
Navigation menu plus menu_links() hook
Closes #1064, refs #690.
2020-10-29 20:45:15 -07:00
Simon Willison
d6f9ff7137 Docs on Designing URLs for your plugin - closes #1053 2020-10-29 12:35:25 -07:00
gerrymanoim
6e26b05799
Fix syntax error in register_routes docs (#1038)
Thanks, @gerrymanoim
2020-10-21 15:44:16 -07:00
Simon Willison
9a6d0dce28
datasette-json-html as render_cell example 2020-09-23 22:25:06 -07:00
Simon Willison
799ecae948 register_output_renderer can now return Response, closes #953 2020-08-27 21:02:50 -07:00
Simon Willison
3a4c8ed36a Added columns argument to various extra_ plugin hooks, closes #938 2020-08-16 11:09:53 -07:00
Simon Willison
e3639247cd Standard arguments for extra_ plugin hooks, closes #939 2020-08-16 09:50:23 -07:00
Simon Willison
309d7191a1
Fixed broken rST link 2020-08-11 22:11:08 -07:00
Simon Willison
cd231e97cd
Updated example for asgi_wrapper 2020-07-07 19:01:13 -07:00
Simon Willison
549b1c2063 New forbidden() plugin hook, closes #812 2020-06-30 21:17:38 -07:00
Simon Willison
99fba0fad3 Link to datasette-init plugin hook, refs #834 2020-06-28 12:37:50 -07:00
Simon Willison
8b25b14de1 Added note about unit testing the startup() hook 2020-06-28 09:09:48 -07:00
Simon Willison
563f5a2d3a
Magic parameters for canned queries
Closes #842

Includes a new plugin hook, register_magic_parameters()
2020-06-27 19:58:16 -07:00
Simon Willison
4b142862f2 Support non-async view functions, closes #867 2020-06-27 11:30:34 -07:00
Simon Willison
c32af6f693 Split out new 'Writing plugins' page, refs #687 2020-06-21 19:37:48 -07:00
Simon Willison
1f42379089 Improved intro on plugin_hooks.rst page, refs #687
https://datasette.readthedocs.io/en/latest/plugin_hooks.html
2020-06-21 17:52:58 -07:00
Simon Willison
36e77e1006 Move plugin hooks docs to plugin_hooks.rst, refs #687 2020-06-21 17:34:10 -07:00