diff --git a/README.md b/README.md index 170667ff..227f39bc 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ Got CSV data? Use [csvs-to-sqlite](https://github.com/simonw/csvs-to-sqlite) to ## News +* 19th September 2018: [Datasette 0.25](http://datasette.readthedocs.io/en/latest/changelog.html#v0-25) - New plugin hooks, improved database view support and an easier way to use more recent versions of SQLite. * 23rd July 2018: [Datasette 0.24](http://datasette.readthedocs.io/en/latest/changelog.html#v0-24) - a number of small new features * 29th June 2018: [datasette-vega](https://github.com/simonw/datasette-vega), a new plugin for visualizing data as bar, line or scatter charts * 21st June 2018: [Datasette 0.23.1](http://datasette.readthedocs.io/en/latest/changelog.html#v0-23-1) - minor bug fixes diff --git a/docs/changelog.rst b/docs/changelog.rst index 4071c9e2..27d1d3ad 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -2,10 +2,27 @@ Changelog ========= +.. _v0_25: + +0.25 (2018-09-19) +----------------- + +New plugin hooks, improved database view support and an easier way to use more recent versions of SQLite. + +- New ``publish_subcommand`` plugin hook. A plugin can now add additional ``datasette publish`` publishers in addition to the default ``now`` and ``heroku``, both of which have been refactored into default plugins. :ref:`publish_subcommand documentation `. Closes `#349 `__ +- New ``render_cell`` plugin hook. Plugins can now customize how values are displayed in the HTML tables produced by Datasette's browseable interface. `datasette-json-html `__ and `datasette-render-images `__ are two new plugins that use this hook. :ref:`render_cell documentation `. Closes `#352 `__ +- New ``extra_body_script`` plugin hook, enabling plugins to provide additional JavaScript that should be added to the page footer. :ref:`extra_body_script documentation `. +- ``extra_css_urls`` and ``extra_js_urls`` hooks now take additional optional parameters, allowing them to be more selective about which pages they apply to. :ref:`Documentation `. +- You can now use the :ref:`sortable_columns metadata setting ` to explicitly enable sort-by-column in the interface for database views, as well as for specific tables. +- The new ``fts_table`` and ``fts_pk`` metadata settings can now be used to :ref:`explicitly configure full-text search for a table or a view `, even if that table is not directly coupled to the SQLite FTS feature in the database schema itself. +- Datasette will now use `pysqlite3 `__ in place of the standard library ``sqlite3`` module if it has been installed in the current environment. This makes it much easier to run Datasette against a more recent version of SQLite, including the just-released `SQLite 3.25.0 `__ which adds window function support. More details on how to use this in `#360 `__ +- New mechanism that allows :ref:`plugin configuration options ` to be set using ``metadata.json``. + + .. _v0_24: 0.24 (2018-07-23) -------------------- +----------------- A number of small new features: diff --git a/docs/full_text_search.rst b/docs/full_text_search.rst index 70900341..6bf3b567 100644 --- a/docs/full_text_search.rst +++ b/docs/full_text_search.rst @@ -69,6 +69,8 @@ And then populate it like this: You can use this technique to populate the full-text search index from any combination of tables and joins that makes sense for your project. +.. _full_text_search_table_or_view: + Configuring full-text search for a table or view ------------------------------------------------ diff --git a/docs/metadata.rst b/docs/metadata.rst index 8b19d8c1..e01803db 100644 --- a/docs/metadata.rst +++ b/docs/metadata.rst @@ -94,6 +94,8 @@ registered with Pint:: .. _unit registry: https://github.com/hgrecco/pint/blob/master/pint/default_en.txt .. _custom units: http://pint.readthedocs.io/en/latest/defining.html +.. _metadata_sortable_columns: + Setting which columns can be used for sorting --------------------------------------------- diff --git a/docs/plugins.rst b/docs/plugins.rst index 7d78f365..3380bbc4 100644 --- a/docs/plugins.rst +++ b/docs/plugins.rst @@ -149,6 +149,8 @@ The priority order for template loading is: See :ref:`customization` for more details on how to write custom templates, including which filenames to use to customize which parts of the Datasette UI. +.. _plugins_configuration: + Plugin configuration -------------------- @@ -228,6 +230,8 @@ When you implement a plugin hook you can accept any or all of the parameters tha The full list of available plugin hooks is as follows. +.. _plugin_hook_prepare_connection: + prepare_connection(conn) ~~~~~~~~~~~~~~~~~~~~~~~~ @@ -252,6 +256,8 @@ arguments and can be called like this:: select random_integer(1, 10); +.. _plugin_hook_prepare_jinja2_environment: + prepare_jinja2_environment(env) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -275,6 +281,8 @@ You can now use this filter in your custom templates like so:: Table name: {{ table|uppercase }} +.. _plugin_hook_extra_css_urls: + extra_css_urls(template, database, table, datasette) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -319,6 +327,8 @@ Or a list of dictionaries defining both a URL and an 'sri': 'sha384-9gVQ4dYFwwWSjIDZnLEWnxCjeSWFphJiwGPXr1jddIhOegiu1FwO5qRGvFXOdJZ4', }] +.. _plugin_hook_extra_js_urls: + extra_js_urls(template, database, table, datasette) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -351,6 +361,8 @@ you have one: '/-/static-plugins/your_plugin/app.js' ] +.. _plugin_hook_publish_subcommand: + publish_subcommand(publish) ~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -400,6 +412,8 @@ Let's say you want to build a plugin that adds a ``datasette publish my_hosting_ ): # Your implementation goes here +.. _plugin_hook_render_cell: + render_cell(value, column, table, database, datasette) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -468,6 +482,8 @@ If the value matches that pattern, the plugin returns an HTML link element: label=jinja2.escape(data["label"] or "") or " " )) +.. _plugin_hook_extra_body_script: + extra_body_script(template, database, table, datasette) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~