Wykres commitów

658 Commity (facet-refactor)

Autor SHA1 Wiadomość Data
Simon Willison 24cea27196
Link to "The interesting ideas in Datasette" 2018-10-03 19:40:04 -07:00
Simon Willison 96af802352
Travis applies :latest tag to Docker release, refs #329 2018-09-19 20:23:56 +02:00
Simon Willison 57a71377c9
Releasing Datasette 0.25 2018-09-19 19:48:12 +02:00
Jay Graves 1bcd54a834 Fix small doc typo - thanks @jaywgraves (#365) 2018-09-19 18:15:42 +01:00
Simon Willison b7257a21bf
Fix json.loads in Python 3.5
3.5 requires a str, not a bytes

https://travis-ci.org/simonw/datasette/jobs/421660555
2018-08-28 17:55:30 +01:00
Simon Willison 1f54e09230
Better docs for publish_subcommand() plugin hook 2018-08-28 11:59:50 +01:00
Simon Willison b7c6a9f9bd
extra_css_urls(template, database, table, datasette)
The extra_css_urls and extra_js_urls hooks now take additional optional
parameters.

Also refactored them out of the Datasette class and into RenderMixin.

Plus improved plugin documentation to explicitly list parameters.
2018-08-28 11:56:57 +01:00
Simon Willison fbf446965b
Refactoring: renamed "name" variable to "database" 2018-08-28 11:25:13 +01:00
Simon Willison 2e836f72d9
render_cell(value, column, table, database, datasette)
The render_cell plugin hook previously was only passed value.

It is now passed (value, column, table, database, datasette).
2018-08-28 03:03:01 -07:00
Simon Willison 9e1fca4b01
Corrected indentation in metadata.rst 2018-08-28 02:56:34 -07:00
Simon Willison 5cf0c6c91c
New plugin hook: extra_body_script 2018-08-28 02:02:49 -07:00
Simon Willison 0a14a4846b
Added plugin_config() method 2018-08-28 01:35:21 -07:00
Simon Willison 1905c03364
New ds.metadata() method 2018-08-28 00:45:39 -07:00
Simon Willison 0bd41d4cb0
Do not show default plugins on /-/plugins 2018-08-28 00:36:22 -07:00
Simon Willison aae49fef3b
Import pysqlite3 if available, closes #360 (#361) 2018-08-15 17:58:56 -07:00
Simon Willison 2189be1440
Refactor to use new datasatte.config(key) method 2018-08-11 13:09:07 -07:00
Simon Willison e1db8194e8
Bump versions of pytest, pluggy and beautifulsoup4 (#358) 2018-08-07 18:11:12 -07:00
Simon Willison fe5b6ea95a
Hide 'view and edit SQL' if config.allow_sql turned off 2018-08-05 20:17:17 -07:00
Simon Willison 7d0299edd4
fts_table and fts_pk metadata configs, available for both tables and views 2018-08-05 17:44:47 -07:00
Simon Willison 5629aaca67
sortable_columns also now works with views 2018-08-05 17:29:23 -07:00
Simon Willison 4ac9132240
render_cell(value) plugin hook, closes #352
New plugin hook for customizing the way cells values are rendered in HTML.

The first full example of this hook in use is https://github.com/simonw/datasette-json-html
2018-08-04 17:14:56 -07:00
Simon Willison 295d005ca4
Renamed variable, since docs are not written in Markdown 2018-07-27 21:56:51 -07:00
Simon Willison 8128497b79
Only run documented_views() fixture once per session
Speeds up tests, because previously it ran once per view class.
2018-07-27 21:49:20 -07:00
Simon Willison 788a542d3c
Docs for IndexView, TableView, RowView, closes #299
Also removed xfail from test_view_classes_are_documented, so any future *View
classes that are added without documentation will cause the tests to fail.
2018-07-27 21:21:42 -07:00
Simon Willison 8da6b0d542
Added labels so unit tests can detect docs, refs #299 2018-07-27 20:26:18 -07:00
Simon Willison e8625695a3
xfail documentation unit tests for view classes, refs #299
More documentation unit tests. These ones check that every single **View class
imported into the datasette/app.py module are covered by our documentation.

Just one problem: they aren't documented yet. So I'm using the xfail pytest
decorator to mark these tests as allowed-to-fail. When you run the test suite
you now get a report of how many views still need to be documented, but it
doesn't fail the tests.

The output looks something like this:

    $ pytest tests/test_docs.py
    collected 31 items

    tests/test_docs.py ..........................XXXxx.                [100%]

    ============ 26 passed, 2 xfailed, 3 xpassed in 1.06 seconds ============

Once I have documented all the views I will remove the xfail so any future
views that are added without documentation will cause a test failure.

We can detect that a view is documented by looking for ReST label in the docs,
for example:

    .. _IndexView:

Some view classes can be used to power multiple URLs - the JsonDataView class
for example is used to power /-/metadata and /-/config and /-/plugins

In this case, the second part of the label can indicate the variety of page, e.g:

    .. _JsonDataView_metadata:

The test will pass as long as there is at least one label that starts with
_JsonDataView.
2018-07-27 20:13:26 -07:00
Simon Willison 3b68314d8f
Unit tests for publish now/heroku - closes #348 2018-07-25 22:45:47 -07:00
Simon Willison 1fb518618c
"datasette publish heroku" improvements
* Fixed bug where --title= didn't work if -m not provided
* Now using Python 3.6.6 instead of Python 3.6.3
2018-07-25 22:43:01 -07:00
Simon Willison dbbe707841
publish_subcommand hook + default plugins mechanism, used for publish heroku/now (#349)
This change introduces a new plugin hook, publish_subcommand, which can be
used to implement new subcommands for the "datasette publish" command family.

I've used this new hook to refactor out the "publish now" and "publish heroku"
implementations into separate modules. I've also added unit tests for these
two publishers, mocking the subprocess.call and subprocess.check_output
functions.

As part of this, I introduced a mechanism for loading default plugins. These
are defined in the new "default_plugins" list inside datasette/app.py

Closes #217 (Plugin support for datasette publish)
Closes #348 (Unit tests for "datasette publish")
Refs #14, #59, #102, #103, #146, #236, #347
2018-07-25 22:15:59 -07:00
Simon Willison 3ac21c7498
Unit test confirming all plugin hooks are documented 2018-07-25 21:09:59 -07:00
Simon Willison ba64cfb4bc
Fix for Python 3.5
https://stackoverflow.com/a/42694113/6083
2018-07-25 10:20:56 -07:00
Simon Willison 9b85c59907
Removed unnecessary print statements from tests 2018-07-24 09:04:06 -07:00
Simon Willison bd1db56936
'Usage: datasette', not 'Usage: cli' - refs #336 2018-07-24 09:03:07 -07:00
Simon Willison 74ad3ff4af
Ensure --help examples in docs are always up to date, closes #336
Unit tests now check that docs/*.txt help examples are all up-to-date.

I ran into a problem here in that the terminal_width needed to be more
accurately defined - so I replaced update-docs-help.sh with update-docs-
help.py which hard-codes the terminal width.
2018-07-24 09:01:23 -07:00
Simon Willison 3a46d5e3c4
Removed docker -e flag
docker -e flag is now deprecated: https://docs.docker.com/engine/deprecated/#-e-and---email-flags-on-docker-login
2018-07-23 21:48:36 -07:00
Simon Willison 28872a1fa7
Release notes for 0.24 release 2018-07-23 21:34:38 -07:00
Simon Willison 2bdab66772
Build and push new tagged releases to Docker Hub
Based on method described in https://sebest.github.io/post/using-travis-ci-to-build-docker-images/
2018-07-23 21:17:57 -07:00
Simon Willison 581b4c97ee
URLify URLs in custom SQL queries, closes #298 2018-07-23 20:56:32 -07:00
Simon Willison 3955771fea
Unit tests for advanced export box HTML, closes #320 2018-07-23 20:38:31 -07:00
Simon Willison 700d83d8ad
?_json_infinity=1 for handling Infinity/-Infinity - fixes #332 2018-07-23 20:07:57 -07:00
Simon Willison b320f58d13
'publish now' uses force_https_urls:on - closes #333 2018-07-23 18:51:43 -07:00
Simon Willison f24b49a1a8
New force_https_urls option, refs #333 2018-07-23 08:58:29 -07:00
Simon Willison 4e82d0e64d
Removed unused imports 2018-07-23 08:39:00 -07:00
Simon Willison 6e37f091ed
Support title/description for canned queries, closes #342
Demo here: https://latest.datasette.io/fixtures/neighborhood_search
2018-07-15 19:33:30 -07:00
Russ Garrett 58fec99ab0 Allow app names for `datasette publish heroku`
Lets you supply the `-n` parameter for Heroku deploys, which also lets
you update existing Heroku deployments.
2018-07-14 07:04:42 -07:00
Simon Willison 31a5d8fa77 Bump aiohttp to fix compatibility with Python 3.7
Tests failed here: https://travis-ci.org/simonw/datasette/jobs/403223333
2018-07-12 11:07:37 -07:00
Simon Willison 130dc8823e
Run Travis CI against Python 3.7 as well 2018-07-12 10:36:00 -07:00
Simon Willison aec3ae5323
Docs for datasette publish and package, closes #337
Also introduced a new mechanism for ensuring the --help examples in the
documentation reflect the current output of the --help commands, via a new
update-docs-help.sh script. Closes #336
2018-07-10 19:05:46 -07:00
Simon Willison 9281a4a804
New tagline: 'A tool for exploring and publishing data' 2018-07-10 19:05:41 -07:00
Simon Willison fc9b1cc136
New truncate_cells_html config for truncating cells, closes #330 2018-07-10 09:20:41 -07:00