Releasing Datasette 0.25

This commit is contained in:
Simon Willison 2018-09-19 19:48:12 +02:00
commit 57a71377c9
No known key found for this signature in database
GPG key ID: 17E2DEA2588B7F52
5 changed files with 39 additions and 1 deletions

View file

@ -17,6 +17,7 @@ Got CSV data? Use [csvs-to-sqlite](https://github.com/simonw/csvs-to-sqlite) to
## News ## 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 * 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 * 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 * 21st June 2018: [Datasette 0.23.1](http://datasette.readthedocs.io/en/latest/changelog.html#v0-23-1) - minor bug fixes

View file

@ -2,10 +2,27 @@
Changelog 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 <plugin_hook_publish_subcommand>`. Closes `#349 <https://github.com/simonw/datasette/issues/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 <https://github.com/simonw/datasette-json-html>`__ and `datasette-render-images <https://github.com/simonw/datasette-render-images>`__ are two new plugins that use this hook. :ref:`render_cell documentation <plugin_hook_render_cell>`. Closes `#352 <https://github.com/simonw/datasette/issues/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 <plugin_hook_extra_body_script>`.
- ``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 <plugin_hook_extra_css_urls>`.
- You can now use the :ref:`sortable_columns metadata setting <metadata_sortable_columns>` 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 <full_text_search_table_or_view>`, even if that table is not directly coupled to the SQLite FTS feature in the database schema itself.
- Datasette will now use `pysqlite3 <https://github.com/coleifer/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 <https://www.sqlite.org/releaselog/3_25_0.html>`__ which adds window function support. More details on how to use this in `#360 <https://github.com/simonw/datasette/issues/360>`__
- New mechanism that allows :ref:`plugin configuration options <plugins_configuration>` to be set using ``metadata.json``.
.. _v0_24: .. _v0_24:
0.24 (2018-07-23) 0.24 (2018-07-23)
------------------- -----------------
A number of small new features: A number of small new features:

View file

@ -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. 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 Configuring full-text search for a table or view
------------------------------------------------ ------------------------------------------------

View file

@ -94,6 +94,8 @@ registered with Pint::
.. _unit registry: https://github.com/hgrecco/pint/blob/master/pint/default_en.txt .. _unit registry: https://github.com/hgrecco/pint/blob/master/pint/default_en.txt
.. _custom units: http://pint.readthedocs.io/en/latest/defining.html .. _custom units: http://pint.readthedocs.io/en/latest/defining.html
.. _metadata_sortable_columns:
Setting which columns can be used for sorting Setting which columns can be used for sorting
--------------------------------------------- ---------------------------------------------

View file

@ -149,6 +149,8 @@ The priority order for template loading is:
See :ref:`customization` for more details on how to write custom templates, 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. including which filenames to use to customize which parts of the Datasette UI.
.. _plugins_configuration:
Plugin 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. The full list of available plugin hooks is as follows.
.. _plugin_hook_prepare_connection:
prepare_connection(conn) prepare_connection(conn)
~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~
@ -252,6 +256,8 @@ arguments and can be called like this::
select random_integer(1, 10); select random_integer(1, 10);
.. _plugin_hook_prepare_jinja2_environment:
prepare_jinja2_environment(env) prepare_jinja2_environment(env)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -275,6 +281,8 @@ You can now use this filter in your custom templates like so::
Table name: {{ table|uppercase }} Table name: {{ table|uppercase }}
.. _plugin_hook_extra_css_urls:
extra_css_urls(template, database, table, datasette) 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', 'sri': 'sha384-9gVQ4dYFwwWSjIDZnLEWnxCjeSWFphJiwGPXr1jddIhOegiu1FwO5qRGvFXOdJZ4',
}] }]
.. _plugin_hook_extra_js_urls:
extra_js_urls(template, database, table, datasette) extra_js_urls(template, database, table, datasette)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -351,6 +361,8 @@ you have one:
'/-/static-plugins/your_plugin/app.js' '/-/static-plugins/your_plugin/app.js'
] ]
.. _plugin_hook_publish_subcommand:
publish_subcommand(publish) 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 # Your implementation goes here
.. _plugin_hook_render_cell:
render_cell(value, column, table, database, datasette) 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 "&nbsp;" label=jinja2.escape(data["label"] or "") or "&nbsp;"
)) ))
.. _plugin_hook_extra_body_script:
extra_body_script(template, database, table, datasette) extra_body_script(template, database, table, datasette)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~